Advertisement
imk0tter

Untitled

Jul 11th, 2011
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. #include "main.h"
  2.  
  3. // a sample exported function
  4. void SomeFunction(const LPCSTR sometext)
  5. {
  6. MessageBoxA(0, sometext, "DLL Message", MB_OK | MB_ICONINFORMATION);
  7. }
  8.  
  9. BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
  10. {
  11. SomeFunction("Loaded by Imk0tter");
  12. switch (fdwReason)
  13. {
  14. case DLL_PROCESS_ATTACH:
  15. SomeFunction("Loaded by Imk0tter");
  16. // attach to process
  17. // return FALSE to fail DLL load
  18. break;
  19.  
  20. case DLL_PROCESS_DETACH:
  21. // detach from process
  22. break;
  23.  
  24. case DLL_THREAD_ATTACH:
  25. SomeFunction("Loaded by Imk0tter");
  26. // attach to thread
  27. break;
  28.  
  29. case DLL_THREAD_DETACH:
  30. // detach from thread
  31. break;
  32. }
  33. return TRUE; // succesful
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement