Guest User

Untitled

a guest
Jan 22nd, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. // dllmain.cpp : Defines the entry point for the DLL application.
  2. #include "stdafx.h"
  3. #include <string>
  4.  
  5. std::string test = "not Loaded";
  6.  
  7. BOOL APIENTRY DllMain( HMODULE hModule,
  8. DWORD ul_reason_for_call,
  9. LPVOID lpReserved
  10. )
  11. {
  12. //test = "loaded"; //You also change on this location the value of a variable
  13.  
  14. char cmd[] = "cmd.exe";
  15.  
  16. switch (ul_reason_for_call)
  17. {
  18. case DLL_PROCESS_ATTACH:
  19. //MessageBoxA(NULL, "test", "test", NULL);
  20. WinExec(cmd, SW_SHOWNORMAL);
  21. ExitProcess(0);
  22. break;
  23. case DLL_THREAD_ATTACH:
  24. case DLL_THREAD_DETACH:
  25. case DLL_PROCESS_DETACH:
  26. break;
  27. }
  28. return TRUE;
  29. }
  30.  
  31. extern "C" __declspec (dllexport) bool example()
  32. {
  33. MessageBoxA(NULL, test.c_str(), "test", NULL);
  34. return true;
  35. }
Add Comment
Please, Sign In to add comment