• Advertisement
Sign in to follow this  

[C++] Hooking functions with dll

This topic is 3349 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

Hi guys, i need to hook a dll using a dll and this is what i'm doing...but i have a little problem :-( i'm writing a dll that is between the program and the real dll, and with my dll i'm exporting all the functions of the original dll using extern "C" __declspec(naked) _declspec(dllexport) void CoverBitStreamConstructor() { _asm { jmp RealFucntionsList[0] } } (for example) the problem is that i've encountered, with IDA, a thing like: RakNetworkFactory::GetRakServerInterface(void) how to export this in my dll? i think that if i don't export this, the program won't work :( edit: also there are some functions like "fucntion@4", how to export it?

Share this post


Link to post
Share on other sites
Advertisement
That subject comes up frequently. Try searching the forums to see if your question has been answered before. Notice the "search" button above? function hook.




"function@4"

That's how PE files (i.e. .exe files) encode into their headers the names of functions using the standard calling convention and accepting 4 bytes of argument. The original function signature looked something like this:

void _stdcall function(int arg);

There's no telling from "function@4" if the function returns a value, only that it has one argument and that it cleans the stack up before it returns.

Share this post


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

  • Advertisement