aqui les dejo el code:
DLL:
Código
#include <windows.h> #include <stdio.h> BOOL APIENTRY DLLMain(HINSTANCE Inst,DWORD Razon,LPVOID Reserverd) { switch(Razon) { case DLL_PROCESS_ATTACH: break; case DLL_PROCESS_DETACH: break; case DLL_THREAD_ATTACH: break; case DLL_THREAD_DETACH: break; } return TRUE; } int _stdcall escribe() { MessageBox(0,"Hola","",0); return 0; }
Exe:
Código
typedef int * (__stdcall *Function)(); Function fn1; HINSTANCE DllEntry = LoadLibrary("\\LoadKernel.dll"); if(DllEntry != NULL) { FreeLibrary(DllEntry); MessageBox(0,"No se encuentra la DLL","Error",0); return 1; } else{ fn1 = (Function)GetProcAddress(DllEntry,"escribe"); int * ejecuta = fn1(); }
pero nada,no carga NADA!!