View Single Post
Old 16.06.2006, 13:32   #6
mcrabben7
Архивный участник
 
Join Date: Apr 2006
Posts: 461
Default

This snippet can replace the previous hook and one won't need to use WriteProcessMemory at all, tbh.

Code:
//Receive Packet Function Hook
DWORD * HookReceivePacketAddr = (DWORD *)0x0050F8F5;
*HookReceivePacketAddr = (DWORD)HookReceivePacket;
*HookReceivePacketAddr -= (0x0050F8F4+5);
Thanks to Alien003 for the initial inspiration to try straight pointer arithmetic, and thanks to Bruenor for the relative vs. absolute addressing hint.

My log file managed to log this:
Code:
Got Process Handle 00000088.
Wrote L2Server.0050105D with new Server Protocol Revision [656].
Wrote L2Server.004907AA with new Server Window Name.
Wrote L2Server.0050F8F5 with ReceivePacket Hook.  New call address: ffe01877.
Entered HookReceivePacket: now calling L2Server.005509E2.
Looks like I can finally move along and try to work on the other parts.
mcrabben7 is offline