Two D2GS client packet handlers switch on unsigned packet bytes: pBytes is byte *, not char *
Ghidra v1841 · 4ca0e98
Both handlers switch on a byte of the packet, and the original zero-extends it. 0x9E-0xA2: 0045d544 MOVZX EAX,byte ptr [ECX] / ADD EAX,0xffffff62 / CMP EAX,4 / JA / JMP [EAX*4+0x45d5c4], a jump table over opcodes 0x9E..0xA2. 0x77: 004b8cf0 MOVZX EAX,byte ptr [ECX+1] / CMP EAX,0x15 / JA / JMP [EAX*4+0x4b8f7c]. With char * the generator spells the 0x9E cases -0x62..-0x5e, and the recompile sign-extends (MOVSX, ADD EAX,0x62). The table entries would cast the handler as they already do for the byte * handlers 0x9C and 0x9D. Recompiled with VC8 SP1 (the 1.14d compiler) on main f26206a with byte *: both loads come out as the original's MOVZX (and ADD EAX,0xffffff62), 0045d540 rises 0.549 -> 0.588 and 004b8cf0 0.693 -> 0.700, and no function in the tree changes status. Parameter type only; name and storage (ECX) unchanged.
Changes 2, applied together
Set prototype
win 0x0045d540signaturevoid NET_D2GS_CLIENT_Incoming0x9Eto0xA2(char * pBytes)→void NET_D2GS_CLIENT_Incoming0x9Eto0xA2(byte * pBytes)convention__fastcallSet prototype
win 0x004b8cf0signaturevoid NET_D2GS_CLIENT_Incoming0x77_TRADEREQUEST(char * pBytes)→void NET_D2GS_CLIENT_Incoming0x77_TRADEREQUEST(byte * pBytes)convention__fastcall