using detours 3.0 crash

Started by
1 comment, last by NLScotty 10 years, 7 months ago

I have gotten time to take alook at how detouring works,the problem is if i output parameter 2 then its crashing

FARPROC WINAPI My_GetProcAddress(HMODULE hModule,LPCSTR lpProcName)
{
sprintf(sBuffer,"%s\n",GetProcAddress); //Hooks fine
sprintf(sBuffer,"%s %s\n",GetProcAddress,lpProcName); //Crash , sBuffer is char[128] so thats enough
oStream << sBuffer;
 
return p_GetProcAddress(hModule,lpProcName);
}
:)
Advertisement

Isn't GetProcAddress a function? Why are you handling it as a null terminated string? The bigger surprise is that it's not already crashing the first time, but you're probably lucky to have a zero on the stack nearby. Output pointers as %p, not as string.

f@dzhttp://festini.device-zero.de

Is the first line, with GetProcAddress, to get the current address of the API?

This topic is closed to new replies.

Advertisement