0

OK so I got my executable file that should load all the functions from
"message.dll" so I can use them.

But every time I run my executable file I am getting an error that say my executable is encountered problems and its should be closed than its being closed.

Here is my executable source

#include <windows.h>
#include <stdio.h>	

int main () {
	
	/*Typedef the hello function*/
	typedef void (*pfunc)();  
	
	/*Windows handle*/
	HINSTANCE HandleDLL;
	
	/*A pointer to a function*/
	pfunc hello;
	
	/*LoadLibrary*/
	HandleDLL = LoadLibrary("message.dll");
	
	/*GetProcAddress*/
	hello = (pfunc)GetProcAddress(HandleDLL,"hello");
	
	/*Call the function*/
	hello();
	return 0;
}

And this is what the hello function suppose to do
source from the dll

__declspec(dllexport) void hello()
												   
{ 
     MessageBox (0, "Hello from injected DLL!\n", "Hi", MB_ICONINFORMATION);
}

Any ideas why my exe crashes when I run it?

1
Contributor
1
Reply
2
Views
8 Years
Discussion Span
Last Post by laconstantine
0

Listen guys i just discovered that the problem comes when I try to use the hello function from the dll.


any ideas?? please?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.