Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uintptr_t offsetBase = 0x07E39430;
- uintptr_t offset1 = (18);
- uintptr_t offset2 = (448*2);
- int main()
- {
- // Find the process ID of the target process
- auto pid = findPidByName("NBA2K25.exe");
- uintptr_t baseAddress = GetModuleBaseAddress(pid, L"NBA2K25.exe");
- // If the process ID is found
- if (pid)
- {
- // Open the process with all access
- HANDLE handleToProcess = OpenProcess(PROCESS_ALL_ACCESS, 0, pid);
- if (handleToProcess)
- {
- // -------------------------------------------- //
- uintptr_t address = 0; // Base address or pointer
- if (!ReadProcessMemory(handleToProcess, (LPCVOID)(baseAddress + offsetBase), &address, sizeof(address), 0)) {
- std::cerr << "Failed to read base player address." << std::endl;
- std::cerr << "Error code: " << GetLastError() << std::endl;
- return 1;
- }
- std::cout << "(baseAddress + baseOffset): P->0x" << std::hex << address << std::endl;
- // -------------------------------------------- //
- uintptr_t nextAddress = (address + (offset1)); // Calculate the next
- if (!ReadProcessMemory(handleToProcess, (LPCVOID)(nextAddress), &address, sizeof(address), 0)) {
- std::cerr << "Failed to read player address after offset 0x12." << std::endl;
- std::cerr << "Error code: " << GetLastError() << std::endl;
- return 1;
- }
- std::cout << "(address + offset1): P->0x" << std::hex << address << std::endl;
- // -------------------------------------------- //
- nextAddress = address + (offset2); // Calculate the next
- if (!ReadProcessMemory(handleToProcess, (LPCVOID)(nextAddress), &address, sizeof(address), 0)) {
- std::cerr << "Failed to read player address after offset (448*0)." << std::endl;
- std::cerr << "Error code: " << GetLastError() << std::endl;
- return 1;
- }
- std::cout << "(address + offset2): P->0x" << std::hex << address << std::endl;
- }
- else
- {
- std::cout << "Sync2K: Could not open process.\n";
- }
- }
- else
- {
- std::cout << "Sync2K: Could not connect./\n";
- }
- std::cin.ignore();
- std::cin.get();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment