Reputation: 35
One is the original data, the other is the data converted by the web analyzer. How can I convert the data into the web analyzer with C#? I don't have a model.
Upvotes: 2
Views: 2848
Reputation: 1064204
If you don't have a schema, frankly you need to reverse engineer one. Or chase down the source of the data and obtain the existing one, which is usually much easier.
Protobuf is an ambiguous format without it, and there is no one correct single way if decoding many of the "wire types". You can use tools like protoc
(in decode-raw mode), or https://protogen.marcgravell.com/decode to try and decipher the raw data to try and put a schema together, but it is a little tedious and often requires some knowledge of what the data should be. For example, a "variant" - after the varint step - could be:
Plus for the last 3 options, the same payload could be 32-bit or 64-bit (this doesn't change the value, but may change things if a later value is larger).
If you need help, I might be able to take a look - I've reverse engineered protobuf schemas many times.
If you just want raw access to the interpreted stream, protobuf-net has a ProtoReader
type that works broadly like XmlReader
etc, and may help you. But all of the ambiguities described above will remain.
Upvotes: 4