Sign in to follow this  
roby65

[C++] Hooking functions with dll

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
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

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