captmicro

Untitled

Mar 27th, 2010
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. #include "main.h"
  2.  
  3. HANDLE hExecThread;
  4.  
  5. BOOL DCALL DllMain(HINSTANCE hInstance, DWORD fwdReason, LPVOID lpvReserved)
  6. {
  7. switch (fwdReason)
  8. {
  9. case DLL_PROCESS_ATTACH:
  10. hExecThread = CreateThread(0, 0, &MainExecThread, 0, 0, 0);
  11. break;
  12. case DLL_THREAD_ATTACH:
  13. break;
  14. case DLL_PROCESS_DETACH:
  15. FreeLibraryAndExitThread(GetModuleHandle("hl2hack.dll"), 0);
  16. break;
  17. case DLL_THREAD_DETACH:
  18. break;
  19. }
  20. return TRUE;
  21. }
  22.  
  23. DWORD DCALL MainExecThread(void *pVoid)
  24. {
  25. LPVOID spHealth = getHealthAddress();
  26. Msg("=======> hl2hack.dll injected! <=======\n");
  27. Msg("getHealthAddress() returned %x\n", spHealth);
  28. Msg("value at %x: %d\n", spHealth, &spHealth);
  29. Msg("=======================================\n");
  30. return 0;
  31. }
  32.  
  33. LPVOID getHealthAddress()
  34. {
  35. //Add 001D7B88 to base address of client.dll
  36. HMODULE hHandle = GetModuleHandle("client.dll");
  37. return hHandle + 0x001D7B88;
  38. }
Add Comment
Please, Sign In to add comment