Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "main.h"
- HANDLE hExecThread;
- BOOL DCALL DllMain(HINSTANCE hInstance, DWORD fwdReason, LPVOID lpvReserved)
- {
- switch (fwdReason)
- {
- case DLL_PROCESS_ATTACH:
- hExecThread = CreateThread(0, 0, &MainExecThread, 0, 0, 0);
- break;
- case DLL_THREAD_ATTACH:
- break;
- case DLL_PROCESS_DETACH:
- FreeLibraryAndExitThread(GetModuleHandle("hl2hack.dll"), 0);
- break;
- case DLL_THREAD_DETACH:
- break;
- }
- return TRUE;
- }
- DWORD DCALL MainExecThread(void *pVoid)
- {
- LPVOID spHealth = getHealthAddress();
- Msg("=======> hl2hack.dll injected! <=======\n");
- Msg("getHealthAddress() returned %x\n", spHealth);
- Msg("value at %x: %d\n", spHealth, &spHealth);
- Msg("=======================================\n");
- return 0;
- }
- LPVOID getHealthAddress()
- {
- //Add 001D7B88 to base address of client.dll
- HMODULE hHandle = GetModuleHandle("client.dll");
- return hHandle + 0x001D7B88;
- }
Add Comment
Please, Sign In to add comment