Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #include <Windows.h>
- #include <iostream>
- #include "structs.h"
- #include "offsets.h"
- int main()
- {
- DWORD pid;
- HWND hWnd = FindWindowA(NULL, "Battlefield 3™");
- if (!hWnd)
- {
- printf("Error: Could not find Window\n");
- return -1;
- }
- GetWindowThreadProcessId(hWnd, &pid);
- HANDLE pHandle = OpenProcess(PROCESS_VM_READ, false, pid);
- if (!pHandle)
- {
- printf("Error: Could not open the process\n");
- return -2;
- }
- DWORD dwOut;
- DWORD fbOffset = NULL;
- DWORD clientOffset = NULL;
- DWORD playerManagerOffset = NULL;
- DWORD idToPlayerMapOffset = NULL;
- BOOL hkResult = ReadProcessMemory(pHandle, (void*)0x022B8710, &fbOffset, 4, &dwOut);
- if (!hkResult)
- printf("GetLastError: %i\n", GetLastError());
- printf("%X dwOut: %X\n", fbOffset, dwOut);
- hkResult = ReadProcessMemory(pHandle, (void*)(fbOffset + 0xB4), &clientOffset, 4, &dwOut);
- hkResult = ReadProcessMemory(pHandle, (void*)(clientOffset + 0x1C), &playerManagerOffset, 4, &dwOut);
- hkResult = ReadProcessMemory(pHandle, (void*)(playerManagerOffset + 0xC0), &idToPlayerMapOffset, 4, &dwOut);
- for (int i = 0; i < 64; i++)
- {
- DWORD mPlayer;
- hkResult = ReadProcessMemory(pHandle, (void*)(idToPlayerMapOffset + (i * 4)), &mPlayer, 4, &dwOut);
- if (mPlayer)
- {
- DWORD mSoldier_0;
- hkResult = ReadProcessMemory(pHandle, (void*)(mPlayer + 0x3C0), &mSoldier_0, 4, &dwOut);
- if (mSoldier_0)
- {
- DWORD mSoldier_1;
- hkResult = ReadProcessMemory(pHandle, (void*)(mSoldier_0), &mSoldier_1, 4, &dwOut);
- if (mSoldier_1)
- {
- fb::LinearTransform mTransform;
- hkResult = ReadProcessMemory(pHandle, (void*)(mSoldier_1 + 0x2AC), &mTransform, sizeof(fb::LinearTransform), &dwOut);
- DWORD dx = 0;
- }
- }
- printf("Legit Player Found\n");
- }
- }
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment