Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // dllmain.cpp : Defines the entry point for the DLL application.
- #include "pch.h"
- #include <Windows.h>
- // Your hack thread
- DWORD WINAPI HackThread(HMODULE hModule)
- {
- // Get base address of ac_client.exe
- HMODULE hMod = GetModuleHandle(NULL); // NULL gives the main exe module
- if (!hMod) {
- MessageBoxA(0, "Failed to gett module handle", "Error", MB_OK);
- return 0;
- }
- uintptr_t moduleBase = (uintptr_t)hMod;
- uintptr_t PlayerAddress = *(uintptr_t*)(moduleBase + 0x0018AC00);
- int* ammo = (int*)(PlayerAddress + 0x140);
- FreeLibraryAndExitThread(hModule, 0);
- return 0;
- }
- // DllMain entry point
- BOOL APIENTRY DllMain(HMODULE hModule,
- DWORD ul_reason_for_call,
- LPVOID lpReserved
- )
- {
- switch (ul_reason_for_call)
- {
- case DLL_PROCESS_ATTACH:
- // Spawn your hack thread when DLL is injected
- CreateThread(nullptr, 0, (LPTHREAD_START_ROUTINE)HackThread, hModule, 0, nullptr);
- break;
- case DLL_THREAD_ATTACH:
- case DLL_THREAD_DETACH:
- case DLL_PROCESS_DETACH:
- break;
- }
- return TRUE;
- }
Advertisement
Add Comment
Please, Sign In to add comment