From c59829b7a073aae4c8b5378da13c4d65ebeb96e8 Mon Sep 17 00:00:00 2001 From: Bugisoft <58910128+BugisoftRSG@users.noreply.github.com> Date: Thu, 12 Oct 2023 19:48:27 +0200 Subject: [PATCH] Update offsets --- scripts/json.cmake | 2 - .../UGC/CopyJob.cpp | 4 +- src/main.cpp | 68 +++++++++---------- 3 files changed, 36 insertions(+), 38 deletions(-) diff --git a/scripts/json.cmake b/scripts/json.cmake index cc8aae4..652c52c 100644 --- a/scripts/json.cmake +++ b/scripts/json.cmake @@ -1,7 +1,5 @@ include(FetchContent) -set(JSON_MultipleHeaders OFF) - FetchContent_Declare( json GIT_REPOSITORY https://github.com/ArthurSonzogni/nlohmann_json_cmake_fetchcontent.git diff --git a/src/commands/prod.ros.rockstargames.com/UGC/CopyJob.cpp b/src/commands/prod.ros.rockstargames.com/UGC/CopyJob.cpp index bc557f3..6cc4839 100644 --- a/src/commands/prod.ros.rockstargames.com/UGC/CopyJob.cpp +++ b/src/commands/prod.ros.rockstargames.com/UGC/CopyJob.cpp @@ -71,7 +71,7 @@ class CopyJob : command return bytes; } - vector get_data_len(size_t data_len, bool image) // should be 107684 + vector get_data_len(size_t data_len, bool image) { stringstream ss; ss << hex << data_len; @@ -82,7 +82,7 @@ class CopyJob : command data_len_hex = "0" + data_len_hex; } - vector data_len_bytes = HexToBytes(data_len_hex); // should be \x01\xa4\xa4 + vector data_len_bytes = HexToBytes(data_len_hex); switch (data_len_bytes.size()) { case 1: diff --git a/src/main.cpp b/src/main.cpp index f677f22..a50be1e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -11,36 +11,36 @@ #include #ifdef _WIN32 - #include - #include +#include +#include #endif using namespace std; #ifdef _WIN32 - uintptr_t GetModuleBaseAddress(DWORD procId, const char* modName) +uintptr_t GetModuleBaseAddress(DWORD procId, const char* modName) +{ + uintptr_t modBaseAddr = 0; + HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE | TH32CS_SNAPMODULE32, procId); + if (hSnap != INVALID_HANDLE_VALUE) { - uintptr_t modBaseAddr = 0; - HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE | TH32CS_SNAPMODULE32, procId); - if (hSnap != INVALID_HANDLE_VALUE) + MODULEENTRY32 modEntry; + modEntry.dwSize = sizeof(modEntry); + if (Module32First(hSnap, &modEntry)) { - MODULEENTRY32 modEntry; - modEntry.dwSize = sizeof(modEntry); - if (Module32First(hSnap, &modEntry)) + do { - do + if (!strcmp(modEntry.szModule, modName)) { - if (!strcmp(modEntry.szModule, modName)) - { - modBaseAddr = (uintptr_t)modEntry.modBaseAddr; - break; - } - } while (Module32Next(hSnap, &modEntry)); - } + modBaseAddr = (uintptr_t)modEntry.modBaseAddr; + break; + } + } while (Module32Next(hSnap, &modEntry)); } - CloseHandle(hSnap); - return modBaseAddr; } + CloseHandle(hSnap); + return modBaseAddr; +} #endif AccountInfo GetAccountInfo() @@ -71,18 +71,18 @@ AccountInfo GetAccountInfo() /* * - - - - - - - - - - - - + + + + + + + + + + + + */ @@ -102,13 +102,13 @@ int main() uintptr_t base_address = GetModuleBaseAddress(pid, "GTA5.exe"); char ticket[208]{}; - ReadProcessMemory(phandle, (void*)(base_address + 0x2E7B300), &ticket, 208, 0); + ReadProcessMemory(phandle, (void*)(base_address + 0x2E7E380), &ticket, 208, 0); char session_ticket[88]{}; - ReadProcessMemory(phandle, (void*)(base_address + 0x2E7B300 + 0x200), &session_ticket, 88, 0); + ReadProcessMemory(phandle, (void*)(base_address + 0x2E7E380 + 0x200), &session_ticket, 88, 0); unsigned char session_key[16]{}; - ReadProcessMemory(phandle, (void*)(base_address + 0x2E7B300 + 0x608), &session_key, 16, 0); + ReadProcessMemory(phandle, (void*)(base_address + 0x2E7E380 + 0x608), &session_key, 16, 0); TICKET = ticket; SESSION_TICKET = string(session_ticket, 88);