• Advertisement
Sign in to follow this  

using detours 3.0 crash

This topic is 1639 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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);
}

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement