Sign in to follow this  

using detours 3.0 crash

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this