Pergunta

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?

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top