RMC Packet Format - zeroKilo/GROBackendWV GitHub Wiki

RMC Packet Format

these packets are contained in the DATA QPackets and have a common header but different payloads.

RMCPacket header{
	ushort proto;
	bool isRequest;
	byte resultCode;
	uint errorCode;
	uint callID;
	uint methodID;
	byte[] payload;
}

Decoding / Encoding

Example: 48 00 00 00 8A 08 00 00 00 02 00 00 00 ...

  • the first 4 bytes as UINT contain the size of the remaining bytes
  • the protocol byte has multiple functions:
    • the most significant bit (0x80) defines if its a request(=1) or a response(=0), the 7 other bits make up the protocol value
    • if the protocol value is 0x7F (all bits on) then 2 additional bytes have to be read and interpreted as a 16bit protocol value

now the processing depends on the req/res flag in the protocol byte

if its a request

  • then come 4 bytes as UINT containing the call id
  • then come 4 bytes as UINT containing the method id
  • the payload has to be processed depending on the protocol and the method id

if its a response

  • next comes the resultCode byte

depending on this byte, the structure is either that of SUCCESS(=1) or FAILURE(=0)

if SUCCESS

  • then come 4 bytes as UINT containing the call id
  • then come 4 bytes as UINT containing the method id ORed with 0x8000
  • the payload has to be processed depending on the protocol and the method id

if FAILURE

  • then come 4 bytes as UINT containing the errorCode
  • then come 4 bytes as UINT containing the call id

Example Packet Exchange

10.11.2019 15:16:14 : [UDP Redirector] received : 3F 31 32 52 78 56 34 12 02 00 00 0D FF D8 28 73 9F 4C B8 E7 A2 73 B1 6A DA 3E E1 A1 90 46 3D 87 CC 36 F5 02 B5 27 96 10 8D D2 97 EA 24 57 9D 4C 7C 88 3A 0A 76 4C B9 66 09 09 38 E9 26 C9 86 73 E9 90 95 D9 B8 B1 54 56 B9 2C F7 1B 2A 85 07 6C 5D A4 50 42 E6 69 6D 
10.11.2019 15:16:14 : [UDP Redirector] received : UDPPacket {
	From         : VPort[port=15 type=OldRVSec]
	To           : VPort[port=01 type=OldRVSec]
	Flags        : [FLAG_RELIABLE][FLAG_NEED_ACK]
	Type         : DATA
	Session ID   : 0x52
	Signature    : 0x12345678
	Sequence ID  : 0x0002
	Part Number  : 0x00
	PayLoad      : 48 00 00 00 8A 08 00 00 00 02 00 00 00 03 00 77 76 00 21 00 55 62 69 41 75 74 68 65 6E 74 69 63 61 74 69 6F 6E 4C 6F 67 69 6E 43 75 73 74 6F 6D 44 61 74 61 00 13 00 00 00 0F 00 00 00 03 00 77 76 00 01 00 00 05 00 74 65 73 74 00 
	Checksum     : 0x6D
}

10.11.2019 15:16:14 : [UDP Redirector] received : UDPPacket { DATA ( R W  )}
10.11.2019 15:16:14 : [RMC] Handling packet...
10.11.2019 15:16:14 : [RMC] Received packet :
[RMC Packet : Proto = Authentication CallID=8 MethodID=2]
	[LoginCustomData Request : user=wv className=UbiAuthenticationLoginCustomData]
		[Username   : wv]
		[Online Key : ]
		[Password   : test]

10.11.2019 15:16:14 : [RMC] send ACK packet
10.11.2019 15:16:14 : [RMC] send : 31 3F 0A 52 01 00 26 7F 02 00 00 57 
10.11.2019 15:16:14 : [RMC] send : UDPPacket {
	From         : VPort[port=01 type=OldRVSec]
	To           : VPort[port=15 type=OldRVSec]
	Flags        : [FLAG_ACK]
	Type         : DATA
	Session ID   : 0x52
	Signature    : 0x7F260001
	Sequence ID  : 0x0002
	Part Number  : 0x00
	PayLoad      : 
	Checksum     : 0x57
}

10.11.2019 15:16:14 : [RMC] send : UDPPacket { DATA (  A   )}
10.11.2019 15:16:14 : [RMC] send response packet
10.11.2019 15:16:14 : [RMC] send : 31 3F 22 52 01 00 26 7F 03 00 00 0D FF D8 00 D6 3F EC 90 C0 6A 60 D9 B3 0C EA A9 E7 D7 36 B1 1F D7 63 1B 92 30 DB 7B 47 3C 05 DF 37 25 13 AB B4 57 AD 5A 5C B0 59 D6 8B 85 32 46 F1 0E C2 F9 E4 2F 82 7A 78 7D 5D 35 6F 00 E7 7E 87 24 D8 45 55 04 B7 DF 19 B2 D8 A6 CD 5B F9 7E 7B 7D E3 EA 9C 20 11 D3 4B A7 53 93 07 EB 67 A5 19 BB 43 83 41 55 75 B6 1B FB 2E 48 55 0A 57 E3 8B 0C 61 3D EF BB C4 61 7B 3D 8F 52 6D 23 A6 1E 69 82 F0 23 A2 BF AB 28 0D 3F 4C C7 B4 30 13 F1 F3 6F 80 51 22 A4 50 75 BA 82 C3 A1 7B EB 67 30 4B 03 DD 3D 69 5E 06 DB 0E F4 BC BF 96 88 6A 50 FE 0C E8 81 B5 06 41 B3 18 97 EB C8 
10.11.2019 15:16:14 : [RMC] send : UDPPacket {
	From         : VPort[port=01 type=OldRVSec]
	To           : VPort[port=15 type=OldRVSec]
	Flags        : [FLAG_NEED_ACK]
	Type         : DATA
	Session ID   : 0x52
	Signature    : 0x7F260001
	Sequence ID  : 0x0003
	Part Number  : 0x00
	PayLoad      : BA 00 00 00 0A 01 08 00 00 00 02 80 00 00 01 00 01 00 34 12 00 00 4C 00 00 00 B7 33 D6 3C E8 72 C1 1D 05 F5 CC 36 B7 F8 6F A4 F9 6D 71 42 80 F3 AE CA 87 F4 9D C6 D5 35 0F AE 81 E7 84 00 5C 9C E0 48 BF 05 61 20 4D 15 19 C7 57 D6 DE A3 0E 46 56 1B 97 CE AE 5F 25 9F 4B 96 83 AE EA 37 2A 59 68 B6 54 E4 57 7D 4A 00 70 72 75 64 70 73 3A 2F 61 64 64 72 65 73 73 3D 31 32 37 2E 30 2E 30 2E 31 3B 70 6F 72 74 3D 32 31 30 33 31 3B 43 49 44 3D 31 3B 50 49 44 3D 34 30 39 36 3B 73 69 64 3D 31 3B 73 74 72 65 61 6D 3D 33 3B 74 79 70 65 3D 32 00 00 00 00 00 00 00 00 00 01 00 00 00 
	Checksum     : 0xC8
}

10.11.2019 15:16:14 : [RMC] send : UDPPacket { DATA (   W  )}
10.11.2019 15:16:14 : [RMC] Response Data Content : 
[LoginCustomData Response]
	[Result code       : 0x00010001]
	[PID               : 0x00001234]
	[Kerberos Ticket]
		[Session Key : { 9C B0 1D 7A 2C 5A 6C 5B ED 12 68 45 69 AE 09 0D }]
		[Server PID : 0x00001000
		[Ticket Data : { 76 21 4B A6 21 96 D3 F3 9A 8C 7A 27 0D D9 B3 FA 21 0E ED AF 42 63 92 95 C1 16 54 08 EE 6E 69 17 35 78 2E 6E }]

	[RVConnectionData  : prudps:/address=127.0.0.1;port=21031;CID=1;PID=4096;sid=1;stream=3;type=2]
	[Unknown2          : 0x00000000]
	[Unknown3          : 0x0000]
	[Unknown4          : 0x0000]
	[Unknown5          : 0x0001]
	[Unknown6          : 0x0000]