Decompiling protobuf messages
You have a few options if you don’t have the original proto IDL, but want to build it or just guess it from a binary protobuf message.
If you can at all help it (get your hands on the proto IDL for the data) it’s recommended that you don’t parse binary messages without the proto. It’s unreliable, as many fields can share the same types (e.g., it’s impossible to tell the difference between number-types and enums.)
- If you just need to see the format, you can use
protoc --decode_raw
to guess at the types. - You can use https://github.com/konsumer/rawproto to extract the same sort of data as JSON or proto, which is a useful start, if you tune the output a bit.
- You can parse it by hand. This is pretty tricky, and not at all recommended because it’s the most error-prone, and one of the other options should get you where you need to be, but there is documentation about how the messages are encoded https://developers.google...