diff --git a/.gitignore b/.gitignore index cd636ad..ce11a1d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ build/ +.cache .vs \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 48a1869..8ebed46 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,9 +33,8 @@ message(STATUS "Setting up include directories.") target_include_directories(${PROJECT_NAME} PRIVATE "${SRC_DIR}" "${imgui_SOURCE_DIR}" - "${minhook_SOURCE_DIR}/include" - "${minhook_SOURCE_DIR}/src/hde" - "${gtav_classes_SOURCE_DIR}" + "${minhook_SOURCE_DIR}/include" + "${minhook_SOURCE_DIR}/src/hde" ) message(STATUS "Setting up linked libraries") diff --git a/cmake/cross-compile.cmake b/cmake/cross-compile.cmake index 7062530..1cee051 100644 --- a/cmake/cross-compile.cmake +++ b/cmake/cross-compile.cmake @@ -8,11 +8,8 @@ if(USE_GCC OR USE_CLANG) set(TOOLCHAIN_PREFIX "x86_64-w64-mingw32" CACHE STRING "Set toolchain. Default: x86_64-w64-mingw32") message(STATUS "Using ${TOOLCHAIN_PREFIX} toolchain") set(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32) - set(CMAKE_SYSTEM_NAME "Windows") set(CMAKE_ASM_MASM_COMPILER "uasm") - set(CMAKE_C_COMPILER_TARGET x86_64-windows-gnu) - set(CMAKE_CXX_COMPILER_TARGET x86_64-windows-gnu) set(CMAKE_Fortran_COMPILER ${TOOLCHAIN_PREFIX}-gfortran) set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres) @@ -30,16 +27,20 @@ if(USE_GCC OR USE_CLANG) add_compile_options("$<$:-fpermissive;-fno-rtti${CXX_FLAGS}>") set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc) set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++) + set(CMAKE_C_COMPILER_TARGET x86_64-windows-gnu) + set(CMAKE_CXX_COMPILER_TARGET x86_64-windows-gnu) endif() if(USE_CLANG) message(STATUS "Using clang compiler.") set(CMAKE_C_COMPILER clang) set(CMAKE_CXX_COMPILER clang++) + set(CMAKE_C_COMPILER_TARGET x86_64-windows-msvc) + set(CMAKE_CXX_COMPILER_TARGET x86_64-windows-msvc) # Disable RTTI to work around libstdc++ issue https://stackoverflow.com/a/77025827 - add_compile_options("$<$:-fuse-ld=lld;-femulated-tls;-fno-rtti${CXX_FLAGS}>") - add_link_options(-fuse-ld=lld -femulated-tls -fno-rtti) + add_compile_options("$<$:-fuse-ld=lld;-fno-rtti${CXX_FLAGS}>") + add_link_options(-fuse-ld=lld -fno-rtti) endif() endif() \ No newline at end of file diff --git a/cmake/json.cmake b/cmake/json.cmake index 2e50b53..5e04abd 100644 --- a/cmake/json.cmake +++ b/cmake/json.cmake @@ -1,6 +1,6 @@ include(FetchContent) message(STATUS "Setting up nlohmann::json") -FetchContent_Declare(json GIT_REPOSITORY "https://github.com/nlohmann/json/" GIT_TAG v3.11.2 GIT_SHALLOW TRUE) +FetchContent_Declare(json GIT_REPOSITORY "https://github.com/nlohmann/json/" GIT_TAG v3.12.0 GIT_SHALLOW TRUE) option(JSON_MultipleHeaders "Disable nlohmann JSON multi header default." OFF) FetchContent_MakeAvailable(json) \ No newline at end of file diff --git a/cmake/minhook.cmake b/cmake/minhook.cmake index 905fb8d..6132595 100644 --- a/cmake/minhook.cmake +++ b/cmake/minhook.cmake @@ -6,7 +6,7 @@ message(STATUS "Setting up ${LIB_NAME}") FetchContent_Declare( ${LIB_NAME} GIT_REPOSITORY https://github.com/TsudaKageyu/minhook.git - GIT_TAG 98b74f1fc12d00313d91f10450e5b3e0036175e3 + GIT_TAG 2b003bb063d66f016cc1aef7d63951350ce60f35 GIT_PROGRESS TRUE ) FetchContent_MakeAvailable(${LIB_NAME}) \ No newline at end of file diff --git a/src/core/frontend/widgets/imgui_bitfield.hpp b/src/core/frontend/widgets/imgui_bitfield.hpp index ce5ef3b..0d2b4c8 100644 --- a/src/core/frontend/widgets/imgui_bitfield.hpp +++ b/src/core/frontend/widgets/imgui_bitfield.hpp @@ -60,7 +60,7 @@ namespace ImGui } if (i % 4 == 0) { - ImGui::Text("%i", i); + ImGui::Text("%zu", i); ImGui::EndGroup(); } if (i % 16 != 0) diff --git a/src/core/hooking/CallHook.hpp b/src/core/hooking/CallHook.hpp index e7c6a32..496546b 100644 --- a/src/core/hooking/CallHook.hpp +++ b/src/core/hooking/CallHook.hpp @@ -57,7 +57,7 @@ namespace YimMenu template T GetOriginal() { - return static_cast(m_OriginalFunction); + return reinterpret_cast(m_OriginalFunction); } }; diff --git a/src/game/features/self/FormatMoney.cpp b/src/game/features/self/FormatMoney.cpp index f816be4..95d989c 100644 --- a/src/game/features/self/FormatMoney.cpp +++ b/src/game/features/self/FormatMoney.cpp @@ -19,12 +19,12 @@ namespace YimMenu::Features { if (!formatIntCaller1Hook) { - formatIntCaller1Hook = CallSiteHook::AddHook(Pointers.FormatIntCaller1, FormatIntHook); + formatIntCaller1Hook = CallSiteHook::AddHook(Pointers.FormatIntCaller1, reinterpret_cast(FormatIntHook)); } formatIntCaller1Hook->Enable(); if (!formatIntCaller2Hook) { - formatIntCaller2Hook = CallSiteHook::AddHook(Pointers.FormatIntCaller2, FormatIntHook); + formatIntCaller2Hook = CallSiteHook::AddHook(Pointers.FormatIntCaller2, reinterpret_cast(FormatIntHook)); } formatIntCaller2Hook->Enable(); NativeHooks::AddHook("shop_controller"_J, NativeIndex::SCALEFORM_MOVIE_METHOD_ADD_PARAM_INT, &ScaleformAddIntHook); diff --git a/src/game/frontend/submenus/Debug/Scripts.cpp b/src/game/frontend/submenus/Debug/Scripts.cpp index 933978a..a1db216 100644 --- a/src/game/frontend/submenus/Debug/Scripts.cpp +++ b/src/game/frontend/submenus/Debug/Scripts.cpp @@ -85,8 +85,8 @@ namespace YimMenu::Submenus ImGui::Text("Thread ID: %d", curThread->m_Context.m_ThreadId); ImGui::Text("Stack Size: %d", curThread->m_Context.m_StackSize); - ImGui::Text("Stack Pointer: 0x%X", &curThread->m_Context.m_StackPointer); - ImGui::Text("Program Counter: 0x%X", &curThread->m_Context.m_ProgramCounter); // This is not really accurate (always points to the WAIT) + ImGui::Text("Stack Pointer: 0x%X", curThread->m_Context.m_StackPointer); + ImGui::Text("Program Counter: 0x%X", curThread->m_Context.m_ProgramCounter); // This is not really accurate (always points to the WAIT) if (curThread->m_Context.m_State == rage::scrThread::State::KILLED) ImGui::Text("Exit Reason: %s", curThread->m_ErrorMessage); })); diff --git a/src/game/frontend/submenus/Network.cpp b/src/game/frontend/submenus/Network.cpp index 0e3d22b..f8d8623 100644 --- a/src/game/frontend/submenus/Network.cpp +++ b/src/game/frontend/submenus/Network.cpp @@ -4,7 +4,7 @@ #include "game/frontend/items/Items.hpp" #include "game/frontend/submenus/Network/SavedPlayers.hpp" #include "game/gta/Network.hpp" -#include "game/frontend/submenus/Network/RandomEvents.hpp" +#include "game/frontend/submenus/network/RandomEvents.hpp" namespace YimMenu::Submenus { diff --git a/src/game/gta/Ped.cpp b/src/game/gta/Ped.cpp index ab4bc9f..062617e 100644 --- a/src/game/gta/Ped.cpp +++ b/src/game/gta/Ped.cpp @@ -159,7 +159,7 @@ namespace YimMenu ENTITY_ASSERT_VALID(); ENTITY_ASSERT_CONTROL(); - WEAPON::SET_PED_INFINITE_AMMO(GetHandle(), infinite, NULL); + WEAPON::SET_PED_INFINITE_AMMO(GetHandle(), infinite, 0); } void Ped::SetInfiniteClip(bool infinite) diff --git a/src/game/gta/ScriptLocal.hpp b/src/game/gta/ScriptLocal.hpp index 470b864..64a276d 100644 --- a/src/game/gta/ScriptLocal.hpp +++ b/src/game/gta/ScriptLocal.hpp @@ -3,7 +3,7 @@ #include #include #include -#include +#include namespace YimMenu { diff --git a/src/game/gta/data/ScriptNames.hpp b/src/game/gta/data/ScriptNames.hpp index b663985..6dbdb2e 100644 --- a/src/game/gta/data/ScriptNames.hpp +++ b/src/game/gta/data/ScriptNames.hpp @@ -2,7 +2,7 @@ namespace YimMenu { - static constexpr std::array scriptNames = { + static constexpr const char* scriptNames[] = { "abigail1", "abigail2", "achievement_controller", diff --git a/src/game/hooks/Anticheat/QueueDependency.cpp b/src/game/hooks/Anticheat/QueueDependency.cpp index 84bca13..ec00cee 100644 --- a/src/game/hooks/Anticheat/QueueDependency.cpp +++ b/src/game/hooks/Anticheat/QueueDependency.cpp @@ -54,7 +54,6 @@ namespace YimMenu::Hooks if (arx_score >= 2) { - auto from_offset = *reinterpret_cast(_AddressOfReturnAddress()) - ModuleMgr.Get("GTA5_Enhanced.exe"_J)->Base(); return; } diff --git a/src/types/network/netEvent.hpp b/src/types/network/netEvent.hpp index ed5647e..2fd5832 100644 --- a/src/types/network/netEvent.hpp +++ b/src/types/network/netEvent.hpp @@ -28,6 +28,7 @@ namespace rage std::uint32_t m_CxnId; // 0x0044 rage::netEvent* m_This; // 0x0048 uint32_t m_PeerId; // 0x0050 + char pad_0084[4]; // 0x0054 }; static_assert(sizeof(rage::netEvent) == 0x58); diff --git a/src/types/network/netGameEvent.hpp b/src/types/network/netGameEvent.hpp index 7241d33..14c860d 100644 --- a/src/types/network/netGameEvent.hpp +++ b/src/types/network/netGameEvent.hpp @@ -248,8 +248,10 @@ class CExplosionEvent : public rage::netGameEvent public: void Deserialize(rage::datBitBuffer& buffer); +#if !__GNUC__ struct { +#endif ExplosionType m_ExplosionType; // 0x30 rage::fvector3 m_Position; // 0x40 uint64_t m_0x50; // 0x50 @@ -282,7 +284,9 @@ public: bool m_Expected; // 0xC2 -- for telemetry uint32_t m_ScriptHash; // 0xC4 -- for telemetry uint32_t m_ProgramCounter; // 0xC8 -- for telemetry +#if !__GNUC__ }; +#endif uint16_t m_TargetEntity; // 0xD0 uint16_t m_TargetEnt2; // 0xD2 uint16_t m_OwnerNetId; // 0xD4 diff --git a/src/types/rage/RTTI.hpp b/src/types/rage/RTTI.hpp index bdff937..06b292e 100644 --- a/src/types/rage/RTTI.hpp +++ b/src/types/rage/RTTI.hpp @@ -10,4 +10,4 @@ private: \ virtual bool _0x28(void**) = 0; \ virtual void destructor() = 0; \ \ -public: \ No newline at end of file +public: diff --git a/src/types/rage/datBitBuffer.hpp b/src/types/rage/datBitBuffer.hpp index 85f6aa6..ff5eea3 100644 --- a/src/types/rage/datBitBuffer.hpp +++ b/src/types/rage/datBitBuffer.hpp @@ -42,7 +42,7 @@ namespace rage v11 = 8; if (size > 8) { - v12 = 1i64; + v12 = 1; do { if (v12 > v9)