Decode with schema in manualdecrypt utility
This commit is contained in:
parent
1d86a6c129
commit
e0eb5b8e3f
1 changed files with 7 additions and 2 deletions
|
@ -109,12 +109,17 @@ func main() {
|
|||
_, _ = fmt.Fprintln(os.Stderr, "------------------------------ RAW DECRYPTED DATA ------------------------------")
|
||||
fmt.Println(base64.StdEncoding.EncodeToString(decrypted))
|
||||
_, _ = fmt.Fprintln(os.Stderr, "--------------------------------- DECODED DATA ---------------------------------")
|
||||
cmd := exec.Command("protoc", "--decode_raw")
|
||||
respType, ok := requestType[ord.Action]
|
||||
var cmd *exec.Cmd
|
||||
if ok {
|
||||
cmd = exec.Command("protoc", "--proto_path=../gmproto", "--decode", string(respType.ProtoReflect().Type().Descriptor().FullName()), "client.proto")
|
||||
} else {
|
||||
cmd = exec.Command("protoc", "--decode_raw")
|
||||
}
|
||||
cmd.Stdin = bytes.NewReader(decrypted)
|
||||
cmd.Stdout = os.Stderr
|
||||
cmd.Stderr = os.Stderr
|
||||
mustNoReturn(cmd.Run())
|
||||
respType, ok := requestType[ord.Action]
|
||||
if ok {
|
||||
respData := respType.ProtoReflect().New().Interface()
|
||||
mustNoReturn(proto.Unmarshal(decrypted, respData))
|
||||
|
|
Loading…
Reference in a new issue