injecting a dll to a program and running a exported function

I am trying to figure out how to inject a dll into any process and run a exported function from the injector.

For example:
1
2
3
4
5
6
*Inject Dll*
*Somehow run the function
extern "C" __declspec(dllexport) void Initialize() {
    MessageBox(0, "DLL loaded", "DLL Injection Successful!", 0);
}
from the injector itself


No idea how to do this D:

here you go:

http://www.codeproject.com/KB/threads/winspy.aspx
http://www.codeproject.com/KB/DLL/DLL_Injection_tutorial.aspx
http://msdn.microsoft.com/en-us/library/ms632589%28v=VS.85%29.aspx



There is a way from registry to insert the dll, i recommend not to use that. If something goes wrong your windows will not start.

Edit: i will post a code which can inject dll into explorer and task manager as an example.
Last edited on
@writeonsharma. I would actually appreciate that quite a bit. I would like to know, when you inject a DLL, written by you. What methods are you overwriting, do you just grab the disasm of the previous DLL?
Topic archived. No new replies allowed.