Hi i have some trouble with a new project.
i want to binary intercept a WSprintf function.
as i dont want to intercept all WSprintf functions i dont directly detour it, i call my own function where WSprintf() gets called.
to make things clearer i will show you some screens:
original function:
[Only registered and activated users can see links. Click Here To Register...]
original function detoured:
(dbghelp.WSprintF_D is my function)
[Only registered and activated users can see links. Click Here To Register...]
this is my source code:
i want to have the information stored in EAX and ECX
unfortunately it crashes my game all the time :confused:
if followed in my debugger and the crashes get caused by:
caused EXCEPTION_ACCESS_VIOLATION (0xc0000005)
in module kernel32.dll at 001b:76E7C35D.
this confuses me even more ...
but as the error gets caused by my function you maybe see whats wrong.
mfg,
RunzelEier
PS: könnt natürlich auch auf deutsch antworten ;)
i want to binary intercept a WSprintf function.
as i dont want to intercept all WSprintf functions i dont directly detour it, i call my own function where WSprintf() gets called.
to make things clearer i will show you some screens:
original function:
[Only registered and activated users can see links. Click Here To Register...]
original function detoured:
(dbghelp.WSprintF_D is my function)
[Only registered and activated users can see links. Click Here To Register...]
this is my source code:
i want to have the information stored in EAX and ECX
PHP Code:
__declspec( naked ) void WSprintF_D() {
__asm{
PUSH EBP;
MOV EBP,ESP;
}
DWORD d1;
DWORD d2;
__asm{
mov d1, ECX;
mov d2, EAX;
PUSH ECX;
PUSH EAX
}
GETInfo((wchar_t*)d1,(wchar_t*)d2);
__asm{
POP EAX;
POP ECX;
MOV ESP,EBP;
POP EBP;
PUSH ECX; //Saved bytes from original function
PUSH EAX;
LEA EAX, DWORD PTR SS:[EBP-0xA74];
jmp WPrintF_back; // Jump back to original address
}
}
if followed in my debugger and the crashes get caused by:
caused EXCEPTION_ACCESS_VIOLATION (0xc0000005)
in module kernel32.dll at 001b:76E7C35D.
this confuses me even more ...
but as the error gets caused by my function you maybe see whats wrong.
mfg,
RunzelEier
PS: könnt natürlich auch auf deutsch antworten ;)