Well, trying to hook MessageBoxA more for the hell of it than anything else, and I have narrowed down the problem to my generic hook function. The problem is that instead of writing the address ot my own proc after writing the jmp, it writes the totally wrong address. Here's my code:
HookFxn proc AddrFxn:DWORD, AddrNewFxn:DWORD, AddrStoreVar:DWORD
mov ebx, AddrFxn
mov AddrStoreVar, ebx
invoke WriteMem, AddrFxn, addr JmpByte, 1
mov ebx, AddrFxn
inc ebx
invoke WriteMem, ebx, AddrFxn, 4
ret
HookFxn endp
Thanks for any suggestions.
InfamousBytes,
For hooking a Message Box, use the MessageProc API with the MSGF_DIALOGBOX for the hook code. This hook code is used when the input event occurred in a message box or dialog box.
Hope this helps,
-- Paul
Hi InfamousBytes,
Here, you can find how to hook a message box :
http://www.masm32.com/board/index.php?topic=7375.0