Jump to content


Photo

reading protobuf message


Best Answer Dr. McKay , 25 May 2019 - 08:18 PM

Skip the first 4 bytes, and this schema will decode it:

message SteamDatagramTicket {
	message DataWeCareAbout {
		message NamedInteger {
			optional string name = 1;
			optional fixed64 value = 5;
		}
		
		message LoneInteger {
			optional fixed64 value = 16;
		}
		
		optional fixed32 unknown1 = 1;
		optional fixed64 steamid = 2;
		optional fixed32 unknown3 = 3;
		optional fixed64 server_steamid = 4;
		optional fixed64 unknown5 = 5;
		optional int32 app_id = 7;
		repeated NamedInteger arguments = 8;
		optional fixed32 unknown9 = 9;
		optional int32 unknown10 = 10;
		optional bytes unknown11 = 11;
		optional LoneInteger steamid_again = 12;
		optional LoneInteger server_steamid_again = 13;
	}
	
	optional fixed64 unknown2 = 2;
	optional DataWeCareAbout data = 3;
	optional bytes unknown4 = 4;
}

This was produced by reverse-engineering. The field names are definitely not the same as what Valve uses.

Go to the full post


  • Please log in to reply
6 replies to this topic

#1 neverhood

neverhood

    Advanced Member

  • Member
  • PipPipPip
  • 55 posts

Posted 25 May 2019 - 09:31 AM

Hello, I'm trying to read protobuf message sent via Steam.
 
I'm trying to read this message: https://github.com/D...sages.proto#L96
 
that what I got in response:
<Buffer 82 01 90 02 11 8a 86 e2 47 d3 18 55 fd 1a c2 01 0d 4f 8b e9 5c 11 df a0 92 37 01 00 10 01 1d 00 00 00 00 21 09 04 0d 40 30 31 40 01 29 4f 75 f2 f0 85 ... 226 more bytes>
 
how can I decode this message?
 
Greetings

Edited by neverhood, 29 May 2019 - 11:42 AM.


#2 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,137 posts

Posted 25 May 2019 - 04:11 PM

What do you get if you call buffer.toString('hex')?



#3 neverhood

neverhood

    Advanced Member

  • Member
  • PipPipPip
  • 55 posts

Posted 25 May 2019 - 05:11 PM

What do you get if you call buffer.toString('hex')?

 
83039003338a86e347d33855fd3ac3030dd633ea5c33dfa09337030030033d00000000330798d8693333400339667530984393000038da05433a0a0f74765f7373635f737465636d5f6964390608ce643333400343330a086d637463685f696439bf00000036dd743e4d78756c0050035a486c757800035a069343397e0033e335a80a03d34ce306c8936b79333b3c33408f3e8646c6ee4baf85364e3f096035988d09559cdae4e3be389548cdea753c9b94c3cb4d83fa63383b630a8303dfa09337030030036a0a83030798d869333340033340333ab40497338b533ac3f33039eb0f34c53b8d64ea4ffe6096ebfe4ccd33c73808bcecb360338e95ac73a9a79599c8d93b93d3f43eaa3c896a703933aaf4440f

Edited by neverhood, 27 May 2019 - 06:07 AM.


#4 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,137 posts

Posted 25 May 2019 - 08:18 PM   Best Answer

Skip the first 4 bytes, and this schema will decode it:

message SteamDatagramTicket {
	message DataWeCareAbout {
		message NamedInteger {
			optional string name = 1;
			optional fixed64 value = 5;
		}
		
		message LoneInteger {
			optional fixed64 value = 16;
		}
		
		optional fixed32 unknown1 = 1;
		optional fixed64 steamid = 2;
		optional fixed32 unknown3 = 3;
		optional fixed64 server_steamid = 4;
		optional fixed64 unknown5 = 5;
		optional int32 app_id = 7;
		repeated NamedInteger arguments = 8;
		optional fixed32 unknown9 = 9;
		optional int32 unknown10 = 10;
		optional bytes unknown11 = 11;
		optional LoneInteger steamid_again = 12;
		optional LoneInteger server_steamid_again = 13;
	}
	
	optional fixed64 unknown2 = 2;
	optional DataWeCareAbout data = 3;
	optional bytes unknown4 = 4;
}

This was produced by reverse-engineering. The field names are definitely not the same as what Valve uses.



#5 neverhood

neverhood

    Advanced Member

  • Member
  • PipPipPip
  • 55 posts

Posted 26 May 2019 - 02:53 AM

sorry for stupid question, but I'm not really familiar with it

thats what I get in console:

{ null }

please help! (:


Edited by neverhood, 28 May 2019 - 05:29 PM.


#6 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,137 posts

Posted 26 May 2019 - 09:43 AM

Protos.SteamDatagramTicket.decode(body.slice(4)).data


#7 neverhood

neverhood

    Advanced Member

  • Member
  • PipPipPip
  • 55 posts

Posted 26 May 2019 - 10:42 AM

@Dr. McKay - I have no idea how did you do that, but thank you so much, everything works like it should






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users