PDA

View Full Version : Question FireBullets calling problem



ir0nic
10-10-2009, 04:30 PM
Hi.
Currently I try to implement an FX_FireBullet hook. The hook is done and works, the hooked function is called. But if I want to call the original function (trough pointer), it crashs. We've checked the adresses the MS Detours uses, both my friends and mine are 100% equal but on his PC it works. I can't explain why this happens.

Does anybody has an idea what causes this?

Thanks in advance,
ir0n

Michael87
10-10-2009, 04:39 PM
are you calling the trampoline?

bobbysing
10-10-2009, 04:44 PM
Attach a debugger to see why it fails

ir0nic
10-10-2009, 05:40 PM
Hi.
@ Michael: No, I'm using the DetourFunction method of MS Detours like with all my hooks.
@ bobbysing: Mhh. I'm not experienced in assembler to have any chance to see why it crashes :/

Thanks in advance,
ir0n

monster64
10-10-2009, 06:41 PM
Hi.
@ Michael: No, I'm using the DetourFunction method of MS Detours like with all my hooks.
@ bobbysing: Mhh. I'm not experienced in assembler to have any chance to see why it crashes :/

Thanks in advance,
ir0n

You still need to call the trampoline (return value of DetourFunction).

ir0nic
10-10-2009, 06:48 PM
Ah ok. I didn't know that this is called trampoline. But yes, I'm calling the return value of DetourFunction.

Thanks in advance.

EDIT: I found the mistake. Inline ASM with pushad and popad, now it works :)
Thanks anyway :)