I have a sample of a ProtoBuf encoded message, as well as all of the .proto files. I know that the message is one of the messages in the proto files. Is there some way to figure out which message fits the encoded message?

有帮助吗?

解决方案

In general, no. The protobuf format is dense, and the same bytes may be valid as two different kinds of messages.

That said, you can pipe the message to protoc --decode_raw to see the content with numeric tags. From there, you might be able to manually compare it against each type to decide whether it makes sense as that type.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top