benilla-re systems structs docs

ClientConnection::vftable

global · net

Address
0x80a398 · 92 bytes, up to 0x80a3f3
Type
void *[23]
Meaning
Holds ClientConnection's vtable, NetClient's with the event and result slots overridden
Confidence
verified, proof one
Finding
net/dispatch#dispatch

Finding: Dispatch in net: dispatch

0x537aa0 reads the packet's 16-bit opcode, counts one in 0xc0d46c, calls the client's slot 16 with it (0x537b00, a bare return in all three vtables that hold it), and calls the registered handler with the context in ecx, the opcode in edx, and the packet's time and data store on the stack. A handler returns with ret 8. With none, it calls the data store's slot 6 and drops the packet. The opcode is not range-checked: from 0x33c to 0x677 the handler comes from the context table, and the context, like every handler above 0x677, from past both tables. A packet with no opcode bytes leaves the 16-bit read unwritten, so the opcode is the store pointer's high half.

The derivation is in the doc.