HOOK hookTrigger() { __asm { push eax; //<---- Change 1, backup eax push eax; //<---- Change 2, use eax instead of [eax] call onTrigger; pop eax; pop eax; push 0x405d4c; //<---- Change 5, return address retn; } } //It may seem useless to push and pop eax twice, but its the best way to preserve it