RPC

Blizzard is using a deprecated RPC implementation that comes with protobuf 2.3.

It works like this: there are services provided on both sides of the connection; packets are wrapped by the RPC headers, and there is a basic service attached when the connection starts (connection.proto, which id is 0).

The client will ask the server to attach more services using the BindRequest imported_hash and will tell the server that it attached service providers using BindRequest exported_entry (hash and id) so that the server can make requests like LoadModuleRequest to the client.

RPC Header
Main header:

uint8 service varint32 method uint16 requestid varint64 unknown varint32 datasize

If the service byte is  (constant RPC call response), the unknown field is not present:

uint8 service varint32 method uint16 requestid varint32 datasize

The rest of the packet should be at least equal to. Note that messages can be chained in a single packet.

You are so asweome for helping me solve this mystery.