Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "main.h"
- // a sample exported function
- void SomeFunction(const LPCSTR sometext)
- {
- MessageBoxA(0, sometext, "DLL Message", MB_OK | MB_ICONINFORMATION);
- }
- BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
- {
- SomeFunction("Loaded by Imk0tter");
- switch (fdwReason)
- {
- case DLL_PROCESS_ATTACH:
- SomeFunction("Loaded by Imk0tter");
- // attach to process
- // return FALSE to fail DLL load
- break;
- case DLL_PROCESS_DETACH:
- // detach from process
- break;
- case DLL_THREAD_ATTACH:
- SomeFunction("Loaded by Imk0tter");
- // attach to thread
- break;
- case DLL_THREAD_DETACH:
- // detach from thread
- break;
- }
- return TRUE; // succesful
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement