I used your Auto-Assemble feature to produce an identical patch to one I am applying from C++, and yours works, while mine fails. ? (Crashes)
I've checked the debugger, and my patch is being applied, and looks just like yours. So I don't get it, are you catching errors or something? (The game uses SEH functions, lot's of them, could this be an issue? My hooks should be fine, I use the same code for other games without issues. It always writes my patches perfectly.)
Also, if it helps, I'm using MS Detours for some stuff, and I have this issue with it. (This method also works fine in other games.)
- Code: Select all
DWORD __stdcall Hook_Tester(DWORD value)
{
DWORD res = Real_Tester(value);
Log(value); // Prints to console.
return res;
}
That code works fine.
- Code: Select all
DWORD __stdcall Hook_Tester(DWORD value)
{
Log(value);
return Real_Tester(value);
}
This version crashes the game. (All my Detours have this issue, if I make any changes before calling the original function, it crashes the game.)
--
So is any of this ringing any bells? I can show you any code you need to see, etc,. I just didn't want to flood this post with excess info, since I don't know what's relevant. (Never had this issue before.)
I thought I was corrupting the stack\registers, etc, but I tried pushad\popad\pushfd\popfd, I checked my version against yours, etc,. I can't figure out what the problem is.
---
Edit: Also, casting functions to pointers, and invoking them crashes the game too. (This also works fine in other games.)
The only thing I can think of, is, that you are applying some sort of fix, that I'm not, or something. As far as causes, I was reading about SEH, and it appears to make a copy of the stack, and compares it against the original to look for exceptions, that's what I think is causing this.