Jump to content
  • Advertisement
Sign in to follow this  
Anddos

using detours 3.0 crash

This topic is 1906 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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!