I believe I found the problem. The function call that gets modified in the example uses a relative offset, so replacing it with an absolute address causes it to call the wrong address. If you replace
Code:
if( !WriteProcessMemory(dwHandle, (LPVOID)(0x0050F8F4+1), &HookReceivePacket, sizeof(&HookReceivePacket), &temp) )
with
Code:
if( !WriteProcessMemory(dwHandle, (LPVOID)(0x0050F8F4+1), &HookReceivePacket - (0x0050F8F4+5), sizeof(&HookReceivePacket), &temp) )
it should work.