├── Source ├── Features │ ├── Car │ │ ├── Car.h │ │ └── Car.cpp │ ├── Gun │ │ ├── Gun.h │ │ └── Gun.cpp │ ├── Misc │ │ ├── Misc.h │ │ └── Misc.cpp │ ├── Other │ │ ├── Other.h │ │ └── Other.cpp │ ├── Local │ │ ├── Local.h │ │ └── Local.cpp │ ├── Online │ │ ├── Online.cpp │ │ └── Online.h │ ├── MenuFunctions.h │ └── MenuFunctions.cpp ├── MinHook │ ├── lib │ │ └── libMinHook-x64-v141-md.lib │ └── include │ │ └── MinHook.h ├── SudoMod.vcxproj.user ├── stdafx.cpp ├── Script.h ├── targetver.h ├── spoof.asm ├── CrossMapping.h ├── InputHook.h ├── globalHandle.h ├── NativeInvoker.cpp ├── Logger.h ├── types.h ├── stdafx.h ├── dllmain.cpp ├── InputHook.cpp ├── UserInterface.h ├── keyboard.h ├── NativeInvoker.h ├── keyboard.cpp ├── Script.cpp ├── SudoMod.vcxproj.filters ├── Hooking.h ├── Memory.cpp ├── Memory.h ├── SudoMod.vcxproj ├── nativeCaller.h ├── Hooking.cpp ├── UserInterface.cpp └── enums.h ├── README.md └── SudoMod.sln /Source/Features/Car/Car.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Car 4 | { 5 | void UpdateLoop(); 6 | } -------------------------------------------------------------------------------- /Source/Features/Gun/Gun.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Gun 4 | { 5 | void UpdateLoop(); 6 | } -------------------------------------------------------------------------------- /Source/Features/Misc/Misc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Misc 4 | { 5 | void UpdateLoop(); 6 | } -------------------------------------------------------------------------------- /Source/Features/Other/Other.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Other 4 | { 5 | void UpdateLoop(); 6 | } -------------------------------------------------------------------------------- /Source/Features/Car/Car.cpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../../stdafx.h" 3 | 4 | void Car::UpdateLoop() 5 | { 6 | 7 | } -------------------------------------------------------------------------------- /Source/Features/Gun/Gun.cpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../../stdafx.h" 3 | 4 | void Gun::UpdateLoop() 5 | { 6 | 7 | } -------------------------------------------------------------------------------- /Source/Features/Misc/Misc.cpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../../stdafx.h" 3 | 4 | void Misc::UpdateLoop() 5 | { 6 | 7 | } -------------------------------------------------------------------------------- /Source/Features/Other/Other.cpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../../stdafx.h" 3 | 4 | void Other::UpdateLoop() 5 | { 6 | 7 | } -------------------------------------------------------------------------------- /Source/MinHook/lib/libMinHook-x64-v141-md.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jannemangekkecoder/SudoMod/HEAD/Source/MinHook/lib/libMinHook-x64-v141-md.lib -------------------------------------------------------------------------------- /Source/Features/Local/Local.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Local 4 | { 5 | void UpdateLoop(); 6 | 7 | extern bool god; 8 | void God(bool enable); 9 | } -------------------------------------------------------------------------------- /Source/SudoMod.vcxproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Source/Features/Local/Local.cpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../../stdafx.h" 3 | 4 | void Local::UpdateLoop() 5 | { 6 | God(god); 7 | } 8 | 9 | bool Local::god = false; 10 | void Local::God(bool enable) 11 | { 12 | Memory::set_value({ 0x08, 0x189 }, enable); 13 | } -------------------------------------------------------------------------------- /Source/Features/Online/Online.cpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../../stdafx.h" 3 | 4 | void Online::UpdateLoop() 5 | { 6 | 7 | } 8 | 9 | /* Protections */ 10 | bool Online::event_logger = true; 11 | bool Online::event_blocker = true; 12 | bool Online::event_karma = true; -------------------------------------------------------------------------------- /Source/Features/Online/Online.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Online 4 | { 5 | void UpdateLoop(); 6 | 7 | /* Protections */ 8 | extern bool event_logger; 9 | extern bool event_blocker; 10 | extern bool event_karma; 11 | 12 | inline std::uint32_t g_SelectedPlayer{}; 13 | } -------------------------------------------------------------------------------- /Source/Features/MenuFunctions.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace MenuFunctions 4 | { 5 | /* MenuFunctions -> Here you define stuff like Vectors so you don't have to do it in each individual Feature file, stuff in here can be globally used around the source */ 6 | void SpawnVehicle(const char* carname); 7 | } -------------------------------------------------------------------------------- /Source/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // Win32Project1.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /Source/Script.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void ScriptMain(); 4 | 5 | enum SubMenus { //Add Sub Menus in here 6 | NOMENU, 7 | MAINMENU, 8 | TEST, 9 | PROTECTIONS, 10 | PLAYERLIST, 11 | PLAYERLIST_SELECTED 12 | }; 13 | 14 | inline char* StringToChar(std::string string) // Handy little thing 15 | { 16 | return _strdup(string.c_str()); 17 | } -------------------------------------------------------------------------------- /Source/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /Source/spoof.asm: -------------------------------------------------------------------------------- 1 | .DATA 2 | return_address dq 0 3 | real_rbx dq 0 4 | 5 | .CODE 6 | _call_asm PROC 7 | mov real_rbx, rbx 8 | mov r9, [rsp] 9 | mov return_address, r9 10 | lea rbx, _ret_asm 11 | mov [rsp], r8 12 | jmp rdx 13 | _call_asm ENDP 14 | 15 | _ret_asm PROC 16 | mov rbx, real_rbx 17 | mov rcx, return_address 18 | jmp rcx 19 | _ret_asm ENDP 20 | 21 | END -------------------------------------------------------------------------------- /Source/CrossMapping.h: -------------------------------------------------------------------------------- 1 | #ifndef __CROSS_MAPPING_H__ 2 | #define __CROSS_MAPPING_H__ 3 | 4 | #pragma once 5 | 6 | typedef std::unordered_map nMap; 7 | static std::vector nativeFailedVec; 8 | 9 | struct CrossMappingEntry 10 | { 11 | uint64_t first; 12 | uint64_t second; 13 | }; 14 | 15 | class CrossMapping 16 | { 17 | public: 18 | static void initNativeMap(); 19 | static uint64_t MapNative(uint64_t inNative); 20 | static void dumpNativeMappingCache(); 21 | static bool searchMap(nMap map, uint64_t inNative, uint64_t *outNative); 22 | }; 23 | 24 | #endif // __CROSS_MAPPING_H__ 25 | 26 | 27 | -------------------------------------------------------------------------------- /Source/InputHook.h: -------------------------------------------------------------------------------- 1 | #ifndef __INPUT_HOOK_H__ 2 | #define __INPUT_HOOK_H__ 3 | 4 | #pragma once 5 | 6 | class InputHook 7 | { 8 | public: 9 | bool Initialize(); 10 | void Remove(); 11 | typedef void(*TKeyboardFn)(DWORD key, WORD repeats, BYTE scanCode, BOOL isExtended, BOOL isWithAlt, BOOL wasDownBefore, BOOL isUpNow); 12 | void keyboardHandlerRegister(TKeyboardFn function); 13 | void keyboardHandlerUnregister(TKeyboardFn function); 14 | HWND getWindow() { return hWindow; } 15 | protected: 16 | HWND hWindow; 17 | }; extern InputHook iHook; 18 | 19 | static LRESULT APIENTRY WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 20 | 21 | #endif // __INPUT_HOOK_H__ -------------------------------------------------------------------------------- /Source/globalHandle.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | 4 | class globalHandle 5 | { 6 | private: 7 | void* _handle; 8 | 9 | public: 10 | globalHandle(int index) 11 | : _handle(&hooks.m_global_pointer[index >> 18 & 0x3F][index & 0x3FFFF]) 12 | { } 13 | 14 | globalHandle(void* p) 15 | : _handle(p) 16 | { } 17 | 18 | globalHandle(const globalHandle& copy) 19 | : _handle(copy._handle) 20 | { } 21 | 22 | globalHandle At(int index) 23 | { 24 | return globalHandle(reinterpret_cast(this->_handle) + (index)); 25 | } 26 | 27 | globalHandle At(int index, int size) 28 | { 29 | // Position 0 = Array Size 30 | return this->At(1 + (index * size)); 31 | } 32 | 33 | template 34 | T* Get() 35 | { 36 | return reinterpret_cast(this->_handle); 37 | } 38 | 39 | template 40 | T& As() 41 | { 42 | return *this->Get(); 43 | } 44 | }; -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Fully undetected and safe SudoMod for educational purposes ofcourse. 2 | 3 | Picture: https://i.imgur.com/vSyEjzo.png 4 | 5 | What's changed ? 6 | Updated Natives 7 | Updated CrossMapping 8 | Added Native Spoofer (sub1to) 9 | Added new Logger system (hidinghax aka Aki) 10 | Added new Main Hook (GNOE) 11 | Added Custom Text 12 | Added Get Event Data 13 | Added Log all Events 14 | Added Event Blocker 15 | Added Karma 16 | Reworked Feature System 17 | Reworked GUI Completely 18 | Added Custom YTD Loader 19 | Added Trigger Script Event Example 20 | Added "New" Model Spawn Bypass + Example Usage 21 | Completely Reworked Hooking to only use one pattern scanner 22 | Made it Unloadable and Reinjectable 23 | Updated all Patterns 24 | 25 | Credits: 26 | sub1to (Native Spoofer and some pattern scan assets) 27 | Mike Rohsoft (defuseEvent) 28 | Hidinghax a.k.a Aki (Print Func) 29 | Pocakking (GED HK) 30 | spanker (mp spawn bypass) 31 | 32 | Think that's all ? 33 | -------------------------------------------------------------------------------- /SudoMod.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 12.00 2 | # Visual Studio 14 3 | VisualStudioVersion = 14.0.25420.1 4 | MinimumVisualStudioVersion = 10.0.40219.1 5 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SudoMod", "Source\SudoMod.vcxproj", "{618A4253-6C78-433C-93B5-8C71F873FAD3}" 6 | EndProject 7 | Global 8 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 9 | Debug|x64 = Debug|x64 10 | Release|x64 = Release|x64 11 | EndGlobalSection 12 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 13 | {618A4253-6C78-433C-93B5-8C71F873FAD3}.Debug|x64.ActiveCfg = Debug|x64 14 | {618A4253-6C78-433C-93B5-8C71F873FAD3}.Debug|x64.Build.0 = Debug|x64 15 | {618A4253-6C78-433C-93B5-8C71F873FAD3}.Release|x64.ActiveCfg = Release|x64 16 | {618A4253-6C78-433C-93B5-8C71F873FAD3}.Release|x64.Build.0 = Release|x64 17 | EndGlobalSection 18 | GlobalSection(SolutionProperties) = preSolution 19 | HideSolutionNode = FALSE 20 | EndGlobalSection 21 | EndGlobal 22 | -------------------------------------------------------------------------------- /Source/NativeInvoker.cpp: -------------------------------------------------------------------------------- 1 | //NativeInvoker.cpp 2 | #include "stdafx.h" 3 | 4 | static NativeManagerContext g_context; 5 | 6 | static UINT64 g_hash; 7 | 8 | void(*scrNativeCallContext::SetVectorResults)(scrNativeCallContext*) = nullptr; 9 | 10 | extern "C" void _call_asm(void* context, void* function, void* ret); 11 | 12 | void nativeInit(UINT64 hash) { 13 | 14 | g_context.Reset(); 15 | g_hash = hash; 16 | } 17 | 18 | void nativePush64(UINT64 value) { 19 | 20 | g_context.Push(value); 21 | } 22 | 23 | uint64_t* nativeCall() { 24 | 25 | auto handler = Hooking::GetNativeHandler(g_hash); 26 | 27 | if (handler != nullptr) { 28 | 29 | static void* exceptionadd; 30 | 31 | __try 32 | { 33 | _call_asm(&g_context, handler, Hooking::m_native_return); // Native Spoof 34 | scrNativeCallContext::SetVectorResults(&g_context); // "Fix" Vectors 35 | } 36 | __except (exceptionadd = (GetExceptionInformation())->ExceptionRecord->ExceptionAddress, EXCEPTION_EXECUTE_HANDLER) 37 | { 38 | Log_Error("Error Executing Native 0x%016llx At Address %p.", g_hash, exceptionadd); 39 | } 40 | } 41 | 42 | return reinterpret_cast(g_context.GetResultPointer()); 43 | } 44 | 45 | -------------------------------------------------------------------------------- /Source/Features/MenuFunctions.cpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../../stdafx.h" 3 | 4 | namespace MenuFunctions 5 | { 6 | void SpawnVehicle(const char* carname) 7 | { 8 | Hash hash = MISC::GET_HASH_KEY(carname); 9 | 10 | STREAMING::REQUEST_MODEL(hash); 11 | while (!STREAMING::HAS_MODEL_LOADED(hash)) WAIT(0); 12 | 13 | auto pos = ENTITY::GET_ENTITY_COORDS(PLAYER::PLAYER_PED_ID(), true); 14 | *(unsigned short*)hooks.m_model_spawn_bypass = 0x9090; 15 | Vehicle vehicle = VEHICLE::CREATE_VEHICLE(hash, pos.x, pos.y, pos.z, 0.f, TRUE, FALSE, FALSE); 16 | *(unsigned short*)hooks.m_model_spawn_bypass = 0x0574; 17 | 18 | STREAMING::SET_MODEL_AS_NO_LONGER_NEEDED(hash); 19 | if (NETWORK::NETWORK_IS_SESSION_STARTED()) 20 | { 21 | DECORATOR::DECOR_SET_INT(vehicle, "MPBitset", 0); 22 | ENTITY::_SET_ENTITY_SOMETHING(vehicle, TRUE); // True means it can be deleted by the engine when switching lobbies etc, false means the script is expected to clean it up. 23 | auto networkId = NETWORK::VEH_TO_NET(vehicle); 24 | if (NETWORK::NETWORK_GET_ENTITY_IS_NETWORKED(vehicle)) { NETWORK::SET_NETWORK_ID_EXISTS_ON_ALL_MACHINES(networkId, true); } 25 | VEHICLE::SET_VEHICLE_IS_STOLEN(vehicle, FALSE); 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /Source/Logger.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | /* Logger 4 | * Info = Blue 5 | * Debug = Green 6 | * Error = Red + Close GTA 7 | */ 8 | inline void Log_Info(const char* msg, ...) { 9 | SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE); 10 | char buffer[4096]{}; 11 | va_list args{}; 12 | 13 | va_start(args, msg); 14 | _vsnprintf(buffer, sizeof(buffer), msg, args) + 1; 15 | printf(buffer); 16 | printf("\n"); 17 | va_end(args); 18 | } 19 | 20 | inline void Log_Error(const char* msg, ...) { 21 | SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_RED); 22 | char buffer[4096]{}; 23 | va_list args{}; 24 | 25 | va_start(args, msg); 26 | _vsnprintf(buffer, sizeof(buffer), msg, args) + 1; 27 | printf(buffer); 28 | printf("\n"); 29 | va_end(args); 30 | 31 | WAIT(250); 32 | exit(0); 33 | } 34 | 35 | inline void Log_Debug(const char* msg, ...) { 36 | SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_GREEN); 37 | char buffer[4096]{}; 38 | va_list args{}; 39 | 40 | va_start(args, msg); 41 | _vsnprintf(buffer, sizeof(buffer), msg, args) + 1; 42 | printf(buffer); 43 | printf("\n"); 44 | va_end(args); 45 | } -------------------------------------------------------------------------------- /Source/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | using Void = std::uint32_t; 4 | using Any = std::uint32_t; 5 | using Hash = std::uint32_t; 6 | using Entity = std::int32_t; 7 | using Player = std::int32_t; 8 | using FireId = std::int32_t; 9 | using Ped = Entity; 10 | using Vehicle = Entity; 11 | using Cam = std::int32_t; 12 | using CarGenerator = std::int32_t; 13 | using Group = std::int32_t; 14 | using Train = std::int32_t; 15 | using Object = Entity; 16 | using Pickup = Object; 17 | using Weapon = std::int32_t; 18 | using Interior = std::int32_t; 19 | using Blip = std::int32_t; 20 | using Texture = std::int32_t; 21 | using TextureDict = std::int32_t; 22 | using CoverPoint = std::int32_t; 23 | using Camera = std::int32_t; 24 | using TaskSequence = std::int32_t; 25 | using ColourIndex = std::int32_t; 26 | using Sphere = std::int32_t; 27 | using ScrHandle = std::int32_t; 28 | 29 | #pragma pack(push, 1) 30 | typedef struct 31 | { 32 | float x; 33 | DWORD _paddingx; 34 | float y; 35 | DWORD _paddingy; 36 | float z; 37 | DWORD _paddingz; 38 | } Vector3; 39 | #pragma pack(pop) 40 | 41 | #pragma pack(push, 1) 42 | typedef struct 43 | { 44 | float x; 45 | float y; 46 | float z; 47 | } Vector3_t; 48 | #pragma pack(pop) 49 | 50 | #pragma pack(push, 1) 51 | typedef struct VECTOR2 52 | { 53 | float x, y; 54 | }; 55 | #pragma pack(pop) 56 | 57 | #pragma pack(push, 1) 58 | typedef struct VECTOR2_2 59 | { 60 | float w, h; 61 | }; 62 | #pragma pack(pop) 63 | 64 | #pragma pack(push, 1) 65 | typedef struct RGBAF 66 | { 67 | int r, g, b, a, f; 68 | }; 69 | #pragma pack(pop) 70 | 71 | #pragma pack(push, 1) 72 | typedef struct RGBA 73 | { 74 | int r, g, b, a; 75 | }; 76 | #pragma pack(pop) 77 | 78 | #pragma pack(push, 1) 79 | typedef struct RGB 80 | { 81 | int r, g, b; 82 | }; 83 | #pragma pack(pop) -------------------------------------------------------------------------------- /Source/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 11 | 12 | // Windows Library Files: 13 | #pragma comment(lib, "ws2_32.lib") 14 | #pragma comment(lib, "Winmm.lib") 15 | 16 | // Windows Header Files: 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | 37 | // Additional Header Files: 38 | #include "Memory.h" 39 | #include "types.h" 40 | #include "InputHook.h" 41 | #include "keyboard.h" 42 | #include "CrossMapping.h" 43 | #include "NativeInvoker.h" 44 | #include "nativeCaller.h" 45 | #include "natives.h" 46 | #include "Hooking.h" 47 | #include "Logger.h" 48 | #include "enums.h" 49 | #include "globalHandle.h" 50 | 51 | // Menu Files: 52 | #include "UserInterface.h" 53 | #include "Script.h" 54 | #include "types.h" 55 | 56 | #include 57 | #include 58 | #include 59 | 60 | /* Features */ 61 | #include "Features/Local/Local.h" 62 | #include "Features/Car/Car.h" 63 | #include "Features/Gun/Gun.h" 64 | #include "Features/Misc/Misc.h" 65 | #include "Features/Other/Other.h" 66 | #include "Features/Online/Online.h" 67 | #include "Features/MenuFunctions.h" 68 | 69 | extern std::atomic_bool g_running; -------------------------------------------------------------------------------- /Source/dllmain.cpp: -------------------------------------------------------------------------------- 1 | // dllmain.cpp : Defines the entry point for the DLL application. 2 | #include "stdafx.h" 3 | 4 | std::atomic_bool g_running = true; 5 | 6 | DWORD WINAPI ControlThread(LPVOID lpParam) 7 | { 8 | if (AllocConsole()) { 9 | freopen_s(reinterpret_cast(stdout), "CONOUT$", "w", stdout); 10 | SetConsoleTitleW(L"SudoMod"); 11 | SetConsoleCP(CP_UTF8); 12 | SetConsoleOutputCP(CP_UTF8); 13 | } 14 | Log_Info(R"( 15 | _____ _ __ __ _ 16 | / ____| | | | \/ | | | 17 | | (___ _ _ __| | ___ | \ / | ___ __| | 18 | \___ \| | | |/ _` |/ _ \| |\/| |/ _ \ / _` | 19 | ____) | |_| | (_| | (_) | | | | (_) | (_| | 20 | |_____/ \__,_|\__,_|\___/|_| |_|\___/ \__,_| 21 | 22 | )"); 23 | Log_Info("[Boot] Starting SudoMod"); 24 | Hooking::Start((HMODULE)lpParam); 25 | 26 | while (g_running) 27 | { 28 | std::this_thread::sleep_for(std::chrono::milliseconds(10)); 29 | std::this_thread::yield(); 30 | if (GetAsyncKeyState(VK_END)) { g_running = false; } 31 | 32 | if (Menu::gui.textureID != 0 && !Menu::gui.reggedytd) // Cringe code, please no look 33 | { 34 | std::string ytd = std::string("YTD File Registered, Texture ID: ") + std::to_string(Menu::gui.textureID).c_str(); 35 | Log_Info(_strdup(ytd.c_str())); 36 | Menu::gui.reggedytd = true; 37 | } 38 | } 39 | 40 | Hooking::Cleanup(); 41 | } 42 | 43 | BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) 44 | { 45 | switch (ul_reason_for_call) 46 | { 47 | case DLL_PROCESS_ATTACH: 48 | CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)ControlThread, hModule, NULL, NULL); 49 | break; 50 | case DLL_THREAD_ATTACH: 51 | break; 52 | case DLL_THREAD_DETACH: 53 | break; 54 | case DLL_PROCESS_DETACH: 55 | break; 56 | } 57 | return TRUE; 58 | } -------------------------------------------------------------------------------- /Source/InputHook.cpp: -------------------------------------------------------------------------------- 1 | //InputHook.cpp 2 | #include "stdafx.h" 3 | 4 | #define GXLPARAM(lp) ((short)LOWORD(lp)) 5 | #define GYLPARAM(lp) ((short)HIWORD(lp)) 6 | 7 | InputHook iHook; 8 | WNDPROC oWndProc; 9 | 10 | //using namespace Utility; 11 | 12 | static std::set g_keyboardFunctions; 13 | 14 | void InputHook::keyboardHandlerRegister(TKeyboardFn function) { 15 | 16 | g_keyboardFunctions.insert(function); 17 | } 18 | 19 | void InputHook::keyboardHandlerUnregister(TKeyboardFn function) { 20 | 21 | g_keyboardFunctions.erase(function); 22 | } 23 | 24 | bool InputHook::Initialize() { 25 | 26 | hWindow = NULL; 27 | while (hWindow == NULL) { 28 | 29 | hWindow = FindWindow(L"grcWindow", NULL); 30 | Sleep(100); 31 | } 32 | oWndProc = (WNDPROC)SetWindowLongPtr(hWindow, GWLP_WNDPROC, (__int3264)(LONG_PTR)WndProc); 33 | if (oWndProc == NULL) { 34 | 35 | Log_Error("[IPHK] Failed to attach input hook"); 36 | return false; 37 | } 38 | else { 39 | 40 | keyboardHandlerRegister(OnKeyboardMessage); 41 | Log_Debug("[Debug] Input hook attached: WndProc 0x%p", (DWORD_PTR)oWndProc); 42 | return true; 43 | } 44 | } 45 | 46 | void InputHook::Remove() { 47 | 48 | SetWindowLongPtr(hWindow, GWLP_WNDPROC, (LONG_PTR)oWndProc); 49 | Log_Debug("[Debug] Removed input hook"); 50 | } 51 | 52 | LRESULT APIENTRY WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) 53 | { 54 | switch (uMsg) 55 | { 56 | case WM_SIZE: 57 | break; 58 | case WM_LBUTTONDOWN: 59 | break; 60 | case WM_LBUTTONUP: 61 | break; 62 | case WM_RBUTTONDOWN: 63 | break; 64 | case WM_RBUTTONUP: 65 | break; 66 | case WM_MBUTTONDOWN: 67 | break; 68 | case WM_MBUTTONUP: 69 | break; 70 | case WM_MOUSEWHEEL: 71 | break; 72 | case WM_MOUSEMOVE: 73 | break; 74 | case WM_KEYDOWN: case WM_KEYUP: case WM_SYSKEYDOWN: case WM_SYSKEYUP: 75 | { 76 | auto functions = g_keyboardFunctions; for (auto & function : functions) function((DWORD)wParam, lParam & 0xFFFF, (lParam >> 16) & 0xFF, (lParam >> 24) & 1, (uMsg == WM_SYSKEYDOWN || uMsg == WM_SYSKEYUP), (lParam >> 30) & 1, (uMsg == WM_SYSKEYUP || uMsg == WM_KEYUP)); 77 | } 78 | break; 79 | case WM_CHAR: 80 | break; 81 | } 82 | 83 | return CallWindowProc(oWndProc, hwnd, uMsg, wParam, lParam); 84 | 85 | } 86 | -------------------------------------------------------------------------------- /Source/UserInterface.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | extern enum SubMenus; 3 | 4 | namespace Menu 5 | { 6 | class UserInterface 7 | { 8 | public: 9 | bool reggedytd = false; 10 | bool opened = false; 11 | bool selectPressed = false; 12 | bool leftPressed = false; 13 | bool rightPressed = false; 14 | bool menusounds = true; 15 | 16 | bool Option(const char* option); 17 | bool Option(const char* option, std::function function); 18 | bool SubMenu(const char* option, SubMenus newSub); 19 | bool SubMenu(const char* option, SubMenus newSub, std::function function); 20 | bool Bool(const char* option, bool& b00l); 21 | bool Int(const char* option, int& _int, int min, int max); 22 | bool Int(const char* option, int& _int, int min, int max, int step); 23 | bool Float(const char* option, float& _float, int min, int max); 24 | bool Float(const char* option, float& _float, int min, int max, int step); 25 | bool IntVector(const char* option, std::vector Vector, int& position); 26 | bool FloatVector(const char* option, std::vector Vector, int& position); 27 | bool StringVector(const char* option, std::vector Vector, int& position); 28 | bool StringVector(const char* option, std::vector Vector, int& position); 29 | public: 30 | int textureID; 31 | int maxVisOptions = 11; 32 | int currentOption = 1; 33 | int optionCount = 0; 34 | 35 | int menuLevel = 0; 36 | int optionsArray[1000]; 37 | 38 | int keyPressDelay = 140; 39 | int keyPressPreviousTick = GetTickCount(); 40 | int openKey = VK_F8; 41 | int backKey = VK_BACK; 42 | int upKey = VK_UP; 43 | int downKey = VK_DOWN; 44 | int leftKey = VK_LEFT; 45 | int rightKey = VK_RIGHT; 46 | int selectKey = VK_RETURN; 47 | public: 48 | SubMenus currentMenu; 49 | SubMenus menusArray[1000]; 50 | public: 51 | float menuX = 0.85f; 52 | float menuWidth = 0.21f; 53 | public: 54 | RGBA titlerect = { 248, 225, 5, 255 }; 55 | RGBA optionrect = { 0, 0, 0, 130 }; 56 | RGBA scroller = { 248, 225, 5, 210 }; 57 | public: 58 | RGBAF titletext = { 255, 255, 255, 255, 7 }; 59 | RGBAF optiontext = { 255, 255, 255, 255, 6 }; 60 | public: 61 | void Keys(); 62 | void MoveMenu(SubMenus menu); 63 | void BackMenu(); 64 | 65 | void Title(const char* title); 66 | void End(); 67 | }; 68 | inline UserInterface gui; 69 | 70 | class Drawing 71 | { 72 | public: 73 | void Text(const char* text, RGBAF rgbaf, VECTOR2 position, VECTOR2_2 size, bool center); 74 | void Rect(RGBA rgba, VECTOR2 position, VECTOR2_2 size); 75 | void Sprite(std::string Streamedtexture, std::string textureName, float x, float y, float width, float height, float rotation, int r, int g, int b, int a); 76 | }; 77 | inline Drawing draw; 78 | } -------------------------------------------------------------------------------- /Source/keyboard.h: -------------------------------------------------------------------------------- 1 | #ifndef __KEYBOARD_H__ 2 | #define __KEYBOARD_H__ 3 | 4 | #pragma once 5 | 6 | #define VK_NOTHING 0x00 /*NULL*/ 7 | #define VK_KEY_0 0x30 //('0') 0 8 | #define VK_KEY_1 0x31 //('1') 1 9 | #define VK_KEY_2 0x32 //('2') 2 10 | #define VK_KEY_3 0x33 //('3') 3 11 | #define VK_KEY_4 0x34 //('4') 4 12 | #define VK_KEY_5 0x35 //('5') 5 13 | #define VK_KEY_6 0x36 //('6') 6 14 | #define VK_KEY_7 0x37 //('7') 7 15 | #define VK_KEY_8 0x38 //('8') 8 16 | #define VK_KEY_9 0x39 //('9') 9 17 | #define VK_KEY_A 0x41 //('A') A 18 | #define VK_KEY_B 0x42 //('B') B 19 | #define VK_KEY_C 0x43 //('C') C 20 | #define VK_KEY_D 0x44 //('D') D 21 | #define VK_KEY_E 0x45 //('E') E 22 | #define VK_KEY_F 0x46 //('F') F 23 | #define VK_KEY_G 0x47 //('G') G 24 | #define VK_KEY_H 0x48 //('H') H 25 | #define VK_KEY_I 0x49 //('I') I 26 | #define VK_KEY_J 0x4A //('J') J 27 | #define VK_KEY_K 0x4B //('K') K 28 | #define VK_KEY_L 0x4C //('L') L 29 | #define VK_KEY_M 0x4D //('M') M 30 | #define VK_KEY_N 0x4E //('N') N 31 | #define VK_KEY_O 0x4F //('O') O 32 | #define VK_KEY_P 0x50 //('P') P 33 | #define VK_KEY_Q 0x51 //('Q') Q 34 | #define VK_KEY_R 0x52 //('R') R 35 | #define VK_KEY_S 0x53 //('S') S 36 | #define VK_KEY_T 0x54 //('T') T 37 | #define VK_KEY_U 0x55 //('U') U 38 | #define VK_KEY_V 0x56 //('V') V 39 | #define VK_KEY_W 0x57 //('W') W 40 | #define VK_KEY_X 0x58 //('X') X 41 | #define VK_KEY_Y 0x59 //('Y') Y 42 | #define VK_KEY_Z 0x5A //('Z') Z 43 | 44 | #define IsKeyPressed(key) GetAsyncKeyState(key) & 0x8000 45 | 46 | // parameters are the same as with aru's ScriptHook for IV 47 | void OnKeyboardMessage(DWORD key, WORD repeats, BYTE scanCode, BOOL isExtended, BOOL isWithAlt, BOOL wasDownBefore, BOOL isUpNow); 48 | bool KeyDown(DWORD key); 49 | bool KeyJustUp(DWORD key, bool exclusive = true); 50 | bool KeyPressedOnce(bool& bIsPressed, DWORD vk); 51 | void ResetKeyState(DWORD key); 52 | 53 | enum navsound { 54 | NAV_OPEN, 55 | NAV_CLOSED, 56 | NAV_SELECT, 57 | NAV_CANCEL, 58 | NAV_UP_DOWN, 59 | NAV_LEFT_RIGHT, 60 | }; 61 | 62 | void menu_beep(int snd); 63 | void get_button_state(bool *a, bool *b, bool *up, bool *down, bool *l, bool *r); 64 | 65 | bool trainer_switch_pressed(); 66 | void reset_trainer_switch(); 67 | void setGameInputToEnabled(bool enabled, bool force = false); 68 | 69 | #endif // __KEYBOARD_H__ -------------------------------------------------------------------------------- /Source/NativeInvoker.h: -------------------------------------------------------------------------------- 1 | #ifndef __NATIVE_INVOKER_H__ 2 | #define __NATIVE_INVOKER_H__ 3 | 4 | #pragma once 5 | 6 | class scrNativeCallContext { 7 | protected: 8 | 9 | void * m_pReturn; 10 | uint32_t m_nArgCount; 11 | void * m_pArgs; 12 | uint32_t m_nDataCount; 13 | alignas(uintptr_t)uint8_t m_vectorSpace[192]; 14 | 15 | public: 16 | 17 | template 18 | inline T GetArgument( int idx ) { 19 | 20 | intptr_t * arguments = (intptr_t*)m_pArgs; 21 | return *(T*)&arguments[idx]; 22 | } 23 | 24 | template 25 | inline void SetResult( int idx, T value ) { 26 | 27 | intptr_t * returnValues = (intptr_t*)m_pReturn; 28 | *(T*)&returnValues[idx] = value; 29 | } 30 | 31 | inline int GetArgumentCount() { 32 | 33 | return m_nArgCount; 34 | } 35 | 36 | template 37 | inline T GetResult( int idx ) { 38 | 39 | intptr_t * returnValues = (intptr_t*)m_pReturn; 40 | return *(T*)&returnValues[idx]; 41 | } 42 | 43 | static void(*SetVectorResults)(scrNativeCallContext*); 44 | }; 45 | 46 | class NativeContext : public scrNativeCallContext { 47 | private: 48 | 49 | // Configuration 50 | enum { 51 | MaxNativeParams = 16, 52 | ArgSize = 8, 53 | }; 54 | 55 | // Anything temporary that we need 56 | uint8_t m_TempStack[MaxNativeParams * ArgSize]; 57 | 58 | public: 59 | 60 | inline NativeContext() { 61 | 62 | m_pArgs = &m_TempStack; 63 | m_pReturn = &m_TempStack; // It's okay to point both args and return at 64 | // the same pointer. The game should handle this. 65 | m_nArgCount = 0; 66 | m_nDataCount = 0; 67 | } 68 | 69 | template 70 | inline void Push( T value ) { 71 | 72 | if ( sizeof( T ) > ArgSize ) { 73 | throw "Argument has an invalid size"; 74 | } else if ( sizeof( T ) < ArgSize ) { 75 | // Ensure we don't have any stray data 76 | *reinterpret_cast( m_TempStack + ArgSize * m_nArgCount ) = 0; 77 | } 78 | 79 | *reinterpret_cast( m_TempStack + ArgSize * m_nArgCount ) = value; 80 | m_nArgCount++; 81 | } 82 | 83 | inline void Reverse() { 84 | 85 | uintptr_t tempValues[MaxNativeParams]; 86 | uintptr_t * args = (uintptr_t*)m_pArgs; 87 | 88 | for ( uint32_t i = 0; i < m_nArgCount; i++ ) { 89 | 90 | int target = m_nArgCount - i - 1; 91 | tempValues[target] = args[i]; 92 | } 93 | 94 | memcpy( m_TempStack, tempValues, sizeof( m_TempStack ) ); 95 | } 96 | 97 | template 98 | inline T GetResult() { 99 | 100 | return *reinterpret_cast( m_TempStack ); 101 | } 102 | }; 103 | 104 | struct pass { 105 | template pass( T... ) {} 106 | }; 107 | 108 | class NativeManagerContext : public NativeContext { 109 | public: 110 | 111 | NativeManagerContext() 112 | : NativeContext() { 113 | } 114 | 115 | void Reset() { 116 | 117 | m_nArgCount = 0; 118 | m_nDataCount = 0; 119 | } 120 | 121 | inline void* GetResultPointer() { 122 | 123 | return m_pReturn; 124 | } 125 | }; 126 | 127 | void nativeInit(UINT64 hash); 128 | 129 | void nativePush64(UINT64 val); 130 | 131 | PUINT64 nativeCall(); 132 | 133 | #endif // __NATIVE_INVOKER_H__ -------------------------------------------------------------------------------- /Source/keyboard.cpp: -------------------------------------------------------------------------------- 1 | //keyboard.cpp 2 | #include "stdafx.h" 3 | 4 | const int KEYS_SIZE = 255; 5 | 6 | DWORD trainerResetTime = 0; 7 | 8 | bool gameInputDisabledByUs = false; 9 | bool gameInputBlockedByUs = false; 10 | 11 | struct { 12 | DWORD time; 13 | BOOL isWithAlt; 14 | BOOL wasDownBefore; 15 | BOOL isUpNow; 16 | } keyStates[KEYS_SIZE]; 17 | 18 | void OnKeyboardMessage(DWORD key, WORD repeats, BYTE scanCode, BOOL isExtended, BOOL isWithAlt, BOOL wasDownBefore, BOOL isUpNow) 19 | { 20 | if (key < KEYS_SIZE) 21 | { 22 | keyStates[key].time = GetTickCount(); 23 | keyStates[key].isWithAlt = isWithAlt; 24 | keyStates[key].wasDownBefore = wasDownBefore; 25 | keyStates[key].isUpNow = isUpNow; 26 | } 27 | } 28 | 29 | const int NOW_PERIOD = 100, MAX_DOWN = 5000; // ms 30 | 31 | bool KeyDown(DWORD key) 32 | { 33 | return (key < KEYS_SIZE) ? ((GetTickCount() < keyStates[key].time + MAX_DOWN) && !keyStates[key].isUpNow) : false; 34 | } 35 | 36 | bool KeyJustUp(DWORD key, bool exclusive) 37 | { 38 | bool b = (key < KEYS_SIZE) ? (GetTickCount() < keyStates[key].time + NOW_PERIOD && keyStates[key].isUpNow) : false; 39 | if (b && exclusive) 40 | ResetKeyState(key); 41 | return b; 42 | } 43 | 44 | void ResetKeyState(DWORD key) 45 | { 46 | if (key < KEYS_SIZE) 47 | memset(&keyStates[key], 0, sizeof(keyStates[0])); 48 | } 49 | #define IsKeyPressed(key) GetAsyncKeyState(key) & 0x8000 50 | bool KeyPressedOnce(bool& bIsPressed, DWORD vk) 51 | { 52 | if (IsKeyPressed(vk)) 53 | { 54 | if (bIsPressed == false) 55 | { 56 | bIsPressed = true; 57 | return true; 58 | } 59 | } 60 | else if (bIsPressed == true) 61 | { 62 | bIsPressed = false; 63 | } 64 | return false; 65 | } 66 | 67 | bool trainer_switch_pressed() 68 | { 69 | bool result = KeyJustUp(VK_F4); 70 | return result; 71 | } 72 | 73 | void reset_trainer_switch() 74 | { 75 | trainerResetTime = GetTickCount(); 76 | } 77 | 78 | void get_button_state(bool *a, bool *b, bool *up, bool *down, bool *l, bool *r) 79 | { 80 | if (a) *a = KeyDown(VK_NUMPAD5); 81 | if (b) *b = KeyJustUp(VK_NUMPAD0); 82 | if (up) *up = KeyDown(VK_NUMPAD8); 83 | if (down) *down = KeyDown(VK_NUMPAD2); 84 | if (r) *r = KeyDown(VK_NUMPAD6); 85 | if (l) *l = KeyDown(VK_NUMPAD4); 86 | } 87 | 88 | void menu_beep(int snd) 89 | { 90 | switch (snd) 91 | { 92 | case NAV_SELECT: AUDIO::PLAY_SOUND_FRONTEND(-1, "SELECT", "HUD_FREEMODE_SOUNDSET", 1); 93 | case NAV_CANCEL: AUDIO::PLAY_SOUND_FRONTEND(-1, "CANCEL", "HUD_FREEMODE_SOUNDSET", 1); 94 | case NAV_UP_DOWN: AUDIO::PLAY_SOUND_FRONTEND(-1, "NAV_UP_DOWN", "HUD_FREEMODE_SOUNDSET", 1); 95 | case NAV_LEFT_RIGHT: AUDIO::PLAY_SOUND_FRONTEND(-1, "NAV_LEFT_RIGHT", "HUD_FREEMODE_SOUNDSET", 1); 96 | default: break; 97 | } 98 | } 99 | 100 | void setGameInputToEnabled(bool enabled, bool force) 101 | { 102 | if (enabled && (gameInputDisabledByUs || force)) 103 | { 104 | PLAYER::SET_PLAYER_CONTROL(0, 1, 0); 105 | //CONTROLS::ENABLE_ALL_CONTROL_ACTIONS(1); 106 | gameInputDisabledByUs = false; 107 | } 108 | else if (!enabled) 109 | { 110 | PLAYER::SET_PLAYER_CONTROL(0, 0, 256); 111 | //CONTROLS::DISABLE_ALL_CONTROL_ACTIONS(1); 112 | gameInputDisabledByUs = true; 113 | } 114 | } -------------------------------------------------------------------------------- /Source/Script.cpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "UserInterface.h" 4 | 5 | void ScriptMain() { 6 | srand(GetTickCount()); 7 | 8 | using namespace Menu; 9 | while (true) { 10 | hooks.m_register_file(&gui.textureID, "C:\\SudoMod\\Textures\\SudoMod.ytd", true, "SudoMod.ytd", false); // Load YTD /* https://www.unknowncheats.me/forum/3158178-post18.html */ 11 | gui.Keys(); 12 | 13 | /* Features */ 14 | Local::UpdateLoop(); 15 | Car::UpdateLoop(); 16 | Gun::UpdateLoop(); 17 | Misc::UpdateLoop(); 18 | Other::UpdateLoop(); 19 | Online::UpdateLoop(); 20 | 21 | switch (gui.currentMenu) { 22 | 23 | case MAINMENU: 24 | { 25 | gui.Title("HOME"); 26 | gui.SubMenu("Test", TEST); 27 | gui.SubMenu("Protections", PROTECTIONS); 28 | gui.SubMenu("Playerlist", PLAYERLIST); 29 | if (gui.Option("Unload")) { g_running = false; } 30 | } 31 | break; 32 | case TEST: 33 | { 34 | gui.Title("TEST"); 35 | gui.Bool("God Mode", Local::god); 36 | if (gui.Option("Print Player Name")) 37 | { 38 | std::string scname = std::string("SocialClub Name: ") + PLAYER::GET_PLAYER_NAME(PLAYER::PLAYER_ID()); 39 | Log_Info(_strdup(scname.c_str())); 40 | } 41 | if (gui.Option("Spawn T20")) { MenuFunctions::SpawnVehicle("T20"); } 42 | if (gui.Option("Spawn Adder")) { MenuFunctions::SpawnVehicle("Adder"); } 43 | if (gui.Option("Spawn Vagner")) { MenuFunctions::SpawnVehicle("Vagner"); } 44 | if (gui.Option("Spawn T20")) { MenuFunctions::SpawnVehicle("T20"); } 45 | if (gui.Option("Spawn T20")) { MenuFunctions::SpawnVehicle("T20"); } 46 | if (gui.Option("Spawn T20")) { MenuFunctions::SpawnVehicle("T20"); } 47 | if (gui.Option("Spawn T20")) { MenuFunctions::SpawnVehicle("T20"); } 48 | if (gui.Option("Spawn T20")) { MenuFunctions::SpawnVehicle("T20"); } 49 | if (gui.Option("Spawn T20")) { MenuFunctions::SpawnVehicle("T20"); } 50 | if (gui.Option("Spawn T20")) { MenuFunctions::SpawnVehicle("T20"); } 51 | if (gui.Option("Spawn T20")) { MenuFunctions::SpawnVehicle("T20"); } 52 | if (gui.Option("Spawn T20")) { MenuFunctions::SpawnVehicle("T20"); } 53 | if (gui.Option("Spawn T20")) { MenuFunctions::SpawnVehicle("T20"); } 54 | if (gui.Option("Spawn T20")) { MenuFunctions::SpawnVehicle("T20"); } 55 | if (gui.Option("Spawn T20")) { MenuFunctions::SpawnVehicle("T20"); } 56 | if (gui.Option("Spawn T20")) { MenuFunctions::SpawnVehicle("T20"); } 57 | if (gui.Option("Spawn T20")) { MenuFunctions::SpawnVehicle("T20"); } 58 | 59 | } 60 | break; 61 | case PROTECTIONS: 62 | { 63 | gui.Title("PROTECTIONS"); 64 | gui.Bool("Log All Script Events", Online::event_logger); 65 | gui.Bool("Event Blocker", Online::event_blocker); 66 | gui.Bool("Karma", Online::event_karma); 67 | } 68 | break; 69 | case PLAYERLIST: 70 | gui.Title("PLAYERLIST"); 71 | for (int i = 0; i < 32; ++i) { 72 | if (ENTITY::DOES_ENTITY_EXIST(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(i))) { 73 | gui.SubMenu(PLAYER::GET_PLAYER_NAME(i), PLAYERLIST_SELECTED) ? Online::g_SelectedPlayer = i : NULL; 74 | } 75 | } 76 | break; 77 | case PLAYERLIST_SELECTED: 78 | gui.Title(PLAYER::GET_PLAYER_NAME(Online::g_SelectedPlayer)); 79 | if (gui.Option("CEO Ban")) 80 | { 81 | uint64_t tseargs[3] = { -738295409, Online::g_SelectedPlayer, 1 }; 82 | hooks.m_trigger_script_event(1, tseargs, 3, 1 << Online::g_SelectedPlayer); 83 | std::string sent = std::string("SudoMod || Sent Event CEO BAN to: ") + PLAYER::GET_PLAYER_NAME(Online::g_SelectedPlayer); 84 | Log_Info(_strdup(sent.c_str())); 85 | } 86 | break; 87 | } 88 | gui.End(); 89 | WAIT(0); 90 | } 91 | } -------------------------------------------------------------------------------- /Source/SudoMod.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 6 | h;hh;hpp;hxx;hm;inl;inc;xsd 7 | 8 | 9 | {2a12d025-c2ec-49af-84af-2c26d0618e38} 10 | 11 | 12 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 13 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 14 | 15 | 16 | {fcfe2863-9343-425e-832a-2c086dfbbc7d} 17 | 18 | 19 | {5923c1ae-b443-4489-9f78-241dc0f9c6da} 20 | 21 | 22 | {e4b43e58-bad3-45c9-bbcb-99ff04a5459f} 23 | 24 | 25 | {895871b7-69da-4701-b946-53d5cc648fd9} 26 | 27 | 28 | {a4cbfc08-880e-4b7b-9b6b-8d57dcecbfa3} 29 | 30 | 31 | {c82076d4-c4cc-40d8-b07a-4b1bd2871809} 32 | 33 | 34 | {7e8d3635-34ae-405f-9654-59498f86c857} 35 | 36 | 37 | 38 | 39 | Header Files 40 | 41 | 42 | Header Files 43 | 44 | 45 | Header Files 46 | 47 | 48 | Header Files 49 | 50 | 51 | Header Files 52 | 53 | 54 | Header Files 55 | 56 | 57 | Header Files 58 | 59 | 60 | Header Files 61 | 62 | 63 | Header Files 64 | 65 | 66 | Menu 67 | 68 | 69 | Menu 70 | 71 | 72 | Header Files 73 | 74 | 75 | Header Files 76 | 77 | 78 | Header Files 79 | 80 | 81 | Header Files 82 | 83 | 84 | Header Files 85 | 86 | 87 | Features\Local 88 | 89 | 90 | Features\Car 91 | 92 | 93 | Features\Gun 94 | 95 | 96 | Features\Misc 97 | 98 | 99 | Features\Other 100 | 101 | 102 | Features\Online 103 | 104 | 105 | Features 106 | 107 | 108 | 109 | 110 | Source Files 111 | 112 | 113 | Source Files 114 | 115 | 116 | Source Files 117 | 118 | 119 | Source Files 120 | 121 | 122 | Source Files 123 | 124 | 125 | Source Files 126 | 127 | 128 | Menu 129 | 130 | 131 | Menu 132 | 133 | 134 | Source Files 135 | 136 | 137 | Source Files 138 | 139 | 140 | Features\Local 141 | 142 | 143 | Features\Car 144 | 145 | 146 | Features\Gun 147 | 148 | 149 | Features\Misc 150 | 151 | 152 | Features\Other 153 | 154 | 155 | Features\Online 156 | 157 | 158 | Features 159 | 160 | 161 | 162 | 163 | Source Files 164 | 165 | 166 | -------------------------------------------------------------------------------- /Source/Hooking.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "enums.h" 3 | 4 | using GetNumberOfEvents = int32_t(int32_t unk); 5 | using GetLabelText = const char* (void* unk, const char* label); 6 | using GetEventData = bool(std::int32_t eventGroup, std::int32_t eventIndex, std::int64_t* args, std::uint32_t argCount); 7 | using RegisterFile = uint32_t(int* p1, const char* p2, bool p3, const char* p4, bool p5); 8 | using TriggerScriptEvent = int(int eventgroup, uint64_t* arg, int argcount, uint32_t bit); 9 | 10 | class Hooking 11 | { 12 | private: 13 | static BOOL InitializeHooks(); 14 | static void FindPatterns(); 15 | static void FailPatterns(const char* name); 16 | 17 | public: 18 | static std::vector m_hooks; 19 | static uint64_t* m_framecount; 20 | static GetNumberOfEvents* m_get_number_of_events; 21 | static GetLabelText* m_get_label_text; 22 | static GetEventData* m_get_event_data; 23 | static RegisterFile* m_register_file; 24 | static TriggerScriptEvent* m_trigger_script_event; 25 | static PVOID m_model_spawn_bypass; 26 | static void* m_native_return; 27 | static eGameState* m_gamestate; 28 | static uint64_t m_world_pointer; 29 | static __int64** m_global_pointer; 30 | 31 | static void Start(HMODULE hmoduleDLL); 32 | static void __declspec(noreturn) Cleanup(); 33 | static void onTickInit(); 34 | static bool HookNatives(); 35 | static void defuseEvent(RockstarEvent e, bool toggle); 36 | 37 | // Native function handler type 38 | typedef void(__cdecl* NativeHandler)(scrNativeCallContext* context); 39 | struct NativeRegistrationNew 40 | { 41 | uint64_t nextRegistration1; 42 | uint64_t nextRegistration2; 43 | Hooking::NativeHandler handlers[7]; 44 | uint32_t numEntries1; 45 | uint32_t numEntries2; 46 | uint64_t hashes; 47 | 48 | inline NativeRegistrationNew* getNextRegistration() 49 | { 50 | uintptr_t result; 51 | auto v5 = reinterpret_cast(&nextRegistration1); 52 | auto v12 = 2i64; 53 | auto v13 = v5 ^ nextRegistration2; 54 | auto v14 = (char*)&result - v5; 55 | do 56 | { 57 | *(DWORD*)&v14[v5] = (DWORD)(v13 ^ *(DWORD*)v5); 58 | v5 += 4i64; 59 | --v12; 60 | } while (v12); 61 | 62 | return reinterpret_cast(result); 63 | } 64 | 65 | inline uint32_t getNumEntries() 66 | { 67 | return (uint32_t)(((uintptr_t)&numEntries1) ^ numEntries1 ^ numEntries2); 68 | } 69 | 70 | inline uint64_t getHash(uint32_t index) 71 | { 72 | 73 | auto naddr = 16 * index + reinterpret_cast(&nextRegistration1) + 0x54; 74 | auto v8 = 2i64; 75 | uint64_t nResult; 76 | auto v11 = (char*)&nResult - naddr; 77 | auto v10 = naddr ^ *(DWORD*)(naddr + 8); 78 | do 79 | { 80 | *(DWORD*)&v11[naddr] = (DWORD)(v10 ^ *(DWORD*)(naddr)); 81 | naddr += 4i64; 82 | --v8; 83 | } while (v8); 84 | 85 | return nResult; 86 | } 87 | }; 88 | static NativeHandler GetNativeHandler(uint64_t origHash); 89 | }; 90 | 91 | void WAIT(DWORD ms); 92 | 93 | 94 | enum eThreadState 95 | { 96 | ThreadStateIdle = 0x0, 97 | ThreadStateRunning = 0x1, 98 | ThreadStateKilled = 0x2, 99 | ThreadState3 = 0x3, 100 | ThreadState4 = 0x4, 101 | }; 102 | 103 | struct scrThreadContext 104 | { 105 | int ThreadID; 106 | int ScriptHash; 107 | eThreadState State; 108 | int _IP; 109 | int FrameSP; 110 | int _SPP; 111 | float TimerA; 112 | float TimerB; 113 | int TimerC; 114 | int _mUnk1; 115 | int _mUnk2; 116 | int _f2C; 117 | int _f30; 118 | int _f34; 119 | int _f38; 120 | int _f3C; 121 | int _f40; 122 | int _f44; 123 | int _f48; 124 | int _f4C; 125 | int _f50; 126 | int pad1; 127 | int pad2; 128 | int pad3; 129 | int _set1; 130 | int pad[17]; 131 | }; 132 | 133 | struct scrThread 134 | { 135 | void* vTable; 136 | scrThreadContext m_ctx; 137 | void* m_pStack; 138 | void* pad; 139 | void* pad2; 140 | const char* m_pszExitMessage; 141 | }; 142 | 143 | struct ScriptThread : scrThread 144 | { 145 | const char Name[64]; 146 | void* m_pScriptHandler; 147 | const char gta_pad2[40]; 148 | const char flag1; 149 | const char m_networkFlag; 150 | bool bool1; 151 | bool bool2; 152 | bool bool3; 153 | bool bool4; 154 | bool bool5; 155 | bool bool6; 156 | bool bool7; 157 | bool bool8; 158 | bool bool9; 159 | bool bool10; 160 | bool bool11; 161 | bool bool12; 162 | const char gta_pad3[10]; 163 | }; 164 | 165 | /* 166 | //CPatternResult 167 | */ 168 | 169 | class CPatternResult 170 | { 171 | public: 172 | CPatternResult(void* pVoid); 173 | CPatternResult(void* pVoid, void* pBegin, void* pEnd); 174 | ~CPatternResult(); 175 | 176 | template 177 | rT* get(int offset = 0) 178 | { 179 | rT* ret = nullptr; 180 | if (m_pVoid != nullptr) 181 | ret = reinterpret_cast(reinterpret_cast(m_pVoid) + offset); 182 | return ret; 183 | } 184 | 185 | template 186 | rT* get_rel(int offset = 0) 187 | { 188 | rT* result = nullptr; 189 | int32_t rel; 190 | char* ptr = get(offset); 191 | 192 | if (ptr == nullptr) 193 | goto LABEL_RETURN; 194 | 195 | rel = *(int32_t*)ptr; 196 | result = reinterpret_cast(ptr + rel + sizeof(rel)); 197 | 198 | LABEL_RETURN: 199 | return result; 200 | } 201 | 202 | template 203 | rT* section_begin() 204 | { 205 | return reinterpret_cast(m_pBegin); 206 | } 207 | 208 | template 209 | rT* section_end() 210 | { 211 | return reinterpret_cast(m_pEnd); 212 | } 213 | 214 | protected: 215 | void* m_pVoid = nullptr; 216 | void* m_pBegin = nullptr; 217 | void* m_pEnd = nullptr; 218 | }; 219 | 220 | class CMetaData 221 | { 222 | public: 223 | static uint64_t begin(); 224 | static uint64_t end(); 225 | static DWORD size(); 226 | static void init(); 227 | private: 228 | static uint64_t m_begin; 229 | static uint64_t m_end; 230 | static DWORD m_size; 231 | }; 232 | 233 | /* 234 | //CPattern 235 | */ 236 | 237 | typedef std::vector vec_result; 238 | class CPattern 239 | { 240 | public: 241 | CPattern(char* szByte, char* szMask); 242 | ~CPattern(); 243 | 244 | CPattern& find(int i = 0, uint64_t startAddress = 0); //scans for i patterns 245 | CPattern& virtual_find(int i = 0, uint64_t startAddress = 0); 246 | CPatternResult get(int i); //returns result i 247 | 248 | protected: 249 | char* m_szByte; 250 | char* m_szMask; 251 | bool m_bSet; 252 | vec_result m_result; 253 | 254 | bool match(int i = 0, uint64_t startAddress = 0, bool virt = false); 255 | bool byte_compare(const BYTE* pData, const BYTE* btMask, const char* szMask); 256 | uint64_t find_pattern(uint64_t i64Address, uint64_t end, BYTE* btMask, char* szMask); 257 | uint64_t virtual_find_pattern(uint64_t address, BYTE* btMask, char* szMask); 258 | }; 259 | 260 | struct MinHookKeepalive 261 | { 262 | MinHookKeepalive(); 263 | ~MinHookKeepalive(); 264 | }; 265 | extern Hooking hooks; 266 | extern MinHookKeepalive g_MinHookKeepalive; 267 | -------------------------------------------------------------------------------- /Source/MinHook/include/MinHook.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MinHook - The Minimalistic API Hooking Library for x64/x86 3 | * Copyright (C) 2009-2015 Tsuda Kageyu. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 20 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #pragma once 30 | 31 | #if !(defined _M_IX86) && !(defined _M_X64) 32 | #error MinHook supports only x86 and x64 systems. 33 | #endif 34 | 35 | #include 36 | 37 | // MinHook Error Codes. 38 | typedef enum MH_STATUS 39 | { 40 | // Unknown error. Should not be returned. 41 | MH_UNKNOWN = -1, 42 | 43 | // Successful. 44 | MH_OK = 0, 45 | 46 | // MinHook is already initialized. 47 | MH_ERROR_ALREADY_INITIALIZED, 48 | 49 | // MinHook is not initialized yet, or already uninitialized. 50 | MH_ERROR_NOT_INITIALIZED, 51 | 52 | // The hook for the specified target function is already created. 53 | MH_ERROR_ALREADY_CREATED, 54 | 55 | // The hook for the specified target function is not created yet. 56 | MH_ERROR_NOT_CREATED, 57 | 58 | // The hook for the specified target function is already enabled. 59 | MH_ERROR_ENABLED, 60 | 61 | // The hook for the specified target function is not enabled yet, or already 62 | // disabled. 63 | MH_ERROR_DISABLED, 64 | 65 | // The specified pointer is invalid. It points the address of non-allocated 66 | // and/or non-executable region. 67 | MH_ERROR_NOT_EXECUTABLE, 68 | 69 | // The specified target function cannot be hooked. 70 | MH_ERROR_UNSUPPORTED_FUNCTION, 71 | 72 | // Failed to allocate memory. 73 | MH_ERROR_MEMORY_ALLOC, 74 | 75 | // Failed to change the memory protection. 76 | MH_ERROR_MEMORY_PROTECT, 77 | 78 | // The specified module is not loaded. 79 | MH_ERROR_MODULE_NOT_FOUND, 80 | 81 | // The specified function is not found. 82 | MH_ERROR_FUNCTION_NOT_FOUND 83 | } 84 | MH_STATUS; 85 | 86 | // Can be passed as a parameter to MH_EnableHook, MH_DisableHook, 87 | // MH_QueueEnableHook or MH_QueueDisableHook. 88 | #define MH_ALL_HOOKS NULL 89 | 90 | #ifdef __cplusplus 91 | extern "C" { 92 | #endif 93 | 94 | // Initialize the MinHook library. You must call this function EXACTLY ONCE 95 | // at the beginning of your program. 96 | MH_STATUS WINAPI MH_Initialize(VOID); 97 | 98 | // Uninitialize the MinHook library. You must call this function EXACTLY 99 | // ONCE at the end of your program. 100 | MH_STATUS WINAPI MH_Uninitialize(VOID); 101 | 102 | // Creates a Hook for the specified target function, in disabled state. 103 | // Parameters: 104 | // pTarget [in] A pointer to the target function, which will be 105 | // overridden by the detour function. 106 | // pDetour [in] A pointer to the detour function, which will override 107 | // the target function. 108 | // ppOriginal [out] A pointer to the trampoline function, which will be 109 | // used to call the original target function. 110 | // This parameter can be NULL. 111 | MH_STATUS WINAPI MH_CreateHook(LPVOID pTarget, LPVOID pDetour, LPVOID *ppOriginal); 112 | 113 | // Creates a Hook for the specified API function, in disabled state. 114 | // Parameters: 115 | // pszModule [in] A pointer to the loaded module name which contains the 116 | // target function. 117 | // pszTarget [in] A pointer to the target function name, which will be 118 | // overridden by the detour function. 119 | // pDetour [in] A pointer to the detour function, which will override 120 | // the target function. 121 | // ppOriginal [out] A pointer to the trampoline function, which will be 122 | // used to call the original target function. 123 | // This parameter can be NULL. 124 | MH_STATUS WINAPI MH_CreateHookApi( 125 | LPCWSTR pszModule, LPCSTR pszProcName, LPVOID pDetour, LPVOID *ppOriginal); 126 | 127 | // Removes an already created hook. 128 | // Parameters: 129 | // pTarget [in] A pointer to the target function. 130 | MH_STATUS WINAPI MH_RemoveHook(LPVOID pTarget); 131 | 132 | // Enables an already created hook. 133 | // Parameters: 134 | // pTarget [in] A pointer to the target function. 135 | // If this parameter is MH_ALL_HOOKS, all created hooks are 136 | // enabled in one go. 137 | MH_STATUS WINAPI MH_EnableHook(LPVOID pTarget); 138 | 139 | // Disables an already created hook. 140 | // Parameters: 141 | // pTarget [in] A pointer to the target function. 142 | // If this parameter is MH_ALL_HOOKS, all created hooks are 143 | // disabled in one go. 144 | MH_STATUS WINAPI MH_DisableHook(LPVOID pTarget); 145 | 146 | // Queues to enable an already created hook. 147 | // Parameters: 148 | // pTarget [in] A pointer to the target function. 149 | // If this parameter is MH_ALL_HOOKS, all created hooks are 150 | // queued to be enabled. 151 | MH_STATUS WINAPI MH_QueueEnableHook(LPVOID pTarget); 152 | 153 | // Queues to disable an already created hook. 154 | // Parameters: 155 | // pTarget [in] A pointer to the target function. 156 | // If this parameter is MH_ALL_HOOKS, all created hooks are 157 | // queued to be disabled. 158 | MH_STATUS WINAPI MH_QueueDisableHook(LPVOID pTarget); 159 | 160 | // Applies all queued changes in one go. 161 | MH_STATUS WINAPI MH_ApplyQueued(VOID); 162 | 163 | // Translates the MH_STATUS to its name as a string. 164 | const char * WINAPI MH_StatusToString(MH_STATUS status); 165 | 166 | #ifdef __cplusplus 167 | } 168 | #endif 169 | 170 | -------------------------------------------------------------------------------- /Source/Memory.cpp: -------------------------------------------------------------------------------- 1 | //Memory.cpp 2 | #include "stdafx.h" 3 | #include 4 | 5 | static std::multimap g_hints; 6 | 7 | void Memory::executable_meta::EnsureInit() { 8 | 9 | if ( m_begin ) { 10 | return; 11 | } 12 | 13 | HMODULE gModule = GetModuleHandle( NULL ); 14 | 15 | m_begin = reinterpret_cast(gModule); 16 | const IMAGE_DOS_HEADER * dosHeader = reinterpret_cast(gModule); 17 | const IMAGE_NT_HEADERS * ntHeader = reinterpret_cast( reinterpret_cast(dosHeader)+dosHeader->e_lfanew ); 18 | m_end = m_begin + ntHeader->OptionalHeader.SizeOfCode; 19 | m_size = ntHeader->OptionalHeader.SizeOfImage; 20 | } 21 | 22 | void Memory::TransformPattern( const std::string & pattern, std::string & data, std::string & mask ) { 23 | 24 | std::stringstream dataStr; 25 | std::stringstream maskStr; 26 | 27 | uint8_t tempDigit = 0; 28 | bool tempFlag = false; 29 | 30 | for ( auto & ch : pattern ) { 31 | 32 | if ( ch == ' ' ) { 33 | continue; 34 | } else if ( ch == '?' ) { 35 | 36 | dataStr << '\x00'; 37 | maskStr << '?'; 38 | } else if ( ( ch >= '0' && ch <= '9' ) || ( ch >= 'A' && ch <= 'F' ) || ( ch >= 'a' && ch <= 'f' ) ) { 39 | 40 | char str[] = { ch, 0 }; 41 | int thisDigit = strtol( str, nullptr, 16 ); 42 | 43 | if ( !tempFlag ) { 44 | 45 | tempDigit = ( thisDigit << 4 ); 46 | tempFlag = true; 47 | } else { 48 | 49 | tempDigit |= thisDigit; 50 | tempFlag = false; 51 | 52 | dataStr << tempDigit; 53 | maskStr << 'x'; 54 | } 55 | } 56 | } 57 | 58 | data = dataStr.str(); 59 | mask = maskStr.str(); 60 | } 61 | 62 | void Memory::pattern::Initialize( const char* pattern, size_t length ) { 63 | 64 | // get the hash for the base pattern 65 | std::string baseString( pattern, length ); 66 | m_hash = fnv_1()( baseString ); 67 | 68 | m_matched = false; 69 | 70 | // transform the base pattern from IDA format to canonical format 71 | TransformPattern( baseString, m_bytes, m_mask ); 72 | 73 | m_size = m_mask.size(); 74 | 75 | // if there's hints, try those first 76 | auto range = g_hints.equal_range( m_hash ); 77 | 78 | if ( range.first != range.second ) { 79 | 80 | std::for_each( range.first, range.second, [&]( const std::pair & hint ) { 81 | ConsiderMatch( hint.second ); 82 | } ); 83 | 84 | // if the hints succeeded, we don't need to do anything more 85 | if ( m_matches.size() > 0 ) { 86 | m_matched = true; 87 | return; 88 | } 89 | } 90 | } 91 | 92 | uintptr_t Memory::get_base() 93 | { 94 | executable_meta executable; 95 | executable.EnsureInit(); 96 | return executable.begin(); 97 | } 98 | 99 | DWORD Memory::get_size() 100 | { 101 | executable_meta executable; 102 | executable.EnsureInit(); 103 | return executable.size(); 104 | } 105 | 106 | uintptr_t Memory::get_base_offsetted(DWORD offset) 107 | { 108 | return get_base() + offset; 109 | } 110 | 111 | uintptr_t Memory::get_multilayer_pointer(uintptr_t base_address, std::vector offsets) 112 | { 113 | uintptr_t ptr = *(uintptr_t*)(base_address); 114 | if (!ptr) { 115 | 116 | return NULL; 117 | } 118 | auto level = offsets.size(); 119 | 120 | for (auto i = 0; i < level; i++) 121 | { 122 | if (i == level - 1) 123 | { 124 | ptr += offsets[i]; 125 | if (!ptr) return NULL; 126 | return ptr; 127 | } 128 | else 129 | { 130 | ptr = *(uint64_t*)(ptr + offsets[i]); 131 | if (!ptr) return NULL; 132 | } 133 | } 134 | 135 | return ptr; 136 | } 137 | 138 | static bool compare(const uint8_t* pData, const uint8_t* bMask, const char* sMask) 139 | { 140 | for (; *sMask; ++sMask, ++pData, ++bMask) 141 | if (*sMask == 'x' && *pData != *bMask) 142 | return false; 143 | 144 | return *sMask == NULL; 145 | } 146 | 147 | std::vector Memory::get_string_addresses(std::string str) 148 | { 149 | std::string currentMask; 150 | const char* to_scan = str.c_str(); 151 | for (uint8_t i = 0; i < strlen(to_scan); i++) currentMask += "x"; 152 | const char *mask = currentMask.c_str(); 153 | std::vector foundAddrs; 154 | for (uint32_t i = 0; i < get_size(); ++i) 155 | { 156 | auto address = get_base() + i; 157 | if (compare((BYTE *)(address), (BYTE *)to_scan, mask)) 158 | { 159 | foundAddrs.push_back((address)); 160 | } 161 | } 162 | 163 | return foundAddrs; 164 | 165 | } 166 | 167 | bool Memory::pattern::ConsiderMatch( uintptr_t offset ) { 168 | 169 | const char * pattern = m_bytes.c_str(); 170 | const char * mask = m_mask.c_str(); 171 | 172 | char * ptr = reinterpret_cast( offset ); 173 | 174 | for ( size_t i = 0; i < m_size; i++ ) { 175 | 176 | if ( mask[i] == '?' ) { 177 | continue; 178 | } 179 | 180 | if ( pattern[i] != ptr[i] ) { 181 | return false; 182 | } 183 | } 184 | 185 | m_matches.push_back( pattern_match( ptr ) ); 186 | 187 | return true; 188 | } 189 | 190 | void Memory::pattern::EnsureMatches( int maxCount ) { 191 | 192 | if ( m_matched ) { 193 | return; 194 | } 195 | 196 | // Scan the executable for code 197 | static executable_meta executable; 198 | 199 | executable.EnsureInit(); 200 | 201 | // Check if SSE 4.2 is supported 202 | int cpuid[4]; 203 | __cpuid( cpuid, 0 ); 204 | 205 | bool sse42 = false; 206 | 207 | if ( m_mask.size() <= 16 ) { 208 | 209 | if ( cpuid[0] >= 1 ) { 210 | 211 | __cpuidex( cpuid, 1, 0 ); 212 | 213 | sse42 = ( cpuid[2] & ( 1 << 20 ) ) == 1; 214 | } 215 | } 216 | 217 | auto matchSuccess = [&]( uintptr_t address ) { 218 | 219 | g_hints.insert( std::make_pair( m_hash, address ) ); 220 | 221 | return ( m_matches.size() == maxCount ); 222 | }; 223 | 224 | LARGE_INTEGER ticks; 225 | QueryPerformanceCounter( &ticks ); 226 | 227 | uint64_t startTicksOld = ticks.QuadPart; 228 | 229 | if ( !sse42 ) { 230 | 231 | for ( uintptr_t i = executable.begin(); i <= executable.end(); i++ ) { 232 | 233 | if ( ConsiderMatch( i ) ) { 234 | 235 | if ( matchSuccess( i ) ) { 236 | break; 237 | } 238 | } 239 | } 240 | } else { 241 | 242 | __declspec( align( 16 ) ) char desiredMask[16] = { 0 }; 243 | 244 | for ( int i = 0; i < m_mask.size(); i++ ) { 245 | desiredMask[i / 8] |= ( ( m_mask[i] == '?' ) ? 0 : 1 ) << ( i % 8 ); 246 | } 247 | 248 | __m128i mask = _mm_load_si128( reinterpret_cast( desiredMask ) ); 249 | __m128i comparand = _mm_loadu_si128( reinterpret_cast( m_bytes.c_str() ) ); 250 | 251 | for ( uintptr_t i = executable.begin(); i <= executable.end(); i++ ) { 252 | 253 | __m128i value = _mm_loadu_si128( reinterpret_cast( i ) ); 254 | __m128i result = _mm_cmpestrm( value, 16, comparand, (int)m_bytes.size(), _SIDD_CMP_EQUAL_EACH ); 255 | 256 | // As the result can match more bits than the mask contains 257 | __m128i matches = _mm_and_si128( mask, result ); 258 | __m128i equivalence = _mm_xor_si128( mask, matches ); 259 | 260 | if ( _mm_test_all_zeros( equivalence, equivalence ) ) { 261 | 262 | m_matches.push_back( pattern_match( (void*)i ) ); 263 | 264 | if ( matchSuccess( i ) ) { 265 | break; 266 | } 267 | } 268 | } 269 | } 270 | 271 | m_matched = true; 272 | } 273 | 274 | void Memory::pattern::hint( uint64_t hash, uintptr_t address ) { 275 | 276 | auto range = g_hints.equal_range( hash ); 277 | 278 | for ( auto it = range.first; it != range.second; it++ ) { 279 | 280 | if ( it->second == address ) { 281 | return; 282 | } 283 | } 284 | 285 | g_hints.insert( std::make_pair( hash, address ) ); 286 | } 287 | -------------------------------------------------------------------------------- /Source/Memory.h: -------------------------------------------------------------------------------- 1 | #ifndef __MEMORY_H__ 2 | #define __MEMORY_H__ 3 | 4 | #pragma once 5 | 6 | // from boost libraries 7 | template 8 | struct basic_fnv_1 { 9 | 10 | uint64_t operator()( std::string const& text ) const { 11 | 12 | uint64_t hash = OffsetBasis; 13 | for ( std::string::const_iterator it = text.begin(), end = text.end(); it != end; ++it ) { 14 | 15 | hash *= FnvPrime; 16 | hash ^= *it; 17 | } 18 | 19 | return hash; 20 | } 21 | }; 22 | 23 | const uint64_t fnv_prime = 1099511628211u; 24 | const uint64_t fnv_offset_basis = 14695981039346656037u; 25 | 26 | typedef basic_fnv_1 fnv_1; 27 | 28 | namespace Memory { 29 | 30 | void TransformPattern( const std::string & pattern, std::string & data, std::string & mask ); 31 | 32 | class executable_meta { 33 | private: 34 | 35 | uintptr_t m_begin; 36 | uintptr_t m_end; 37 | DWORD m_size; 38 | public: 39 | 40 | executable_meta() 41 | : m_begin( 0 ), m_end( 0 ) { 42 | } 43 | 44 | void EnsureInit(); 45 | 46 | inline uintptr_t begin() { return m_begin; } 47 | inline uintptr_t end() { return m_end; } 48 | inline DWORD size() { return m_size; } 49 | }; 50 | 51 | class pattern_match { 52 | private: 53 | 54 | void * m_pointer; 55 | 56 | public: 57 | 58 | inline pattern_match( void * pointer ) { 59 | 60 | m_pointer = pointer; 61 | } 62 | 63 | template 64 | T * get( int offset ) { 65 | 66 | if ( m_pointer == nullptr ) { 67 | return nullptr; 68 | } 69 | 70 | char * ptr = reinterpret_cast( m_pointer ); 71 | return reinterpret_cast( ptr + offset ); 72 | } 73 | 74 | template 75 | T * get() { 76 | 77 | return get( 0 ); 78 | } 79 | }; 80 | 81 | typedef std::vector matchVec; 82 | 83 | class pattern { 84 | private: 85 | 86 | std::string m_bytes; 87 | std::string m_mask; 88 | 89 | uint64_t m_hash; 90 | 91 | size_t m_size; 92 | 93 | matchVec m_matches; 94 | 95 | bool m_matched; 96 | 97 | private: 98 | 99 | void Initialize( const char* pattern, size_t length ); 100 | 101 | bool ConsiderMatch( uintptr_t offset ); 102 | 103 | void EnsureMatches( int maxCount ); 104 | 105 | public: 106 | 107 | template 108 | pattern( const char( &pattern )[Len] ) { 109 | 110 | Initialize( pattern, Len ); 111 | } 112 | 113 | inline pattern & count( int expected ) { 114 | 115 | if ( !m_matched ) { 116 | EnsureMatches( expected ); 117 | } 118 | 119 | return *this; 120 | } 121 | 122 | inline size_t size() { 123 | 124 | if ( !m_matched ) { 125 | EnsureMatches( INT_MAX ); 126 | } 127 | 128 | return m_matches.size(); 129 | } 130 | 131 | inline pattern_match & get( int index ) { 132 | 133 | if ( !m_matched ) { 134 | EnsureMatches( INT_MAX ); 135 | } 136 | 137 | if ( m_matches.size() == 0 ) { 138 | 139 | m_matches.push_back( pattern_match( nullptr ) ); 140 | return m_matches[0]; 141 | } 142 | 143 | return m_matches[index]; 144 | } 145 | 146 | public: 147 | // define a hint 148 | static void hint( uint64_t hash, uintptr_t address ); 149 | }; 150 | 151 | // for link /DYNAMICBASE executables 152 | static ptrdiff_t baseAddressDifference; 153 | 154 | // sets the base address difference based on an obtained pointer 155 | inline void set_base(uintptr_t address) 156 | { 157 | #ifdef _M_IX86 158 | uintptr_t addressDiff = (address - 0x400000); 159 | #elif defined(_M_AMD64) 160 | uintptr_t addressDiff = (address - 0x140000000); 161 | #endif 162 | 163 | // pointer-style cast to ensure unsigned overflow ends up copied directly into a signed value 164 | baseAddressDifference = *(ptrdiff_t*)&addressDiff; 165 | } 166 | 167 | // gets the main base of the process 168 | uintptr_t get_base(); 169 | DWORD get_size(); 170 | // gets the main base of the process with Offset 171 | uintptr_t get_base_offsetted(DWORD offset); 172 | 173 | // gets a multilayer pointer address 174 | uintptr_t get_multilayer_pointer(uintptr_t base_address, std::vector offsets); 175 | 176 | // sets the base to the process main base 177 | inline void set_base() 178 | { 179 | set_base((uintptr_t)GetModuleHandle(NULL)); 180 | } 181 | 182 | // adjusts the address passed to the base as set above 183 | template 184 | inline void adjust_base(T& address) 185 | { 186 | *(uintptr_t*)&address += baseAddressDifference; 187 | } 188 | 189 | // returns the adjusted address to the stated base 190 | template 191 | inline uintptr_t get_adjusted(T address) 192 | { 193 | return (uintptr_t)address + baseAddressDifference; 194 | } 195 | 196 | template 197 | inline void put(AddressType address, ValueType value) 198 | { 199 | adjust_base(address); 200 | 201 | memcpy((void*)address, &value, sizeof(value)); 202 | } 203 | 204 | template 205 | inline void putVP(AddressType address, ValueType value) 206 | { 207 | adjust_base(address); 208 | 209 | DWORD oldProtect; 210 | VirtualProtect((void*)address, sizeof(value), PAGE_EXECUTE_READWRITE, &oldProtect); 211 | 212 | memcpy((void*)address, &value, sizeof(value)); 213 | 214 | VirtualProtect((void*)address, sizeof(value), oldProtect, &oldProtect); 215 | } 216 | 217 | template 218 | inline void nop(AddressType address, size_t length) 219 | { 220 | adjust_base(address); 221 | 222 | memset((void*)address, 0x90, length); 223 | } 224 | 225 | template 226 | inline void return_function(AddressType address, uint16_t stackSize = 0) 227 | { 228 | if (stackSize == 0) 229 | { 230 | put(address, 0xC3); 231 | } 232 | else 233 | { 234 | put(address, 0xC2); 235 | put((uintptr_t)address + 1, stackSize); 236 | } 237 | } 238 | 239 | template 240 | inline T* getRVA(uintptr_t rva) 241 | { 242 | #ifdef _M_IX86 243 | return (T*)(baseAddressDifference + 0x400000 + rva); 244 | #elif defined(_M_AMD64) 245 | return (T*)(0x140000000 + rva); 246 | #endif 247 | } 248 | 249 | template 250 | inline void jump(AT address, T func) 251 | { 252 | put(address, 0xE9); 253 | put((uintptr_t)address + 1, (intptr_t)func - (intptr_t)get_adjusted(address) - 5); 254 | } 255 | 256 | template 257 | inline void call(AT address, T func) 258 | { 259 | put(address, 0xE8); 260 | put((uintptr_t)address + 1, (intptr_t)func - (intptr_t)get_adjusted(address) - 5); 261 | } 262 | 263 | template 264 | inline T get_call(T address) 265 | { 266 | intptr_t target = *(uintptr_t*)(get_adjusted(address) + 1); 267 | target += (get_adjusted(address) + 5); 268 | 269 | return (T)target; 270 | } 271 | 272 | template 273 | inline void set_call(TTarget* target, T address) 274 | { 275 | *(T*)target = get_call(address); 276 | } 277 | 278 | namespace vp 279 | { 280 | template 281 | inline void jump(AT address, T func) 282 | { 283 | putVP(address, 0xE9); 284 | putVP((uintptr_t)address + 1, (intptr_t)func - (intptr_t)get_adjusted(address) - 5); 285 | } 286 | 287 | template 288 | inline void call(AT address, T func) 289 | { 290 | putVP(address, 0xE8); 291 | putVP((uintptr_t)address + 1, (intptr_t)func - (intptr_t)get_adjusted(address) - 5); 292 | } 293 | } 294 | 295 | std::vector get_string_addresses(std::string str); 296 | 297 | template 298 | T get_value(std::vector offsets) { 299 | 300 | uintptr_t Addr = get_multilayer_pointer(hooks.m_world_pointer, offsets); 301 | if (Addr == NULL) { 302 | return NULL; 303 | } 304 | 305 | return *((T*)Addr); 306 | } 307 | 308 | template 309 | void set_value(std::vector offsets, T value) { 310 | uintptr_t Addr = get_multilayer_pointer(hooks.m_world_pointer, offsets); 311 | if (Addr == NULL) { 312 | return; 313 | } 314 | 315 | *reinterpret_cast(Addr) = value; 316 | } 317 | 318 | } 319 | 320 | 321 | #endif // __MEMORY_H__ -------------------------------------------------------------------------------- /Source/SudoMod.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | x64 7 | 8 | 9 | Release 10 | x64 11 | 12 | 13 | 14 | {618A4253-6C78-433C-93B5-8C71F873FAD3} 15 | Win32Proj 16 | SudoMod 17 | 10.0.17763.0 18 | SudoMod 19 | 20 | 21 | 22 | DynamicLibrary 23 | true 24 | v141 25 | Unicode 26 | 27 | 28 | DynamicLibrary 29 | false 30 | v141 31 | true 32 | Unicode 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | $(SolutionDir)Build\$(Configuration)\ 48 | $(SolutionDir)Build\Intermediate\$(Configuration)\ 49 | true 50 | .dll 51 | 52 | 53 | $(SolutionDir)Build\$(Configuration)\ 54 | $(SolutionDir)Build\Intermediate\$(Configuration)\ 55 | false 56 | $(ProjectName) 57 | .dll 58 | 59 | 60 | 61 | NotUsing 62 | Level3 63 | Disabled 64 | _DEBUG;_WINDOWS;_USRDLL;WIN32_EXPORTS;%(PreprocessorDefinitions) 65 | $(ProjectDir)MinHook\include;%(AdditionalIncludeDirectories) 66 | stdcpp17 67 | 68 | 69 | Windows 70 | true 71 | $(ProjectDir)MinHook\lib;%(AdditionalLibraryDirectories) 72 | libMinHook-x64-v141-md.lib;%(AdditionalDependencies) 73 | 74 | 75 | 76 | 77 | Level3 78 | NotUsing 79 | MaxSpeed 80 | true 81 | true 82 | NDEBUG;_WINDOWS;_USRDLL;WIN32_EXPORTS;%(PreprocessorDefinitions) 83 | $(ProjectDir)MinHook\include;%(AdditionalIncludeDirectories) 84 | stdcpp17 85 | 86 | 87 | Windows 88 | true 89 | true 90 | true 91 | $(ProjectDir)MinHook\lib;%(AdditionalLibraryDirectories) 92 | libMinHook-x64-v141-md.lib;%(AdditionalDependencies) 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | false 124 | 125 | 126 | false 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | Create 146 | Create 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | -------------------------------------------------------------------------------- /Source/nativeCaller.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | template 4 | static inline void nativePush(T val) 5 | { 6 | UINT64 val64 = 0; 7 | if (sizeof(T) > sizeof(UINT64)) 8 | { 9 | throw "error, value size > 64 bit"; 10 | } 11 | *reinterpret_cast(&val64) = val; // &val + sizeof(dw) - sizeof(val) 12 | nativePush64(val64); 13 | } 14 | 15 | template 16 | static inline R invoke(UINT64 hash) 17 | { 18 | nativeInit(hash); 19 | return *reinterpret_cast(nativeCall()); 20 | } 21 | 22 | template 23 | static inline R invoke(UINT64 hash, T1 P1) 24 | { 25 | nativeInit(hash); 26 | 27 | nativePush(P1); 28 | 29 | return *reinterpret_cast(nativeCall()); 30 | } 31 | 32 | template 33 | static inline R invoke(UINT64 hash, T1 P1, T2 P2) 34 | { 35 | nativeInit(hash); 36 | 37 | nativePush(P1); 38 | nativePush(P2); 39 | 40 | return *reinterpret_cast(nativeCall()); 41 | } 42 | 43 | template 44 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3) 45 | { 46 | nativeInit(hash); 47 | 48 | nativePush(P1); 49 | nativePush(P2); 50 | nativePush(P3); 51 | 52 | return *reinterpret_cast(nativeCall()); 53 | } 54 | 55 | template 56 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4) 57 | { 58 | nativeInit(hash); 59 | 60 | nativePush(P1); 61 | nativePush(P2); 62 | nativePush(P3); 63 | nativePush(P4); 64 | 65 | return *reinterpret_cast(nativeCall()); 66 | } 67 | 68 | template 69 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5) 70 | { 71 | nativeInit(hash); 72 | 73 | nativePush(P1); 74 | nativePush(P2); 75 | nativePush(P3); 76 | nativePush(P4); 77 | nativePush(P5); 78 | 79 | return *reinterpret_cast(nativeCall()); 80 | } 81 | 82 | template 83 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6) 84 | { 85 | nativeInit(hash); 86 | 87 | nativePush(P1); 88 | nativePush(P2); 89 | nativePush(P3); 90 | nativePush(P4); 91 | nativePush(P5); 92 | nativePush(P6); 93 | 94 | return *reinterpret_cast(nativeCall()); 95 | } 96 | 97 | template 98 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6, T7 P7) 99 | { 100 | nativeInit(hash); 101 | 102 | nativePush(P1); 103 | nativePush(P2); 104 | nativePush(P3); 105 | nativePush(P4); 106 | nativePush(P5); 107 | nativePush(P6); 108 | nativePush(P7); 109 | 110 | return *reinterpret_cast(nativeCall()); 111 | } 112 | 113 | template 114 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6, T7 P7, T8 P8) 115 | { 116 | nativeInit(hash); 117 | 118 | nativePush(P1); 119 | nativePush(P2); 120 | nativePush(P3); 121 | nativePush(P4); 122 | nativePush(P5); 123 | nativePush(P6); 124 | nativePush(P7); 125 | nativePush(P8); 126 | 127 | return *reinterpret_cast(nativeCall()); 128 | } 129 | 130 | template 131 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6, T7 P7, T8 P8, T9 P9) 132 | { 133 | nativeInit(hash); 134 | 135 | nativePush(P1); 136 | nativePush(P2); 137 | nativePush(P3); 138 | nativePush(P4); 139 | nativePush(P5); 140 | nativePush(P6); 141 | nativePush(P7); 142 | nativePush(P8); 143 | nativePush(P9); 144 | 145 | return *reinterpret_cast(nativeCall()); 146 | } 147 | 148 | template 149 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6, T7 P7, T8 P8, T9 P9, T10 P10) 150 | { 151 | nativeInit(hash); 152 | 153 | nativePush(P1); 154 | nativePush(P2); 155 | nativePush(P3); 156 | nativePush(P4); 157 | nativePush(P5); 158 | nativePush(P6); 159 | nativePush(P7); 160 | nativePush(P8); 161 | nativePush(P9); 162 | nativePush(P10); 163 | 164 | return *reinterpret_cast(nativeCall()); 165 | } 166 | 167 | template 168 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6, T7 P7, T8 P8, T9 P9, T10 P10, T11 P11) 169 | { 170 | nativeInit(hash); 171 | 172 | nativePush(P1); 173 | nativePush(P2); 174 | nativePush(P3); 175 | nativePush(P4); 176 | nativePush(P5); 177 | nativePush(P6); 178 | nativePush(P7); 179 | nativePush(P8); 180 | nativePush(P9); 181 | nativePush(P10); 182 | nativePush(P11); 183 | 184 | return *reinterpret_cast(nativeCall()); 185 | } 186 | 187 | template 188 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6, T7 P7, T8 P8, T9 P9, T10 P10, T11 P11, T12 P12) 189 | { 190 | nativeInit(hash); 191 | 192 | nativePush(P1); 193 | nativePush(P2); 194 | nativePush(P3); 195 | nativePush(P4); 196 | nativePush(P5); 197 | nativePush(P6); 198 | nativePush(P7); 199 | nativePush(P8); 200 | nativePush(P9); 201 | nativePush(P10); 202 | nativePush(P11); 203 | nativePush(P12); 204 | 205 | return *reinterpret_cast(nativeCall()); 206 | } 207 | 208 | template 209 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6, T7 P7, T8 P8, T9 P9, T10 P10, T11 P11, T12 P12, T13 P13) 210 | { 211 | nativeInit(hash); 212 | 213 | nativePush(P1); 214 | nativePush(P2); 215 | nativePush(P3); 216 | nativePush(P4); 217 | nativePush(P5); 218 | nativePush(P6); 219 | nativePush(P7); 220 | nativePush(P8); 221 | nativePush(P9); 222 | nativePush(P10); 223 | nativePush(P11); 224 | nativePush(P12); 225 | nativePush(P13); 226 | 227 | return *reinterpret_cast(nativeCall()); 228 | } 229 | 230 | template 231 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6, T7 P7, T8 P8, T9 P9, T10 P10, T11 P11, T12 P12, T13 P13, T14 P14) 232 | { 233 | nativeInit(hash); 234 | 235 | nativePush(P1); 236 | nativePush(P2); 237 | nativePush(P3); 238 | nativePush(P4); 239 | nativePush(P5); 240 | nativePush(P6); 241 | nativePush(P7); 242 | nativePush(P8); 243 | nativePush(P9); 244 | nativePush(P10); 245 | nativePush(P11); 246 | nativePush(P12); 247 | nativePush(P13); 248 | nativePush(P14); 249 | 250 | return *reinterpret_cast(nativeCall()); 251 | } 252 | 253 | template 254 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6, T7 P7, T8 P8, T9 P9, T10 P10, T11 P11, T12 P12, T13 P13, T14 P14, T15 P15) 255 | { 256 | nativeInit(hash); 257 | 258 | nativePush(P1); 259 | nativePush(P2); 260 | nativePush(P3); 261 | nativePush(P4); 262 | nativePush(P5); 263 | nativePush(P6); 264 | nativePush(P7); 265 | nativePush(P8); 266 | nativePush(P9); 267 | nativePush(P10); 268 | nativePush(P11); 269 | nativePush(P12); 270 | nativePush(P13); 271 | nativePush(P14); 272 | nativePush(P15); 273 | 274 | return *reinterpret_cast(nativeCall()); 275 | } 276 | 277 | template 278 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6, T7 P7, T8 P8, T9 P9, T10 P10, T11 P11, T12 P12, T13 P13, T14 P14, T15 P15, T16 P16) 279 | { 280 | nativeInit(hash); 281 | 282 | nativePush(P1); 283 | nativePush(P2); 284 | nativePush(P3); 285 | nativePush(P4); 286 | nativePush(P5); 287 | nativePush(P6); 288 | nativePush(P7); 289 | nativePush(P8); 290 | nativePush(P9); 291 | nativePush(P10); 292 | nativePush(P11); 293 | nativePush(P12); 294 | nativePush(P13); 295 | nativePush(P14); 296 | nativePush(P15); 297 | nativePush(P16); 298 | 299 | return *reinterpret_cast(nativeCall()); 300 | } 301 | 302 | template 303 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6, T7 P7, T8 P8, T9 P9, T10 P10, T11 P11, T12 P12, T13 P13, T14 P14, T15 P15, T16 P16, T17 P17) 304 | { 305 | nativeInit(hash); 306 | 307 | nativePush(P1); 308 | nativePush(P2); 309 | nativePush(P3); 310 | nativePush(P4); 311 | nativePush(P5); 312 | nativePush(P6); 313 | nativePush(P7); 314 | nativePush(P8); 315 | nativePush(P9); 316 | nativePush(P10); 317 | nativePush(P11); 318 | nativePush(P12); 319 | nativePush(P13); 320 | nativePush(P14); 321 | nativePush(P15); 322 | nativePush(P16); 323 | nativePush(P17); 324 | 325 | return *reinterpret_cast(nativeCall()); 326 | } 327 | 328 | template 329 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6, T7 P7, T8 P8, T9 P9, T10 P10, T11 P11, T12 P12, T13 P13, T14 P14, T15 P15, T16 P16, T17 P17, T18 P18) 330 | { 331 | nativeInit(hash); 332 | 333 | nativePush(P1); 334 | nativePush(P2); 335 | nativePush(P3); 336 | nativePush(P4); 337 | nativePush(P5); 338 | nativePush(P6); 339 | nativePush(P7); 340 | nativePush(P8); 341 | nativePush(P9); 342 | nativePush(P10); 343 | nativePush(P11); 344 | nativePush(P12); 345 | nativePush(P13); 346 | nativePush(P14); 347 | nativePush(P15); 348 | nativePush(P16); 349 | nativePush(P17); 350 | nativePush(P18); 351 | 352 | return *reinterpret_cast(nativeCall()); 353 | } 354 | 355 | template 356 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6, T7 P7, T8 P8, T9 P9, T10 P10, T11 P11, T12 P12, T13 P13, T14 P14, T15 P15, T16 P16, T17 P17, T18 P18, T19 P19) 357 | { 358 | nativeInit(hash); 359 | 360 | nativePush(P1); 361 | nativePush(P2); 362 | nativePush(P3); 363 | nativePush(P4); 364 | nativePush(P5); 365 | nativePush(P6); 366 | nativePush(P7); 367 | nativePush(P8); 368 | nativePush(P9); 369 | nativePush(P10); 370 | nativePush(P11); 371 | nativePush(P12); 372 | nativePush(P13); 373 | nativePush(P14); 374 | nativePush(P15); 375 | nativePush(P16); 376 | nativePush(P17); 377 | nativePush(P18); 378 | nativePush(P19); 379 | 380 | return *reinterpret_cast(nativeCall()); 381 | } 382 | 383 | template 384 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6, T7 P7, T8 P8, T9 P9, T10 P10, T11 P11, T12 P12, T13 P13, T14 P14, T15 P15, T16 P16, T17 P17, T18 P18, T19 P19, T20 P20) 385 | { 386 | nativeInit(hash); 387 | 388 | nativePush(P1); 389 | nativePush(P2); 390 | nativePush(P3); 391 | nativePush(P4); 392 | nativePush(P5); 393 | nativePush(P6); 394 | nativePush(P7); 395 | nativePush(P8); 396 | nativePush(P9); 397 | nativePush(P10); 398 | nativePush(P11); 399 | nativePush(P12); 400 | nativePush(P13); 401 | nativePush(P14); 402 | nativePush(P15); 403 | nativePush(P16); 404 | nativePush(P17); 405 | nativePush(P18); 406 | nativePush(P19); 407 | nativePush(P20); 408 | 409 | return *reinterpret_cast(nativeCall()); 410 | } 411 | 412 | template 413 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6, T7 P7, T8 P8, T9 P9, T10 P10, T11 P11, T12 P12, T13 P13, T14 P14, T15 P15, T16 P16, T17 P17, T18 P18, T19 P19, T20 P20, T21 P21) 414 | { 415 | nativeInit(hash); 416 | 417 | nativePush(P1); 418 | nativePush(P2); 419 | nativePush(P3); 420 | nativePush(P4); 421 | nativePush(P5); 422 | nativePush(P6); 423 | nativePush(P7); 424 | nativePush(P8); 425 | nativePush(P9); 426 | nativePush(P10); 427 | nativePush(P11); 428 | nativePush(P12); 429 | nativePush(P13); 430 | nativePush(P14); 431 | nativePush(P15); 432 | nativePush(P16); 433 | nativePush(P17); 434 | nativePush(P18); 435 | nativePush(P19); 436 | nativePush(P20); 437 | nativePush(P21); 438 | 439 | return *reinterpret_cast(nativeCall()); 440 | } 441 | 442 | template 443 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6, T7 P7, T8 P8, T9 P9, T10 P10, T11 P11, T12 P12, T13 P13, T14 P14, T15 P15, T16 P16, T17 P17, T18 P18, T19 P19, T20 P20, T21 P21, T22 P22) 444 | { 445 | nativeInit(hash); 446 | 447 | nativePush(P1); 448 | nativePush(P2); 449 | nativePush(P3); 450 | nativePush(P4); 451 | nativePush(P5); 452 | nativePush(P6); 453 | nativePush(P7); 454 | nativePush(P8); 455 | nativePush(P9); 456 | nativePush(P10); 457 | nativePush(P11); 458 | nativePush(P12); 459 | nativePush(P13); 460 | nativePush(P14); 461 | nativePush(P15); 462 | nativePush(P16); 463 | nativePush(P17); 464 | nativePush(P18); 465 | nativePush(P19); 466 | nativePush(P20); 467 | nativePush(P21); 468 | nativePush(P22); 469 | 470 | return *reinterpret_cast(nativeCall()); 471 | } 472 | 473 | template 474 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6, T7 P7, T8 P8, T9 P9, T10 P10, T11 P11, T12 P12, T13 P13, T14 P14, T15 P15, T16 P16, T17 P17, T18 P18, T19 P19, T20 P20, T21 P21, T22 P22, T23 P23) 475 | { 476 | nativeInit(hash); 477 | 478 | nativePush(P1); 479 | nativePush(P2); 480 | nativePush(P3); 481 | nativePush(P4); 482 | nativePush(P5); 483 | nativePush(P6); 484 | nativePush(P7); 485 | nativePush(P8); 486 | nativePush(P9); 487 | nativePush(P10); 488 | nativePush(P11); 489 | nativePush(P12); 490 | nativePush(P13); 491 | nativePush(P14); 492 | nativePush(P15); 493 | nativePush(P16); 494 | nativePush(P17); 495 | nativePush(P18); 496 | nativePush(P19); 497 | nativePush(P20); 498 | nativePush(P21); 499 | nativePush(P22); 500 | nativePush(P23); 501 | 502 | return *reinterpret_cast(nativeCall()); 503 | } 504 | 505 | template 506 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6, T7 P7, T8 P8, T9 P9, T10 P10, T11 P11, T12 P12, T13 P13, T14 P14, T15 P15, T16 P16, T17 P17, T18 P18, T19 P19, T20 P20, T21 P21, T22 P22, T23 P23, T24 P24) 507 | { 508 | nativeInit(hash); 509 | 510 | nativePush(P1); 511 | nativePush(P2); 512 | nativePush(P3); 513 | nativePush(P4); 514 | nativePush(P5); 515 | nativePush(P6); 516 | nativePush(P7); 517 | nativePush(P8); 518 | nativePush(P9); 519 | nativePush(P10); 520 | nativePush(P11); 521 | nativePush(P12); 522 | nativePush(P13); 523 | nativePush(P14); 524 | nativePush(P15); 525 | nativePush(P16); 526 | nativePush(P17); 527 | nativePush(P18); 528 | nativePush(P19); 529 | nativePush(P20); 530 | nativePush(P21); 531 | nativePush(P22); 532 | nativePush(P23); 533 | nativePush(P24); 534 | 535 | return *reinterpret_cast(nativeCall()); 536 | } 537 | 538 | template 539 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6, T7 P7, T8 P8, T9 P9, T10 P10, T11 P11, T12 P12, T13 P13, T14 P14, T15 P15, T16 P16, T17 P17, T18 P18, T19 P19, T20 P20, T21 P21, T22 P22, T23 P23, T24 P24, T25 P25) 540 | { 541 | nativeInit(hash); 542 | 543 | nativePush(P1); 544 | nativePush(P2); 545 | nativePush(P3); 546 | nativePush(P4); 547 | nativePush(P5); 548 | nativePush(P6); 549 | nativePush(P7); 550 | nativePush(P8); 551 | nativePush(P9); 552 | nativePush(P10); 553 | nativePush(P11); 554 | nativePush(P12); 555 | nativePush(P13); 556 | nativePush(P14); 557 | nativePush(P15); 558 | nativePush(P16); 559 | nativePush(P17); 560 | nativePush(P18); 561 | nativePush(P19); 562 | nativePush(P20); 563 | nativePush(P21); 564 | nativePush(P22); 565 | nativePush(P23); 566 | nativePush(P24); 567 | nativePush(P25); 568 | 569 | return *reinterpret_cast(nativeCall()); 570 | } -------------------------------------------------------------------------------- /Source/Hooking.cpp: -------------------------------------------------------------------------------- 1 | //Hooking.cpp 2 | #pragma once 3 | #include "stdafx.h" 4 | 5 | 6 | using namespace Memory; 7 | 8 | ScriptThread* (*GetActiveThread)() = nullptr; 9 | HMODULE _hmoduleDLL; 10 | HANDLE mainFiber; 11 | DWORD wakeAt; 12 | 13 | std::vector Hooking::m_hooks; 14 | uint64_t* Hooking::m_framecount; 15 | GetNumberOfEvents* Hooking::m_get_number_of_events; 16 | GetLabelText* Hooking::m_get_label_text; 17 | GetEventData* Hooking::m_get_event_data; 18 | RegisterFile* Hooking::m_register_file; 19 | TriggerScriptEvent* Hooking::m_trigger_script_event; 20 | PVOID Hooking::m_model_spawn_bypass; 21 | void* Hooking::m_native_return; 22 | eGameState* Hooking::m_gamestate; 23 | uint64_t Hooking::m_world_pointer; 24 | __int64** Hooking::m_global_pointer; 25 | static Hooking::NativeRegistrationNew** m_registrationTable; 26 | static std::unordered_map m_handlerCache; 27 | static std::vector m_hookedNative; 28 | 29 | const int EVENT_COUNT = 78; 30 | static std::vector EventPtr; 31 | static char EventRestore[EVENT_COUNT] = {}; 32 | 33 | 34 | /* Start Hooking */ 35 | void Hooking::Start(HMODULE hmoduleDLL) 36 | { 37 | _hmoduleDLL = hmoduleDLL; 38 | FindPatterns(); 39 | if (!InitializeHooks()) Cleanup(); 40 | } 41 | BOOL Hooking::InitializeHooks() 42 | { 43 | BOOL returnVal = TRUE; 44 | 45 | if (!iHook.Initialize()) { 46 | 47 | Log_Error("Failed to initialize InputHook"); 48 | returnVal = FALSE; 49 | } 50 | 51 | if (!HookNatives()) { 52 | 53 | Log_Error("Failed to initialize NativeHooks"); 54 | returnVal = FALSE; 55 | } 56 | 57 | return returnVal; 58 | } 59 | 60 | uint64_t CMetaData::m_begin = 0; 61 | uint64_t CMetaData::m_end = 0; 62 | DWORD CMetaData::m_size = 0; 63 | 64 | uint64_t CMetaData::begin() 65 | { 66 | return m_begin; 67 | } 68 | uint64_t CMetaData::end() 69 | { 70 | return m_end; 71 | } 72 | DWORD CMetaData::size() 73 | { 74 | return m_size; 75 | } 76 | 77 | void CMetaData::init() 78 | { 79 | if (m_begin && m_size) 80 | return; 81 | 82 | m_begin = (uint64_t)GetModuleHandleA(nullptr); 83 | const IMAGE_DOS_HEADER* headerDos = (const IMAGE_DOS_HEADER*)m_begin; 84 | const IMAGE_NT_HEADERS* headerNt = (const IMAGE_NT_HEADERS64*)((const BYTE*)headerDos + headerDos->e_lfanew); 85 | m_size = headerNt->OptionalHeader.SizeOfCode; 86 | m_end = m_begin + m_size; 87 | return; 88 | } 89 | 90 | GetNumberOfEvents* OG_GET_NUMBER_OF_EVENTS = nullptr; 91 | int32_t HK_GET_NUMBER_OF_EVENTS(int32_t unk) 92 | { 93 | static uint64_t last_frame = 0; 94 | if (last_frame != *Hooking::m_framecount) 95 | { 96 | last_frame = *Hooking::m_framecount; 97 | Hooking::onTickInit(); 98 | } 99 | return OG_GET_NUMBER_OF_EVENTS(unk); 100 | } 101 | 102 | GetLabelText* OG_GET_LABEL_TEXT = nullptr; 103 | const char* HK_GET_LABEL_TEXT(void* _this, const char* label) 104 | { 105 | if (std::strcmp(label, "HUD_JOINING") == 0) return "Isn't SudoMod the fucking best?"; 106 | if (std::strcmp(label, "HUD_TRANSP") == 0) return "Isn't SudoMod the fucking best?"; 107 | return OG_GET_LABEL_TEXT(_this, label); 108 | } 109 | 110 | GetEventData* OG_GET_EVENT_DATA = nullptr; 111 | bool HK_GET_EVENT_DATA(std::int32_t eventGroup, std::int32_t eventIndex, std::int64_t* args, std::uint32_t argCount) 112 | { 113 | auto result = OG_GET_EVENT_DATA(eventGroup, eventIndex, args, argCount); 114 | if (result && Online::event_logger) 115 | { 116 | Log_Info("==============================="); 117 | std::string evgroup = std::string("Script event group: ") + std::to_string(eventGroup).c_str(); 118 | Log_Info(_strdup(evgroup.c_str())); 119 | std::string evindex = std::string("Script event index: ") + std::to_string(eventIndex).c_str(); 120 | Log_Info(_strdup(evindex.c_str())); 121 | std::string evargcount = std::string("Script event argcount: ") + std::to_string(argCount).c_str(); 122 | Log_Info(_strdup(evargcount.c_str())); 123 | for (std::uint32_t i = 0; i < argCount; ++i) { 124 | std::string evargs = std::string("Script event args[") + std::to_string(i).c_str() + "] : " + std::to_string(args[i]).c_str(); 125 | Log_Info(_strdup(evargs.c_str())); 126 | } 127 | } 128 | if (result && Online::event_blocker) 129 | { 130 | if (args[0] == -738295409) /* CEO BAN */ 131 | { 132 | Log_Info("SudoMod || Script Event: CEO Ban"); 133 | Log_Info("SudoMod || Status: Blocked"); 134 | std::string sender = std::string("SudoMod || Sender: ") + PLAYER::GET_PLAYER_NAME(args[1]); 135 | Log_Info(_strdup(sender.c_str())); 136 | if (Online::event_karma) 137 | { 138 | Log_Info("SudoMod || Karma enabled, redirecting event."); 139 | uint64_t tseargs[3] = { -738295409, args[1], 1 }; 140 | hooks.m_trigger_script_event(1, tseargs, 3, 1 << args[1]); 141 | } 142 | } 143 | return false; 144 | } 145 | return result; 146 | } 147 | 148 | bool Hooking::HookNatives() 149 | { 150 | /* Main Hook: GNOE */ 151 | MH_STATUS status = MH_CreateHook(Hooking::m_get_number_of_events, HK_GET_NUMBER_OF_EVENTS, (void**)&OG_GET_NUMBER_OF_EVENTS); 152 | if ((status != MH_OK && status != MH_ERROR_ALREADY_CREATED) || MH_EnableHook(Hooking::m_get_number_of_events) != MH_OK) 153 | return false; 154 | Hooking::m_hooks.push_back(Hooking::m_get_number_of_events); 155 | 156 | /* Get Label Text - Used for adding custom text to game labels */ 157 | 158 | status = MH_CreateHook(Hooking::m_get_label_text, HK_GET_LABEL_TEXT, (void**)&OG_GET_LABEL_TEXT); 159 | if (status != MH_OK || MH_EnableHook(Hooking::m_get_label_text) != MH_OK) 160 | return false; 161 | Hooking::m_hooks.push_back(Hooking::m_get_label_text); 162 | 163 | /* Get Event Data - Used for Event logging or event blocking */ 164 | status = MH_CreateHook(Hooking::m_get_event_data, HK_GET_EVENT_DATA, (void**)&OG_GET_EVENT_DATA); 165 | if (status != MH_OK || MH_EnableHook(Hooking::m_get_event_data) != MH_OK) 166 | return false; 167 | Hooking::m_hooks.push_back(Hooking::m_get_event_data); 168 | 169 | return true; 170 | } 171 | 172 | void __stdcall ScriptFunction(LPVOID lpParameter) 173 | { 174 | try 175 | { 176 | ScriptMain(); 177 | 178 | } 179 | catch (...) 180 | { 181 | Log_Error("Failed scriptFiber"); 182 | } 183 | } 184 | 185 | void Hooking::onTickInit() 186 | { 187 | if (mainFiber == nullptr) 188 | mainFiber = IsThreadAFiber() ? GetCurrentFiber() : ConvertThreadToFiber(nullptr); 189 | 190 | if (timeGetTime() < wakeAt) 191 | return; 192 | 193 | static HANDLE scriptFiber; 194 | if (scriptFiber) 195 | SwitchToFiber(scriptFiber); 196 | else 197 | scriptFiber = CreateFiber(NULL, ScriptFunction, nullptr); 198 | } 199 | 200 | void Hooking::FailPatterns(const char* name) 201 | { 202 | Log_Error("Finding %s", name); 203 | Cleanup(); 204 | } 205 | 206 | /* 207 | //CPatternResult 208 | */ 209 | 210 | CPatternResult::CPatternResult(void* pVoid) : 211 | m_pVoid(pVoid) 212 | {} 213 | CPatternResult::CPatternResult(void* pVoid, void* pBegin, void* pEnd) : 214 | m_pVoid(pVoid), 215 | m_pBegin(pBegin), 216 | m_pEnd(pEnd) 217 | {} 218 | CPatternResult::~CPatternResult() {} 219 | 220 | /* 221 | //CPattern Public 222 | */ 223 | 224 | CPattern::CPattern(char* szByte, char* szMask) : 225 | m_szByte(szByte), 226 | m_szMask(szMask), 227 | m_bSet(false) 228 | {} 229 | CPattern::~CPattern() {} 230 | 231 | CPattern& CPattern::find(int i, uint64_t startAddress) 232 | { 233 | match(i, startAddress, false); 234 | if (m_result.size() <= i) 235 | m_result.push_back(nullptr); 236 | return *this; 237 | } 238 | 239 | CPattern& CPattern::virtual_find(int i, uint64_t startAddress) 240 | { 241 | match(i, startAddress, true); 242 | if (m_result.size() <= i) 243 | m_result.push_back(nullptr); 244 | return *this; 245 | } 246 | 247 | CPatternResult CPattern::get(int i) 248 | { 249 | if (m_result.size() > i) 250 | return m_result[i]; 251 | return nullptr; 252 | } 253 | 254 | /* 255 | //CPattern Private 256 | */ 257 | bool CPattern::match(int i, uint64_t startAddress, bool virt) 258 | { 259 | if (m_bSet) 260 | return false; 261 | uint64_t begin = 0; 262 | uint64_t end = 0; 263 | if (!virt) 264 | { 265 | CMetaData::init(); 266 | begin = CMetaData::begin() + startAddress; 267 | end = CMetaData::end(); 268 | if (begin >= end) 269 | return false; 270 | } 271 | int j = 0; 272 | do 273 | { 274 | if (virt) 275 | begin = virtual_find_pattern(startAddress, (BYTE*)m_szByte, m_szMask) + 1; 276 | else 277 | begin = find_pattern(begin, end, (BYTE*)m_szByte, m_szMask) + 1; 278 | if (begin == NULL) 279 | break; 280 | j++; 281 | } while (j < i); 282 | 283 | m_bSet = true; 284 | return true; 285 | } 286 | 287 | bool CPattern::byte_compare(const BYTE* pData, const BYTE* btMask, const char* szMask) 288 | { 289 | for (; *szMask; ++szMask, ++pData, ++btMask) 290 | if (*szMask == 'x' && *pData != *btMask) 291 | break; 292 | if ((*szMask) != 0) 293 | return false; 294 | return true; 295 | } 296 | 297 | 298 | uint64_t CPattern::find_pattern(uint64_t address, uint64_t end, BYTE* btMask, char* szMask) 299 | { 300 | size_t len = strlen(szMask) + 1; 301 | for (uint64_t i = 0; i < (end - address - len); i++) 302 | { 303 | BYTE* ptr = (BYTE*)(address + i); 304 | if (byte_compare(ptr, btMask, szMask)) 305 | { 306 | m_result.push_back(CPatternResult((void*)(address + i))); 307 | return address + i; 308 | } 309 | } 310 | return NULL; 311 | } 312 | 313 | uint64_t CPattern::virtual_find_pattern(uint64_t address, BYTE* btMask, char* szMask) 314 | { 315 | MEMORY_BASIC_INFORMATION mbi; 316 | char* pStart = nullptr; 317 | char* pEnd = nullptr; 318 | char* res = nullptr; 319 | size_t maskLen = strlen(szMask); 320 | 321 | while (res == nullptr && sizeof(mbi) == VirtualQuery(pEnd, &mbi, sizeof(mbi))) 322 | { 323 | pStart = pEnd; 324 | pEnd += mbi.RegionSize; 325 | if (mbi.Protect != PAGE_READWRITE || mbi.State != MEM_COMMIT) 326 | continue; 327 | 328 | for (int i = 0; pStart < pEnd - maskLen && res == nullptr; ++pStart) 329 | { 330 | if (byte_compare((BYTE*)pStart, btMask, szMask)) 331 | { 332 | m_result.push_back(CPatternResult((void*)pStart, mbi.BaseAddress, pEnd)); 333 | res = pStart; 334 | } 335 | } 336 | 337 | mbi = {}; 338 | } 339 | return (uint64_t)res; 340 | } 341 | 342 | void failPat(const char* name) 343 | { 344 | Log_Error("Failed to find %s pattern.", name); 345 | } 346 | 347 | template 348 | void setPat 349 | ( 350 | const char* name, 351 | char* pat, 352 | char* mask, 353 | T** out, 354 | bool rel, 355 | int offset = 0, 356 | int deref = 0, 357 | int skip = 0 358 | ) 359 | { 360 | T* ptr = nullptr; 361 | 362 | CPattern pattern(pat, mask); 363 | pattern.find(1 + skip); 364 | if (rel) 365 | ptr = pattern.get(skip).get_rel(offset); 366 | else 367 | ptr = pattern.get(skip).get(offset); 368 | 369 | while (true) 370 | { 371 | if (ptr == nullptr) 372 | failPat(name); 373 | 374 | if (deref <= 0) 375 | break; 376 | ptr = *(T**)ptr; 377 | --deref; 378 | } 379 | 380 | *out = ptr; 381 | return; 382 | } 383 | 384 | template 385 | void setFn 386 | ( 387 | const char* name, 388 | char* pat, 389 | char* mask, 390 | T* out, 391 | int skip = 0 392 | ) 393 | { 394 | char* ptr = nullptr; 395 | 396 | CPattern pattern(pat, mask); 397 | pattern.find(1 + skip); 398 | ptr = pattern.get(skip).get(0); 399 | 400 | if (ptr == nullptr) 401 | failPat(name); 402 | 403 | *out = (T)ptr; 404 | return; 405 | } 406 | 407 | void Hooking::FindPatterns() 408 | { 409 | char* c_location = nullptr; 410 | void* v_location = nullptr; 411 | 412 | Log_Info("[Pattern Scanner] Found and Hooked Frame Count"); 413 | c_location = Memory::pattern("F3 0F 10 0D ? ? ? ? 44 89 6B 08").count(1).get(0).get(4); 414 | c_location == nullptr ? FailPatterns("Frame Count") : Hooking::m_framecount = reinterpret_cast((c_location + *reinterpret_cast(c_location) + 4) - 8); 415 | 416 | Log_Info("[Pattern Scanner] Found and Hooked Get Number Of Events"); 417 | c_location = Memory::pattern("48 83 EC 28 33 D2 85 C9").count(1).get(0).get(0); 418 | c_location == nullptr ? FailPatterns("Get Number Of Events") : Hooking::m_get_number_of_events = reinterpret_cast(c_location); 419 | 420 | Log_Info("[Pattern Scanner] Found and Hooked Get Label Text"); 421 | c_location = Memory::pattern("48 89 5C 24 ? 57 48 83 EC 20 48 8B DA 48 8B F9 48 85 D2 75 44 E8").count(1).get(0).get(0); 422 | c_location == nullptr ? FailPatterns("Get Label Text") : Hooking::m_get_label_text = reinterpret_cast(c_location); 423 | 424 | Log_Info("[Pattern Scanner] Found and Hooked Get Event Data"); 425 | c_location = Memory::pattern("48 85 C0 74 14 4C 8B 10").count(1).get(0).get(-28); 426 | c_location == nullptr ? FailPatterns("Get Event Data") : Hooking::m_get_event_data = reinterpret_cast(c_location); 427 | 428 | Log_Info("[Pattern Scanner] Found Register File"); 429 | c_location = Memory::pattern("48 89 5C 24 ? 48 89 6C 24 ? 48 89 7C 24 ? 41 54 41 56 41 57 48 83 EC 50 48 8B EA 4C 8B FA 48 8B D9 4D 85 C9").count(1).get(0).get(0); 430 | c_location == nullptr ? FailPatterns("Register File") : Hooking::m_register_file = reinterpret_cast(c_location); 431 | 432 | Log_Info("[Pattern Scanner] Found Trigger Script Event"); 433 | c_location = Memory::pattern("48 8B C4 48 89 58 08 48 89 68 10 48 89 70 18 48 89 78 20 41 56 48 81 EC ? ? ? ? 45 8B F0 41 8B F9").count(1).get(0).get(0); 434 | c_location == nullptr ? FailPatterns("Trigger Script Event") : Hooking::m_trigger_script_event = reinterpret_cast(c_location); 435 | 436 | Log_Info("[Pattern Scanner] Found Game State"); 437 | c_location = Memory::pattern("83 3D ? ? ? ? ? 75 17 8B 42 20 25").count(1).get(0).get(2); 438 | c_location == nullptr ? FailPatterns("Game State") : Hooking::m_gamestate = reinterpret_cast(c_location + *(int32_t*)c_location + 5); 439 | 440 | Log_Info("[Pattern Scanner] Found Vector3 Function"); 441 | v_location = Memory::pattern("83 79 18 00 48 8B D1 74 4A FF 4A 18").count(1).get(0).get(0); 442 | if (v_location != nullptr) scrNativeCallContext::SetVectorResults = (void(*)(scrNativeCallContext*))(v_location); 443 | 444 | Log_Info("[Pattern Scanner] Found Native Registration Table"); 445 | c_location = Memory::pattern("76 32 48 8B 53 40 48 8D 0D").count(1).get(0).get(9); 446 | c_location == nullptr ? FailPatterns("Native Registration Table") : m_registrationTable = reinterpret_cast(c_location + *(int32_t*)c_location + 4); 447 | 448 | Log_Info("[Pattern Scanner] Found Model Spawn Bypass"); 449 | c_location = Memory::pattern("48 8B C8 FF 52 30 84 C0 74 05 48").count(1).get(0).get(8); 450 | c_location == nullptr ? FailPatterns("Model Spawn Bypass") : Hooking::m_model_spawn_bypass = reinterpret_cast(c_location); 451 | 452 | Log_Info("[Pattern Scanner] Found Native Return Adress"); 453 | c_location = Memory::pattern("FF E3").count(1).get(0).get(0); 454 | c_location == nullptr ? FailPatterns("Native Return Adress") : Hooking::m_native_return = reinterpret_cast(c_location); 455 | 456 | Log_Info("[Pattern Scanner] Found World Pointer"); 457 | c_location = Memory::pattern("48 8B 05 ? ? ? ? 45 ? ? ? ? 48 8B 48 08 48 85 C9 74 07").count(1).get(0).get(0); 458 | c_location == nullptr ? FailPatterns("World Pointer") : Hooking::m_world_pointer = reinterpret_cast(c_location) + *reinterpret_cast(reinterpret_cast(c_location) + 3) + 7; 459 | 460 | Log_Info("[Pattern Scanner] Found Active Script Thread"); 461 | c_location = Memory::pattern("E8 ? ? ? ? 48 8B 88 10 01 00 00").count(1).get(0).get(1); 462 | c_location == nullptr ? FailPatterns("Active Script Thread") : GetActiveThread = reinterpret_cast(c_location + *(int32_t*)c_location + 4); 463 | 464 | Log_Info("[Pattern Scanner] Found Global Pointer"); 465 | c_location = Memory::pattern("4C 8D 05 ? ? ? ? 4D 8B 08 4D 85 C9 74 11").count(1).get(0).get(0); 466 | __int64 patternAddr = NULL; 467 | c_location == nullptr ? FailPatterns("Global Pointer") : patternAddr = reinterpret_cast(c_location); 468 | Hooking::m_global_pointer = (__int64**)(patternAddr + *(int*)(patternAddr + 3) + 7); 469 | 470 | Log_Info("[Pattern Scanner] Found Event Hook"); 471 | if ((c_location = Memory::pattern("48 83 EC 28 E8 ? ? ? ? 48 8B 0D ? ? ? ? 4C 8D 0D ? ? ? ? 4C 8D 05 ? ? ? ? BA 03").count(1).get(0).get(0))) 472 | { 473 | int i = 0, j = 0, matches = 0, found = 0; 474 | char* pattern = "\x4C\x8D\x05"; 475 | while (found != EVENT_COUNT) 476 | { 477 | if (c_location[i] == pattern[j]) 478 | { 479 | if (++matches == 3) 480 | { 481 | EventPtr.push_back((void*)(reinterpret_cast(c_location + i - j) + *reinterpret_cast(c_location + i + 1) + 7)); 482 | found++; 483 | j = matches = 0; 484 | } 485 | j++; 486 | } 487 | else 488 | { 489 | matches = j = 0; 490 | } 491 | i++; 492 | } 493 | } 494 | 495 | Log_Info("[Hooking] Loading CrossMap"); 496 | CrossMapping::initNativeMap(); 497 | 498 | while (*Hooking::m_gamestate != GameStatePlaying) { // Game State Check 499 | Sleep(200); 500 | } 501 | } 502 | 503 | static Hooking::NativeHandler _Handler(uint64_t origHash) 504 | { 505 | uint64_t newHash = CrossMapping::MapNative(origHash); 506 | if (newHash == 0) 507 | { 508 | return nullptr; 509 | } 510 | 511 | Hooking::NativeRegistrationNew* table = m_registrationTable[newHash & 0xFF]; 512 | 513 | for (; table; table = table->getNextRegistration()) 514 | { 515 | for (uint32_t i = 0; i < table->getNumEntries(); i++) 516 | { 517 | if (newHash == table->getHash(i)) 518 | { 519 | return table->handlers[i]; 520 | } 521 | } 522 | } 523 | return nullptr; 524 | } 525 | 526 | Hooking::NativeHandler Hooking::GetNativeHandler(uint64_t origHash) 527 | { 528 | auto& handler = m_handlerCache[origHash]; 529 | 530 | if (handler == nullptr) 531 | { 532 | handler = _Handler(origHash); 533 | } 534 | 535 | return handler; 536 | } 537 | 538 | void WAIT(DWORD ms) 539 | { 540 | wakeAt = timeGetTime() + ms; 541 | SwitchToFiber(mainFiber); 542 | } 543 | 544 | void __declspec(noreturn) Hooking::Cleanup() 545 | { 546 | iHook.Remove(); 547 | 548 | Log_Info("Cleaning up hooks"); 549 | for (auto func : m_hooks) 550 | { 551 | MH_STATUS status; 552 | if ((status = MH_DisableHook(func)) == MH_OK) 553 | { 554 | Log_Info("Successfully disabled hook %p", func); 555 | } 556 | else 557 | { 558 | Log_Info("Failed to disable hook %p (%s)", func, MH_StatusToString(status)); 559 | } 560 | } 561 | 562 | std::this_thread::sleep_for(std::chrono::milliseconds(500)); 563 | 564 | for (auto func : m_hooks) 565 | { 566 | MH_STATUS status; 567 | if ((status = MH_RemoveHook(func)) == MH_OK) 568 | { 569 | Log_Info("Successfully removed hook %p", func); 570 | } 571 | else 572 | { 573 | Log_Info("Failed to remove hook %p (%s)", func, MH_StatusToString(status)); 574 | } 575 | } 576 | 577 | fclose(stdout); 578 | FreeConsole(); 579 | FreeLibraryAndExitThread(static_cast(_hmoduleDLL), 0); 580 | } 581 | 582 | void Hooking::defuseEvent(RockstarEvent e, bool toggle) 583 | { 584 | static const unsigned char retn = 0xC3; 585 | char* p = (char*)EventPtr[e]; 586 | if (toggle) 587 | { 588 | if (EventRestore[e] == 0) 589 | EventRestore[e] = p[0]; 590 | *p = retn; 591 | } 592 | else 593 | { 594 | if (EventRestore[e] != 0) 595 | *p = EventRestore[e]; 596 | } 597 | } 598 | 599 | MinHookKeepalive::MinHookKeepalive() 600 | { 601 | MH_Initialize(); 602 | } 603 | 604 | MinHookKeepalive::~MinHookKeepalive() 605 | { 606 | MH_Uninitialize(); 607 | } 608 | 609 | MinHookKeepalive g_MinHookKeepalive; 610 | -------------------------------------------------------------------------------- /Source/UserInterface.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | namespace Menu 4 | { 5 | void Menu::Drawing::Text(const char* text, RGBAF rgbaf, VECTOR2 position, VECTOR2_2 size, bool center) 6 | { 7 | HUD::SET_TEXT_SCALE(size.w, size.h); 8 | HUD::SET_TEXT_FONT(rgbaf.f); 9 | HUD::SET_TEXT_COLOUR(rgbaf.r, rgbaf.g, rgbaf.b, rgbaf.a); 10 | HUD::SET_TEXT_CENTRE(center); 11 | HUD::BEGIN_TEXT_COMMAND_DISPLAY_TEXT("STRING"); 12 | HUD::ADD_TEXT_COMPONENT_SUBSTRING_PLAYER_NAME(text); 13 | HUD::END_TEXT_COMMAND_DISPLAY_TEXT(position.x, position.y, NULL); 14 | 15 | } 16 | void Menu::Drawing::Sprite(std::string Streamedtexture, std::string textureName, float x, float y, float width, float height, float rotation, int r, int g, int b, int a) 17 | { 18 | if (!GRAPHICS::HAS_STREAMED_TEXTURE_DICT_LOADED((char*)Streamedtexture.c_str())) 19 | { 20 | GRAPHICS::REQUEST_STREAMED_TEXTURE_DICT((char*)Streamedtexture.c_str(), false); 21 | } 22 | else 23 | { 24 | GRAPHICS::DRAW_SPRITE((char*)Streamedtexture.c_str(), (char*)textureName.c_str(), x, y, width, height, rotation, r, g, b, a, NULL); 25 | } 26 | } 27 | 28 | void Menu::Drawing::Rect(RGBA rgba, VECTOR2 position, VECTOR2_2 size) 29 | { 30 | GRAPHICS::DRAW_RECT(position.x, position.y, size.w, size.h, rgba.r, rgba.g, rgba.b, rgba.a, NULL); 31 | } 32 | 33 | void UserInterface::Title(const char* title) 34 | { 35 | if (gui.textureID != 0) // If no YTD found, it will draw text and a rect itself. 36 | { 37 | draw.Sprite("SudoMod", "EpicHeader", menuX, 0.0750f, menuWidth, 0.1f, 0, 255, 255, 255, 255); /* https://www.unknowncheats.me/forum/3158178-post18.html */ 38 | } 39 | else 40 | { 41 | draw.Text("SudoMod", titletext, { menuX, 0.055f }, { 0.85f, 0.85f }, true); 42 | draw.Rect(titlerect, { menuX, 0.0750f }, { menuWidth, 0.1f }); 43 | } 44 | 45 | // SubmenuBar 46 | draw.Rect({ 0, 0, 0, 255 }, { menuX, (optionCount + 1) * 0.035f + 0.1065f }, { menuWidth, 0.035f }); 47 | draw.Text(title, { 255, 255, 255, 255, 6 }, { menuX, (optionCount) * 0.035f + 0.127f }, { 0.4f, 0.4f }, true); 48 | 49 | // Disable Controls 50 | HUD::HIDE_HELP_TEXT_THIS_FRAME(); 51 | CAM::SET_CINEMATIC_BUTTON_ACTIVE(0); 52 | HUD::HIDE_HUD_COMPONENT_THIS_FRAME(10); 53 | HUD::HIDE_HUD_COMPONENT_THIS_FRAME(6); 54 | HUD::HIDE_HUD_COMPONENT_THIS_FRAME(7); 55 | HUD::HIDE_HUD_COMPONENT_THIS_FRAME(9); 56 | HUD::HIDE_HUD_COMPONENT_THIS_FRAME(8); 57 | PAD::DISABLE_CONTROL_ACTION(2, INPUT_NEXT_CAMERA, true); 58 | PAD::DISABLE_CONTROL_ACTION(2, INPUT_CHARACTER_WHEEL, true); 59 | PAD::DISABLE_CONTROL_ACTION(2, INPUT_MELEE_ATTACK_LIGHT, true); 60 | PAD::DISABLE_CONTROL_ACTION(2, INPUT_MELEE_ATTACK_HEAVY, true); 61 | PAD::DISABLE_CONTROL_ACTION(2, INPUT_MULTIPLAYER_INFO, true); 62 | PAD::DISABLE_CONTROL_ACTION(2, INPUT_PHONE, true); 63 | PAD::DISABLE_CONTROL_ACTION(2, INPUT_MELEE_ATTACK_ALTERNATE, true); 64 | PAD::DISABLE_CONTROL_ACTION(2, INPUT_VEH_CIN_CAM, true); 65 | PAD::DISABLE_CONTROL_ACTION(2, INPUT_MAP_POI, true); 66 | PAD::DISABLE_CONTROL_ACTION(2, INPUT_PHONE, true); 67 | PAD::DISABLE_CONTROL_ACTION(2, INPUT_VEH_RADIO_WHEEL, true); 68 | PAD::DISABLE_CONTROL_ACTION(2, INPUT_VEH_HEADLIGHT, true); 69 | } 70 | 71 | bool UserInterface::Option(const char* option) 72 | { 73 | optionCount++; 74 | bool onThis = currentOption == optionCount ? true : false; 75 | if (currentOption <= maxVisOptions && optionCount <= maxVisOptions) 76 | { 77 | draw.Rect(optionrect, { menuX, (optionCount) * 0.035f + 0.1415f }, { menuWidth, 0.035f }); 78 | draw.Text(option, optiontext, { menuX - 0.1f, (optionCount) * 0.035f + 0.125f }, { 0.45f, 0.45f }, false); 79 | onThis ? draw.Rect(scroller, { menuX, (optionCount) * 0.035f + 0.1415f }, { menuWidth, 0.035f }) : NULL; 80 | } 81 | else if (optionCount > (currentOption - maxVisOptions) && optionCount <= currentOption) 82 | { 83 | draw.Rect(optionrect, { menuX, (optionCount - (currentOption - maxVisOptions)) * 0.035f + 0.1415f }, { menuWidth, 0.035f }); 84 | draw.Text(option, optiontext, { menuX - 0.1f, (optionCount - (currentOption - maxVisOptions)) * 0.035f + 0.125f }, { 0.45f, 0.45f }, false); 85 | onThis ? draw.Rect(scroller, { menuX, (optionCount - (currentOption - maxVisOptions)) * 0.035f + 0.1415f }, { menuWidth, 0.035f }) : NULL; 86 | } 87 | if (currentOption == optionCount) 88 | { 89 | if (selectPressed) 90 | { 91 | return true; 92 | } 93 | } 94 | return false; 95 | } 96 | bool UserInterface::Option(const char* option, std::function function) 97 | { 98 | Option(option); 99 | 100 | if (optionCount == currentOption && selectPressed) { 101 | function(); 102 | return true; 103 | } 104 | return false; 105 | } 106 | 107 | bool UserInterface::SubMenu(const char* option, SubMenus newSub) 108 | { 109 | Option(option); 110 | 111 | if (currentOption <= maxVisOptions && optionCount <= maxVisOptions) 112 | draw.Text(">>", optiontext, { menuX + 0.068f, optionCount * 0.035f + 0.125f }, { 0.5f, 0.5f }, true); 113 | else if (optionCount > currentOption - maxVisOptions && optionCount <= currentOption) 114 | draw.Text(">>", optiontext, { menuX + 0.068f, (optionCount - (currentOption - maxVisOptions)) * 0.035f + 0.12f }, { 0.5f, 0.5f }, true); 115 | 116 | if (optionCount == currentOption && selectPressed) { 117 | MoveMenu(newSub); 118 | return true; 119 | } 120 | return false; 121 | } 122 | 123 | bool UserInterface::SubMenu(const char* option, SubMenus newSub, std::function function) 124 | { 125 | SubMenu(option, newSub); 126 | 127 | if (optionCount == currentOption && selectPressed) { 128 | function(); 129 | return true; 130 | } 131 | return false; 132 | } 133 | 134 | bool UserInterface::Bool(const char* option, bool& b00l) 135 | { 136 | Option(option); 137 | 138 | if (currentOption <= maxVisOptions && optionCount <= maxVisOptions) 139 | draw.Text(b00l ? "~g~ON" : "~r~OFF", optiontext, { menuX + 0.068f, optionCount * 0.035f + 0.125f }, { 0.5f, 0.5f }, true); 140 | else if (optionCount > currentOption - maxVisOptions && optionCount <= currentOption) 141 | draw.Text(b00l ? "~g~ON" : "~r~OFF", optiontext, { menuX + 0.068f, (optionCount - (currentOption - maxVisOptions)) * 0.035f + 0.12f }, { 0.5f, 0.5f }, true); 142 | 143 | if (optionCount == currentOption && selectPressed) { 144 | b00l ^= 1; 145 | return true; 146 | } 147 | return false; 148 | } 149 | 150 | bool UserInterface::Int(const char* option, int& _int, int min, int max) 151 | { 152 | Option(option); 153 | 154 | if (optionCount == currentOption) { 155 | if (leftPressed) { 156 | _int >= min ? _int-- : _int = max; 157 | } 158 | if (rightPressed) { 159 | _int < max ? _int++ : _int = min; 160 | } 161 | } 162 | 163 | if (currentOption <= maxVisOptions && optionCount <= maxVisOptions) 164 | draw.Text(StringToChar(std::to_string(_int)), optiontext, { menuX + 0.068f, optionCount * 0.035f + 0.125f }, { 0.5f, 0.5f }, true); 165 | else if (optionCount > currentOption - maxVisOptions && optionCount <= currentOption) 166 | draw.Text(StringToChar(std::to_string(_int)), optiontext, { menuX + 0.068f, (optionCount - (currentOption - maxVisOptions)) * 0.035f + 0.12f }, { 0.5f, 0.5f }, true); 167 | 168 | if (optionCount == currentOption && selectPressed) return true; 169 | else if (optionCount == currentOption && leftPressed) return true; 170 | else if (optionCount == currentOption && rightPressed) return true; 171 | return false; 172 | } 173 | 174 | bool UserInterface::Int(const char* option, int& _int, int min, int max, int step) 175 | { 176 | Option(option); 177 | 178 | if (optionCount == currentOption) { 179 | if (leftPressed) { 180 | _int >= min ? _int -= step : _int = max; 181 | } 182 | if (rightPressed) { 183 | _int < max ? _int += step : _int = min; 184 | } 185 | } 186 | 187 | if (currentOption <= maxVisOptions && optionCount <= maxVisOptions) 188 | draw.Text(StringToChar(std::to_string(_int)), optiontext, { menuX + 0.068f, optionCount * 0.035f + 0.125f }, { 0.5f, 0.5f }, true); 189 | else if (optionCount > currentOption - maxVisOptions && optionCount <= currentOption) 190 | draw.Text(StringToChar(std::to_string(_int)), optiontext, { menuX + 0.068f, (optionCount - (currentOption - maxVisOptions)) * 0.035f + 0.12f }, { 0.5f, 0.5f }, true); 191 | 192 | if (optionCount == currentOption && selectPressed) return true; 193 | else if (optionCount == currentOption && leftPressed) return true; 194 | else if (optionCount == currentOption && rightPressed) return true; 195 | return false; 196 | } 197 | 198 | #pragma warning(disable: 4244) 199 | bool UserInterface::Float(const char* option, float& _float, int min, int max) 200 | { 201 | Option(option); 202 | 203 | if (optionCount == currentOption) { 204 | if (leftPressed) { 205 | _float <= min ? _float = max : _float -= 0.1f; 206 | } 207 | if (rightPressed) { 208 | _float >= max ? _float = min : _float += 0.1f; 209 | } 210 | _float < min ? _float = max : _float > max ? _float = min : NULL; 211 | } 212 | 213 | if (currentOption <= maxVisOptions && optionCount <= maxVisOptions) 214 | draw.Text(StringToChar(std::to_string(_float)), optiontext, { menuX + 0.068f, optionCount * 0.035f + 0.125f }, { 0.5f, 0.5f }, true); 215 | else if (optionCount > currentOption - maxVisOptions && optionCount <= currentOption) 216 | draw.Text(StringToChar(std::to_string(_float)), optiontext, { menuX + 0.068f, (optionCount - (currentOption - maxVisOptions)) * 0.035f + 0.12f }, { 0.5f, 0.5f }, true); 217 | 218 | if (optionCount == currentOption && selectPressed) return true; 219 | else if (optionCount == currentOption && leftPressed) return true; 220 | else if (optionCount == currentOption && rightPressed) return true; 221 | return false; 222 | } 223 | 224 | bool UserInterface::Float(const char* option, float& _float, int min, int max, int step) 225 | { 226 | Option(option); 227 | 228 | if (optionCount == currentOption) { 229 | if (leftPressed) { 230 | _float <= min ? _float = max : _float -= 0.1f; 231 | } 232 | if (rightPressed) { 233 | _float >= max ? _float = min : _float += 0.1f; 234 | } 235 | _float < min ? _float = max : _float > max ? _float = min : NULL; 236 | } 237 | 238 | if (currentOption <= maxVisOptions && optionCount <= maxVisOptions) 239 | draw.Text(StringToChar(std::to_string(_float)), optiontext, { menuX + 0.068f, optionCount * 0.035f + 0.125f }, { 0.5f, 0.5f }, true); 240 | else if (optionCount > currentOption - maxVisOptions && optionCount <= currentOption) 241 | draw.Text(StringToChar(std::to_string(_float)), optiontext, { menuX + 0.068f, (optionCount - (currentOption - maxVisOptions)) * 0.035f + 0.12f }, { 0.5f, 0.5f }, true); 242 | 243 | if (optionCount == currentOption && selectPressed) return true; 244 | else if (optionCount == currentOption && leftPressed) return true; 245 | else if (optionCount == currentOption && rightPressed) return true; 246 | return false; 247 | } 248 | #pragma warning(default: 4244) 249 | 250 | #pragma warning(disable: 4267) 251 | bool UserInterface::IntVector(const char* option, std::vector Vector, int& position) 252 | { 253 | Option(option); 254 | 255 | if (optionCount == currentOption) { 256 | int max = Vector.size() - 1; 257 | int min = 0; 258 | if (leftPressed) { 259 | position >= 1 ? position-- : position = max; 260 | } 261 | if (rightPressed) { 262 | position < max ? position++ : position = min; 263 | } 264 | } 265 | 266 | if (currentOption <= maxVisOptions && optionCount <= maxVisOptions) 267 | draw.Text(StringToChar(std::to_string(Vector[position])), optiontext, { menuX + 0.068f, optionCount * 0.035f + 0.125f }, { 0.5f, 0.5f }, true); 268 | else if (optionCount > currentOption - maxVisOptions && optionCount <= currentOption) 269 | draw.Text(StringToChar(std::to_string(Vector[position])), optiontext, { menuX + 0.068f, (optionCount - (currentOption - maxVisOptions)) * 0.035f + 0.12f }, { 0.5f, 0.5f }, true); 270 | 271 | if (optionCount == currentOption && selectPressed) return true; 272 | else if (optionCount == currentOption && leftPressed) return true; 273 | else if (optionCount == currentOption && rightPressed) return true; 274 | return false; 275 | } 276 | 277 | bool UserInterface::FloatVector(const char* option, std::vector Vector, int& position) 278 | { 279 | Option(option); 280 | 281 | if (optionCount == currentOption) { 282 | size_t max = Vector.size() - 1; 283 | int min = 0; 284 | if (leftPressed) { 285 | position >= 1 ? position-- : position = max; 286 | } 287 | if (rightPressed) { 288 | position < max ? position++ : position = min; 289 | } 290 | } 291 | 292 | if (currentOption <= maxVisOptions && optionCount <= maxVisOptions) 293 | draw.Text(StringToChar(std::to_string(Vector[position])), optiontext, { menuX + 0.068f, optionCount * 0.035f + 0.125f }, { 0.5f, 0.5f }, true); 294 | else if (optionCount > currentOption - maxVisOptions && optionCount <= currentOption) 295 | draw.Text(StringToChar(std::to_string(Vector[position])), optiontext, { menuX + 0.068f, (optionCount - (currentOption - maxVisOptions)) * 0.035f + 0.12f }, { 0.5f, 0.5f }, true); 296 | 297 | if (optionCount == currentOption && selectPressed) return true; 298 | else if (optionCount == currentOption && leftPressed) return true; 299 | else if (optionCount == currentOption && rightPressed) return true; 300 | return false; 301 | } 302 | 303 | bool UserInterface::StringVector(const char* option, std::vector Vector, int& position) 304 | { 305 | Option(option); 306 | 307 | if (optionCount == currentOption) { 308 | size_t max = Vector.size() - 1; 309 | int min = 0; 310 | if (leftPressed) { 311 | position >= 1 ? position-- : position = max; 312 | } 313 | if (rightPressed) { 314 | position < max ? position++ : position = min; 315 | } 316 | } 317 | 318 | if (currentOption <= maxVisOptions && optionCount <= maxVisOptions) 319 | draw.Text(StringToChar((Vector[position])), optiontext, { menuX + 0.068f, optionCount * 0.035f + 0.125f }, { 0.5f, 0.5f }, true); 320 | else if (optionCount > currentOption - maxVisOptions && optionCount <= currentOption) 321 | draw.Text(StringToChar((Vector[position])), optiontext, { menuX + 0.068f, (optionCount - (currentOption - maxVisOptions)) * 0.035f + 0.12f }, { 0.5f, 0.5f }, true); 322 | 323 | if (optionCount == currentOption && selectPressed) return true; 324 | else if (optionCount == currentOption && leftPressed) return true; 325 | else if (optionCount == currentOption && rightPressed) return true; 326 | return false; 327 | } 328 | 329 | bool UserInterface::StringVector(const char* option, std::vector Vector, int& position) 330 | { 331 | Option(option); 332 | 333 | if (optionCount == currentOption) { 334 | size_t max = Vector.size() - 1; 335 | int min = 0; 336 | if (leftPressed) { 337 | position >= 1 ? position-- : position = max; 338 | } 339 | if (rightPressed) { 340 | position < max ? position++ : position = min; 341 | } 342 | } 343 | 344 | if (currentOption <= maxVisOptions && optionCount <= maxVisOptions) 345 | draw.Text(((Vector[position])), optiontext, { menuX + 0.068f, optionCount * 0.035f + 0.125f }, { 0.5f, 0.5f }, true); 346 | else if (optionCount > currentOption - maxVisOptions && optionCount <= currentOption) 347 | draw.Text(((Vector[position])), optiontext, { menuX + 0.068f, (optionCount - (currentOption - maxVisOptions)) * 0.035f + 0.12f }, { 0.5f, 0.5f }, true); 348 | 349 | if (optionCount == currentOption && selectPressed) return true; 350 | else if (optionCount == currentOption && leftPressed) return true; 351 | else if (optionCount == currentOption && rightPressed) return true; 352 | return false; 353 | } 354 | #pragma warning(default: 4267) 355 | 356 | void UserInterface::End() 357 | { 358 | if (optionCount >= maxVisOptions) { 359 | draw.Rect({ 0, 0, 0, 210 }, { menuX, (maxVisOptions + 1) * 0.035f + 0.1415f }, { menuWidth, 0.035f }); 360 | draw.Text(StringToChar(std::to_string(currentOption) + "/" + std::to_string(optionCount)), { 255, 255, 255, 255, 6 }, { menuX - 0.1f, (maxVisOptions + 1) * 0.035f + 0.125f }, { 0.5f, 0.5f }, false); 361 | draw.Text("1.0", { 255, 255, 255, 255, 6 }, { menuX + 0.088f, (maxVisOptions + 1) * 0.035f + 0.125f }, { 0.5f, 0.5f }, false); 362 | 363 | /*Switches the Arrow on optioncount*/ 364 | if (currentOption == 1) { 365 | draw.Sprite("commonmenu", "arrowright", menuX, (maxVisOptions + 1) * 0.035f + 0.142f, 0.010f, 0.0175f, 90, 255, 255, 255, 255); 366 | } 367 | else if (currentOption == optionCount) { 368 | draw.Sprite("commonmenu", "arrowright", menuX, (maxVisOptions + 1) * 0.035f + 0.142f, 0.010f, 0.0175f, 270, 255, 255, 255, 255); 369 | } 370 | else { 371 | draw.Sprite("commonmenu", "shop_arrows_upanddown", menuX, (maxVisOptions + 1) * 0.035f + 0.140f, 0.020f, 0.035f, 180, 255, 255, 255, 255); 372 | } 373 | } 374 | else if (optionCount > 0) { 375 | draw.Rect({ 0, 0, 0, 210 }, { menuX, (optionCount + 1) * 0.035f + 0.1415f }, { menuWidth, 0.035f }); 376 | draw.Text(StringToChar(std::to_string(currentOption) + "/" + std::to_string(optionCount)), { 255, 255, 255, 255, 6 }, { menuX - 0.1f, (optionCount + 1) * 0.035f + 0.125f }, { 0.5f, 0.5f }, false); 377 | draw.Text("1.0", { 255, 255, 255, 255, 6 }, { menuX + 0.088f, (optionCount + 1) * 0.035f + 0.125f }, { 0.5f, 0.5f }, false); 378 | 379 | /*Switches the Arrow on optioncount*/ 380 | if (currentOption == 1 && optionCount > 1) { 381 | draw.Sprite("commonmenu", "arrowright", menuX, ((optionCount + 1) * 0.035f + 0.142f), 0.010f, 0.0175f, 90, 255, 255, 255, 255); 382 | } 383 | else if (currentOption == optionCount && optionCount > 1) { 384 | draw.Sprite("commonmenu", "arrowright", menuX, ((optionCount + 1) * 0.035f + 0.142f), 0.010f, 0.0175f, 270, 255, 255, 255, 255); 385 | } 386 | else { 387 | draw.Sprite("commonmenu", "shop_arrows_upanddown", menuX, ((optionCount + 1) * 0.035f + 0.140f), 0.020f, 0.035f, 180, 255, 255, 255, 255); 388 | } 389 | } 390 | } 391 | 392 | #pragma warning(disable: 4018) 393 | void UserInterface::Keys() 394 | { 395 | selectPressed = false; 396 | leftPressed = false; 397 | rightPressed = false; 398 | if (GetTickCount() - keyPressPreviousTick > keyPressDelay) { 399 | if (GetAsyncKeyState(openKey)) { 400 | menuLevel == 0 ? MoveMenu(SubMenus::MAINMENU) : menuLevel == 1 ? BackMenu() : NULL; 401 | 402 | if (opened) { MoveMenu(SubMenus::NOMENU); opened = false; } else if (!opened) { MoveMenu(SubMenus::MAINMENU); opened = true; } if (menusounds) { if (opened) { AUDIO::PLAY_SOUND_FRONTEND(-1, "SELECT", "HUD_FRONTEND_DEFAULT_SOUNDSET", false); } else { AUDIO::PLAY_SOUND_FRONTEND(-1, "BACK", "HUD_FRONTEND_DEFAULT_SOUNDSET", false); } } 403 | 404 | keyPressPreviousTick = GetTickCount(); 405 | } 406 | else if (GetAsyncKeyState(backKey)) { 407 | menuLevel > 0 ? BackMenu() : NULL; 408 | 409 | if (menusounds) { AUDIO::PLAY_SOUND_FRONTEND(-1, "BACK", "HUD_FRONTEND_DEFAULT_SOUNDSET", false); } 410 | 411 | keyPressPreviousTick = GetTickCount(); 412 | } 413 | else if (GetAsyncKeyState(upKey)) { 414 | currentOption > 1 ? currentOption-- : currentOption = optionCount; 415 | 416 | if (menusounds) { AUDIO::PLAY_SOUND_FRONTEND(-1, "NAV_UP_DOWN", "HUD_FRONTEND_DEFAULT_SOUNDSET", false); } 417 | 418 | keyPressPreviousTick = GetTickCount(); 419 | } 420 | else if (GetAsyncKeyState(downKey)) { 421 | currentOption < optionCount ? currentOption++ : currentOption = 1; 422 | 423 | if (menusounds) { AUDIO::PLAY_SOUND_FRONTEND(-1, "NAV_UP_DOWN", "HUD_FRONTEND_DEFAULT_SOUNDSET", false); } 424 | 425 | keyPressPreviousTick = GetTickCount(); 426 | } 427 | else if (GetAsyncKeyState(leftKey)) { 428 | leftPressed = true; 429 | 430 | if (menusounds) { AUDIO::PLAY_SOUND_FRONTEND(-1, "NAV_LEFT_RIGHT", "HUD_FRONTEND_DEFAULT_SOUNDSET", false); } 431 | 432 | keyPressPreviousTick = GetTickCount(); 433 | } 434 | else if (GetAsyncKeyState(rightKey)) { 435 | rightPressed = true; 436 | 437 | if (menusounds) { AUDIO::PLAY_SOUND_FRONTEND(-1, "NAV_LEFT_RIGHT", "HUD_FRONTEND_DEFAULT_SOUNDSET", false); } 438 | 439 | keyPressPreviousTick = GetTickCount(); 440 | } 441 | else if (GetAsyncKeyState(selectKey)) { 442 | selectPressed = true; 443 | 444 | if (menusounds) { AUDIO::PLAY_SOUND_FRONTEND(-1, "SELECT", "HUD_FRONTEND_DEFAULT_SOUNDSET", false); } 445 | 446 | keyPressPreviousTick = GetTickCount(); 447 | } 448 | } 449 | optionCount = 0; 450 | } 451 | #pragma warning(default : 4018) 452 | 453 | void UserInterface::MoveMenu(SubMenus menu) 454 | { 455 | menusArray[menuLevel] = currentMenu; 456 | optionsArray[menuLevel] = currentOption; 457 | menuLevel++; 458 | currentMenu = menu; 459 | currentOption = 1; 460 | } 461 | 462 | void UserInterface::BackMenu() 463 | { 464 | menuLevel--; 465 | currentMenu = menusArray[menuLevel]; 466 | currentOption = optionsArray[menuLevel]; 467 | } 468 | } -------------------------------------------------------------------------------- /Source/enums.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | 4 | enum eAudioFlag 5 | { 6 | AudioFlagActivateSwitchWheelAudio, 7 | AudioFlagAllowCutsceneOverScreenFade, 8 | AudioFlagAllowForceRadioAfterRetune, 9 | AudioFlagAllowPainAndAmbientSpeechToPlayDuringCutscene, 10 | AudioFlagAllowPlayerAIOnMission, 11 | AudioFlagAllowPoliceScannerWhenPlayerHasNoControl, 12 | AudioFlagAllowRadioDuringSwitch, 13 | AudioFlagAllowRadioOverScreenFade, 14 | AudioFlagAllowScoreAndRadio, 15 | AudioFlagAllowScriptedSpeechInSlowMo, 16 | AudioFlagAvoidMissionCompleteDelay, 17 | AudioFlagDisableAbortConversationForDeathAndInjury, 18 | AudioFlagDisableAbortConversationForRagdoll, 19 | AudioFlagDisableBarks, 20 | AudioFlagDisableFlightMusic, 21 | AudioFlagDisableReplayScriptStreamRecording, 22 | AudioFlagEnableHeadsetBeep, 23 | AudioFlagForceConversationInterrupt, 24 | AudioFlagForceSeamlessRadioSwitch, 25 | AudioFlagForceSniperAudio, 26 | AudioFlagFrontendRadioDisabled, 27 | AudioFlagHoldMissionCompleteWhenPrepared, 28 | AudioFlagIsDirectorModeActive, 29 | AudioFlagIsPlayerOnMissionForSpeech, 30 | AudioFlagListenerReverbDisabled, 31 | AudioFlagLoadMPData, 32 | AudioFlagMobileRadioInGame, 33 | AudioFlagOnlyAllowScriptTriggerPoliceScanner, 34 | AudioFlagPlayMenuMusic, 35 | AudioFlagPoliceScannerDisabled, 36 | AudioFlagScriptedConvListenerMaySpeak, 37 | AudioFlagSpeechDucksScore, 38 | AudioFlagSuppressPlayerScubaBreathing, 39 | AudioFlagWantedMusicDisabled, 40 | AudioFlagWantedMusicOnMission 41 | }; 42 | 43 | enum ControllerInputs 44 | { 45 | INPUT_NEXT_CAMERA = 0, 46 | INPUT_LOOK_LR = 1, 47 | INPUT_LOOK_UD = 2, 48 | INPUT_LOOK_UP_ONLY = 3, 49 | INPUT_LOOK_DOWN_ONLY = 4, 50 | INPUT_LOOK_LEFT_ONLY = 5, 51 | INPUT_LOOK_RIGHT_ONLY = 6, 52 | INPUT_CINEMATIC_SLOWMO = 7, 53 | INPUT_SCRIPTED_FLY_UD = 8, 54 | INPUT_SCRIPTED_FLY_LR = 9, 55 | INPUT_SCRIPTED_FLY_ZUP = 10, 56 | INPUT_SCRIPTED_FLY_ZDOWN = 11, 57 | INPUT_WEAPON_WHEEL_UD = 12, 58 | INPUT_WEAPON_WHEEL_LR = 13, 59 | INPUT_WEAPON_WHEEL_NEXT = 14, 60 | INPUT_WEAPON_WHEEL_PREV = 15, 61 | INPUT_SELECT_NEXT_WEAPON = 16, 62 | INPUT_SELECT_PREV_WEAPON = 17, 63 | INPUT_SKIP_CUTSCENE = 18, 64 | INPUT_CHARACTER_WHEEL = 19, 65 | INPUT_MULTIPLAYER_INFO = 20, 66 | INPUT_SPRINT = 21, 67 | INPUT_JUMP = 22, 68 | INPUT_ENTER = 23, 69 | INPUT_ATTACK = 24, 70 | INPUT_AIM = 25, 71 | INPUT_LOOK_BEHIND = 26, 72 | INPUT_PHONE = 27, 73 | INPUT_SPECIAL_ABILITY = 28, 74 | INPUT_SPECIAL_ABILITY_SECONDARY = 29, 75 | INPUT_MOVE_LR = 30, 76 | INPUT_MOVE_UD = 31, 77 | INPUT_MOVE_UP_ONLY = 32, 78 | INPUT_MOVE_DOWN_ONLY = 33, 79 | INPUT_MOVE_LEFT_ONLY = 34, 80 | INPUT_MOVE_RIGHT_ONLY = 35, 81 | INPUT_DUCK = 36, 82 | INPUT_SELECT_WEAPON = 37, 83 | INPUT_PICKUP = 38, 84 | INPUT_SNIPER_ZOOM = 39, 85 | INPUT_SNIPER_ZOOM_IN_ONLY = 40, 86 | INPUT_SNIPER_ZOOM_OUT_ONLY = 41, 87 | INPUT_SNIPER_ZOOM_IN_SECONDARY = 42, 88 | INPUT_SNIPER_ZOOM_OUT_SECONDARY = 43, 89 | INPUT_COVER = 44, 90 | INPUT_RELOAD = 45, 91 | INPUT_TALK = 46, 92 | INPUT_DETONATE = 47, 93 | INPUT_HUD_SPECIAL = 48, 94 | INPUT_ARREST = 49, 95 | INPUT_ACCURATE_AIM = 50, 96 | INPUT_CONTEXT = 51, 97 | INPUT_CONTEXT_SECONDARY = 52, 98 | INPUT_WEAPON_SPECIAL = 53, 99 | INPUT_WEAPON_SPECIAL_TWO = 54, 100 | INPUT_DIVE = 55, 101 | INPUT_DROP_WEAPON = 56, 102 | INPUT_DROP_AMMO = 57, 103 | INPUT_THROW_GRENADE = 58, 104 | INPUT_VEH_MOVE_LR = 59, 105 | INPUT_VEH_MOVE_UD = 60, 106 | INPUT_VEH_MOVE_UP_ONLY = 61, 107 | INPUT_VEH_MOVE_DOWN_ONLY = 62, 108 | INPUT_VEH_MOVE_LEFT_ONLY = 63, 109 | INPUT_VEH_MOVE_RIGHT_ONLY = 64, 110 | INPUT_VEH_SPECIAL = 65, 111 | INPUT_VEH_GUN_LR = 66, 112 | INPUT_VEH_GUN_UD = 67, 113 | INPUT_VEH_AIM = 68, 114 | INPUT_VEH_ATTACK = 69, 115 | INPUT_VEH_ATTACK2 = 70, 116 | INPUT_VEH_ACCELERATE = 71, 117 | INPUT_VEH_BRAKE = 72, 118 | INPUT_VEH_DUCK = 73, 119 | INPUT_VEH_HEADLIGHT = 74, 120 | INPUT_VEH_EXIT = 75, 121 | INPUT_VEH_HANDBRAKE = 76, 122 | INPUT_VEH_HOTWIRE_LEFT = 77, 123 | INPUT_VEH_HOTWIRE_RIGHT = 78, 124 | INPUT_VEH_LOOK_BEHIND = 79, 125 | INPUT_VEH_CIN_CAM = 80, 126 | INPUT_VEH_NEXT_RADIO = 81, 127 | INPUT_VEH_PREV_RADIO = 82, 128 | INPUT_VEH_NEXT_RADIO_TRACK = 83, 129 | INPUT_VEH_PREV_RADIO_TRACK = 84, 130 | INPUT_VEH_RADIO_WHEEL = 85, 131 | INPUT_VEH_HORN = 86, 132 | INPUT_VEH_FLY_THROTTLE_UP = 87, 133 | INPUT_VEH_FLY_THROTTLE_DOWN = 88, 134 | INPUT_VEH_FLY_YAW_LEFT = 89, 135 | INPUT_VEH_FLY_YAW_RIGHT = 90, 136 | INPUT_VEH_PASSENGER_AIM = 91, 137 | INPUT_VEH_PASSENGER_ATTACK = 92, 138 | INPUT_VEH_SPECIAL_ABILITY_FRANKLIN = 93, 139 | INPUT_VEH_STUNT_UD = 94, 140 | INPUT_VEH_CINEMATIC_UD = 95, 141 | INPUT_VEH_CINEMATIC_UP_ONLY = 96, 142 | INPUT_VEH_CINEMATIC_DOWN_ONLY = 97, 143 | INPUT_VEH_CINEMATIC_LR = 98, 144 | INPUT_VEH_SELECT_NEXT_WEAPON = 99, 145 | INPUT_VEH_SELECT_PREV_WEAPON = 100, 146 | INPUT_VEH_ROOF = 101, 147 | INPUT_VEH_JUMP = 102, 148 | INPUT_VEH_GRAPPLING_HOOK = 103, 149 | INPUT_VEH_SHUFFLE = 104, 150 | INPUT_VEH_DROP_PROJECTILE = 105, 151 | INPUT_VEH_MOUSE_CONTROL_OVERRIDE = 106, 152 | INPUT_VEH_FLY_ROLL_LR = 107, 153 | INPUT_VEH_FLY_ROLL_LEFT_ONLY = 108, 154 | INPUT_VEH_FLY_ROLL_RIGHT_ONLY = 109, 155 | INPUT_VEH_FLY_PITCH_UD = 110, 156 | INPUT_VEH_FLY_PITCH_UP_ONLY = 111, 157 | INPUT_VEH_FLY_PITCH_DOWN_ONLY = 112, 158 | INPUT_VEH_FLY_UNDERCARRIAGE = 113, 159 | INPUT_VEH_FLY_ATTACK = 114, 160 | INPUT_VEH_FLY_SELECT_NEXT_WEAPON = 115, 161 | INPUT_VEH_FLY_SELECT_PREV_WEAPON = 116, 162 | INPUT_VEH_FLY_SELECT_TARGET_LEFT = 117, 163 | INPUT_VEH_FLY_SELECT_TARGET_RIGHT = 118, 164 | INPUT_VEH_FLY_VERTICAL_FLIGHT_MODE = 119, 165 | INPUT_VEH_FLY_DUCK = 120, 166 | INPUT_VEH_FLY_ATTACK_CAMERA = 121, 167 | INPUT_VEH_FLY_MOUSE_CONTROL_OVERRIDE = 122, 168 | INPUT_VEH_SUB_TURN_LR = 123, 169 | INPUT_VEH_SUB_TURN_LEFT_ONLY = 124, 170 | INPUT_VEH_SUB_TURN_RIGHT_ONLY = 125, 171 | INPUT_VEH_SUB_PITCH_UD = 126, 172 | INPUT_VEH_SUB_PITCH_UP_ONLY = 127, 173 | INPUT_VEH_SUB_PITCH_DOWN_ONLY = 128, 174 | INPUT_VEH_SUB_THROTTLE_UP = 129, 175 | INPUT_VEH_SUB_THROTTLE_DOWN = 130, 176 | INPUT_VEH_SUB_ASCEND = 131, 177 | INPUT_VEH_SUB_DESCEND = 132, 178 | INPUT_VEH_SUB_TURN_HARD_LEFT = 133, 179 | INPUT_VEH_SUB_TURN_HARD_RIGHT = 134, 180 | INPUT_VEH_SUB_MOUSE_CONTROL_OVERRIDE = 135, 181 | INPUT_VEH_PUSHBIKE_PEDAL = 136, 182 | INPUT_VEH_PUSHBIKE_SPRINT = 137, 183 | INPUT_VEH_PUSHBIKE_FRONT_BRAKE = 138, 184 | INPUT_VEH_PUSHBIKE_REAR_BRAKE = 139, 185 | INPUT_MELEE_ATTACK_LIGHT = 140, 186 | INPUT_MELEE_ATTACK_HEAVY = 141, 187 | INPUT_MELEE_ATTACK_ALTERNATE = 142, 188 | INPUT_MELEE_BLOCK = 143, 189 | INPUT_PARACHUTE_DEPLOY = 144, 190 | INPUT_PARACHUTE_DETACH = 145, 191 | INPUT_PARACHUTE_TURN_LR = 146, 192 | INPUT_PARACHUTE_TURN_LEFT_ONLY = 147, 193 | INPUT_PARACHUTE_TURN_RIGHT_ONLY = 148, 194 | INPUT_PARACHUTE_PITCH_UD = 149, 195 | INPUT_PARACHUTE_PITCH_UP_ONLY = 150, 196 | INPUT_PARACHUTE_PITCH_DOWN_ONLY = 151, 197 | INPUT_PARACHUTE_BRAKE_LEFT = 152, 198 | INPUT_PARACHUTE_BRAKE_RIGHT = 153, 199 | INPUT_PARACHUTE_SMOKE = 154, 200 | INPUT_PARACHUTE_PRECISION_LANDING = 155, 201 | INPUT_MAP = 156, 202 | INPUT_SELECT_WEAPON_UNARMED = 157, 203 | INPUT_SELECT_WEAPON_MELEE = 158, 204 | INPUT_SELECT_WEAPON_HANDGUN = 159, 205 | INPUT_SELECT_WEAPON_SHOTGUN = 160, 206 | INPUT_SELECT_WEAPON_SMG = 161, 207 | INPUT_SELECT_WEAPON_AUTO_RIFLE = 162, 208 | INPUT_SELECT_WEAPON_SNIPER = 163, 209 | INPUT_SELECT_WEAPON_HEAVY = 164, 210 | INPUT_SELECT_WEAPON_SPECIAL = 165, 211 | INPUT_SELECT_CHARACTER_MICHAEL = 166, 212 | INPUT_SELECT_CHARACTER_FRANKLIN = 167, 213 | INPUT_SELECT_CHARACTER_TREVOR = 168, 214 | INPUT_SELECT_CHARACTER_MULTIPLAYER = 169, 215 | INPUT_SAVE_REPLAY_CLIP = 170, 216 | INPUT_SPECIAL_ABILITY_PC = 171, 217 | INPUT_CELLPHONE_UP = 172, 218 | INPUT_CELLPHONE_DOWN = 173, 219 | INPUT_CELLPHONE_LEFT = 174, 220 | INPUT_CELLPHONE_RIGHT = 175, 221 | INPUT_CELLPHONE_SELECT = 176, 222 | INPUT_CELLPHONE_CANCEL = 177, 223 | INPUT_CELLPHONE_OPTION = 178, 224 | INPUT_CELLPHONE_EXTRA_OPTION = 179, 225 | INPUT_CELLPHONE_SCROLL_FORWARD = 180, 226 | INPUT_CELLPHONE_SCROLL_BACKWARD = 181, 227 | INPUT_CELLPHONE_CAMERA_FOCUS_LOCK = 182, 228 | INPUT_CELLPHONE_CAMERA_GRID = 183, 229 | INPUT_CELLPHONE_CAMERA_SELFIE = 184, 230 | INPUT_CELLPHONE_CAMERA_DOF = 185, 231 | INPUT_CELLPHONE_CAMERA_EXPRESSION = 186, 232 | INPUT_FRONTEND_DOWN = 187, 233 | INPUT_FRONTEND_UP = 188, 234 | INPUT_FRONTEND_LEFT = 189, 235 | INPUT_FRONTEND_RIGHT = 190, 236 | INPUT_FRONTEND_RDOWN = 191, 237 | INPUT_FRONTEND_RUP = 192, 238 | INPUT_FRONTEND_RLEFT = 193, 239 | INPUT_FRONTEND_RRIGHT = 194, 240 | INPUT_FRONTEND_AXIS_X = 195, 241 | INPUT_FRONTEND_AXIS_Y = 196, 242 | INPUT_FRONTEND_RIGHT_AXIS_X = 197, 243 | INPUT_FRONTEND_RIGHT_AXIS_Y = 198, 244 | INPUT_FRONTEND_PAUSE = 199, 245 | INPUT_FRONTEND_PAUSE_ALTERNATE = 200, 246 | INPUT_FRONTEND_ACCEPT = 201, 247 | INPUT_FRONTEND_CANCEL = 202, 248 | INPUT_FRONTEND_X = 203, 249 | INPUT_FRONTEND_Y = 204, 250 | INPUT_FRONTEND_LB = 205, 251 | INPUT_FRONTEND_RB = 206, 252 | INPUT_FRONTEND_LT = 207, 253 | INPUT_FRONTEND_RT = 208, 254 | INPUT_FRONTEND_LS = 209, 255 | INPUT_FRONTEND_RS = 210, 256 | INPUT_FRONTEND_LEADERBOARD = 211, 257 | INPUT_FRONTEND_SOCIAL_CLUB = 212, 258 | INPUT_FRONTEND_SOCIAL_CLUB_SECONDARY = 213, 259 | INPUT_FRONTEND_DELETE = 214, 260 | INPUT_FRONTEND_ENDSCREEN_ACCEPT = 215, 261 | INPUT_FRONTEND_ENDSCREEN_EXPAND = 216, 262 | INPUT_FRONTEND_SELECT = 217, 263 | INPUT_SCRIPT_LEFT_AXIS_X = 218, 264 | INPUT_SCRIPT_LEFT_AXIS_Y = 219, 265 | INPUT_SCRIPT_RIGHT_AXIS_X = 220, 266 | INPUT_SCRIPT_RIGHT_AXIS_Y = 221, 267 | INPUT_SCRIPT_RUP = 222, 268 | INPUT_SCRIPT_RDOWN = 223, 269 | INPUT_SCRIPT_RLEFT = 224, 270 | INPUT_SCRIPT_RRIGHT = 225, 271 | INPUT_SCRIPT_LB = 226, 272 | INPUT_SCRIPT_RB = 227, 273 | INPUT_SCRIPT_LT = 228, 274 | INPUT_SCRIPT_RT = 229, 275 | INPUT_SCRIPT_LS = 230, 276 | INPUT_SCRIPT_RS = 231, 277 | INPUT_SCRIPT_PAD_UP = 232, 278 | INPUT_SCRIPT_PAD_DOWN = 233, 279 | INPUT_SCRIPT_PAD_LEFT = 234, 280 | INPUT_SCRIPT_PAD_RIGHT = 235, 281 | INPUT_SCRIPT_SELECT = 236, 282 | INPUT_CURSOR_ACCEPT = 237, 283 | INPUT_CURSOR_CANCEL = 238, 284 | INPUT_CURSOR_X = 239, 285 | INPUT_CURSOR_Y = 240, 286 | INPUT_CURSOR_SCROLL_UP = 241, 287 | INPUT_CURSOR_SCROLL_DOWN = 242, 288 | INPUT_ENTER_CHEAT_CODE = 243, 289 | INPUT_INTERACTION_MENU = 244, 290 | INPUT_MP_TEXT_CHAT_ALL = 245, 291 | INPUT_MP_TEXT_CHAT_TEAM = 246, 292 | INPUT_MP_TEXT_CHAT_FRIENDS = 247, 293 | INPUT_MP_TEXT_CHAT_CREW = 248, 294 | INPUT_PUSH_TO_TALK = 249, 295 | INPUT_CREATOR_LS = 250, 296 | INPUT_CREATOR_RS = 251, 297 | INPUT_CREATOR_LT = 252, 298 | INPUT_CREATOR_RT = 253, 299 | INPUT_CREATOR_MENU_TOGGLE = 254, 300 | INPUT_CREATOR_ACCEPT = 255, 301 | INPUT_CREATOR_DELETE = 256, 302 | INPUT_ATTACK2 = 257, 303 | INPUT_RAPPEL_JUMP = 258, 304 | INPUT_RAPPEL_LONG_JUMP = 259, 305 | INPUT_RAPPEL_SMASH_WINDOW = 260, 306 | INPUT_PREV_WEAPON = 261, 307 | INPUT_NEXT_WEAPON = 262, 308 | INPUT_MELEE_ATTACK1 = 263, 309 | INPUT_MELEE_ATTACK2 = 264, 310 | INPUT_WHISTLE = 265, 311 | INPUT_MOVE_LEFT = 266, 312 | INPUT_MOVE_RIGHT = 267, 313 | INPUT_MOVE_UP = 268, 314 | INPUT_MOVE_DOWN = 269, 315 | INPUT_LOOK_LEFT = 270, 316 | INPUT_LOOK_RIGHT = 271, 317 | INPUT_LOOK_UP = 272, 318 | INPUT_LOOK_DOWN = 273, 319 | INPUT_SNIPER_ZOOM_IN = 274, 320 | INPUT_SNIPER_ZOOM_OUT = 275, 321 | INPUT_SNIPER_ZOOM_IN_ALTERNATE = 276, 322 | INPUT_SNIPER_ZOOM_OUT_ALTERNATE = 277, 323 | INPUT_VEH_MOVE_LEFT = 278, 324 | INPUT_VEH_MOVE_RIGHT = 279, 325 | INPUT_VEH_MOVE_UP = 280, 326 | INPUT_VEH_MOVE_DOWN = 281, 327 | INPUT_VEH_GUN_LEFT = 282, 328 | INPUT_VEH_GUN_RIGHT = 283, 329 | INPUT_VEH_GUN_UP = 284, 330 | INPUT_VEH_GUN_DOWN = 285, 331 | INPUT_VEH_LOOK_LEFT = 286, 332 | INPUT_VEH_LOOK_RIGHT = 287, 333 | INPUT_REPLAY_START_STOP_RECORDING = 288, 334 | INPUT_REPLAY_START_STOP_RECORDING_SECONDARY = 289, 335 | INPUT_SCALED_LOOK_LR = 290, 336 | INPUT_SCALED_LOOK_UD = 291, 337 | INPUT_SCALED_LOOK_UP_ONLY = 292, 338 | INPUT_SCALED_LOOK_DOWN_ONLY = 293, 339 | INPUT_SCALED_LOOK_LEFT_ONLY = 294, 340 | INPUT_SCALED_LOOK_RIGHT_ONLY = 295, 341 | INPUT_REPLAY_MARKER_DELETE = 296, 342 | INPUT_REPLAY_CLIP_DELETE = 297, 343 | INPUT_REPLAY_PAUSE = 298, 344 | INPUT_REPLAY_REWIND = 299, 345 | INPUT_REPLAY_FFWD = 300, 346 | INPUT_REPLAY_NEWMARKER = 301, 347 | INPUT_REPLAY_RECORD = 302, 348 | INPUT_REPLAY_SCREENSHOT = 303, 349 | INPUT_REPLAY_HIDEHUD = 304, 350 | INPUT_REPLAY_STARTPOINT = 305, 351 | INPUT_REPLAY_ENDPOINT = 306, 352 | INPUT_REPLAY_ADVANCE = 307, 353 | INPUT_REPLAY_BACK = 308, 354 | INPUT_REPLAY_TOOLS = 309, 355 | INPUT_REPLAY_RESTART = 310, 356 | INPUT_REPLAY_SHOWHOTKEY = 311, 357 | INPUT_REPLAY_CYCLEMARKERLEFT = 312, 358 | INPUT_REPLAY_CYCLEMARKERRIGHT = 313, 359 | INPUT_REPLAY_FOVINCREASE = 314, 360 | INPUT_REPLAY_FOVDECREASE = 315, 361 | INPUT_REPLAY_CAMERAUP = 316, 362 | INPUT_REPLAY_CAMERADOWN = 317, 363 | INPUT_REPLAY_SAVE = 318, 364 | INPUT_REPLAY_TOGGLETIME = 319, 365 | INPUT_REPLAY_TOGGLETIPS = 320, 366 | INPUT_REPLAY_PREVIEW = 321, 367 | INPUT_REPLAY_TOGGLE_TIMELINE = 322, 368 | INPUT_REPLAY_TIMELINE_PICKUP_CLIP = 323, 369 | INPUT_REPLAY_TIMELINE_DUPLICATE_CLIP = 324, 370 | INPUT_REPLAY_TIMELINE_PLACE_CLIP = 325, 371 | INPUT_REPLAY_CTRL = 326, 372 | INPUT_REPLAY_TIMELINE_SAVE = 327, 373 | INPUT_REPLAY_PREVIEW_AUDIO = 328, 374 | INPUT_VEH_DRIVE_LOOK = 329, 375 | INPUT_VEH_DRIVE_LOOK2 = 330, 376 | INPUT_VEH_FLY_ATTACK2 = 331, 377 | INPUT_RADIO_WHEEL_UD = 332, 378 | INPUT_RADIO_WHEEL_LR = 333, 379 | INPUT_VEH_SLOWMO_UD = 334, 380 | INPUT_VEH_SLOWMO_UP_ONLY = 335, 381 | INPUT_VEH_SLOWMO_DOWN_ONLY = 336, 382 | INPUT_MAP_POI = 337 383 | }; 384 | enum RockstarEvent 385 | { 386 | SCRIPT_ARRAY_DATA_VERIFY_EVENT, 387 | REQUEST_CONTROL_EVENT, 388 | GIVE_CONTROL_EVENT, 389 | WEAPON_DAMAGE_EVENT, 390 | REQUEST_PICKUP_EVENT, 391 | REQUEST_MAP_PICKUP_EVENT, 392 | GAME_CLOCK_EVENT, 393 | GAME_WEATHER_EVENT, 394 | RESPAWN_PLAYER_PED_EVENT, 395 | GIVE_WEAPON_EVENT, 396 | REMOVE_WEAPON_EVENT, 397 | REMOVE_ALL_WEAPONS_EVENT, 398 | VEHICLE_COMPONENT_CONTROL_EVENT, 399 | FIRE_EVENT, 400 | EXPLOSION_EVENT, 401 | START_PROJECTILE_EVENT, 402 | ALTER_WANTED_LEVEL_EVENT, 403 | CHANGE_RADIO_STATION_EVENT, 404 | RAGDOLL_REQUEST_EVENT, 405 | PLAYER_TAUNT_EVENT, 406 | PLAYER_CARD_STAT_EVENT, 407 | DOOR_BREAK_EVENT, 408 | SCRIPTED_GAME_EVENT, 409 | REMOTE_SCRIPT_INFO_EVENT, 410 | REMOTE_SCRIPT_LEAVE_EVENT, 411 | MARK_AS_NO_LONGER_NEEDED_EVENT, 412 | CONVERT_TO_SCRIPT_ENTITY_EVENT, 413 | SCRIPT_WORLD_STATE_EVENT, 414 | INCIDENT_ENTITY_EVENT, 415 | CLEAR_AREA_EVENT, 416 | CLEAR_RECTANGLE_AREA_EVENT, 417 | NETWORK_REQUEST_SYNCED_SCENE_EVENT, 418 | NETWORK_START_SYNCED_SCENE_EVENT, 419 | NETWORK_UPDATE_SYNCED_SCENE_EVENT, 420 | NETWORK_STOP_SYNCED_SCENE_EVENT, 421 | GIVE_PED_SCRIPTED_TASK_EVENT, 422 | GIVE_PED_SEQUENCE_TASK_EVENT, 423 | NETWORK_CLEAR_PED_TASKS_EVENT, 424 | NETWORK_START_PED_ARREST_EVENT, 425 | NETWORK_START_PED_UNCUFF_EVENT, 426 | NETWORK_SOUND_CAR_HORN_EVENT, 427 | NETWORK_ENTITY_AREA_STATUS_EVENT, 428 | NETWORK_GARAGE_OCCUPIED_STATUS_EVENT, 429 | PED_CONVERSATION_LINE_EVENT, 430 | SCRIPT_ENTITY_STATE_CHANGE_EVENT, 431 | NETWORK_PLAY_SOUND_EVENT, 432 | NETWORK_STOP_SOUND_EVENT, 433 | NETWORK_PLAY_AIRDEFENSE_FIRE_EVENT, 434 | NETWORK_BANK_REQUEST_EVENT, 435 | REQUEST_DOOR_EVENT, 436 | NETWORK_TRAIN_REQUEST_EVENT, 437 | NETWORK_TRAIN_REPORT_EVENT, 438 | NETWORK_INCREMENT_STAT_EVENT, 439 | MODIFY_VEHICLE_LOCK_WORD_STATE_DATA, 440 | REQUEST_PHONE_EXPLOSION_EVENT, 441 | REQUEST_DETACHMENT_EVENT, 442 | KICK_VOTES_EVENT, 443 | GIVE_PICKUP_REWARDS_EVENT, 444 | NETWORK_CRC_HASH_CHECK_EVENT, 445 | BLOW_UP_VEHICLE_EVENT, 446 | NETWORK_SPECIAL_FIRE_EQUIPPED_WEAPON, 447 | NETWORK_RESPONDED_TO_THREAT_EVENT, 448 | NETWORK_SHOUT_TARGET_POSITION, 449 | PICKUP_DESTROYED_EVENT, 450 | UPDATE_PLAYER_SCARS_EVENT, 451 | NETWORK_CHECK_EXE_SIZE_EVENT, 452 | NETWORK_PTFX_EVENT, 453 | NETWORK_PED_SEEN_DEAD_PED_EVENT, 454 | REMOVE_STICKY_BOMB_EVENT, 455 | NETWORK_CHECK_CODE_CRCS_EVENT, 456 | INFORM_SILENCED_GUNSHOT_EVENT, 457 | PED_PLAY_PAIN_EVENT, 458 | CACHE_PLAYER_HEAD_BLEND_DATA_EVENT, 459 | REMOVE_PED_FROM_PEDGROUP_EVENT, 460 | REPORT_MYSELF_EVENT, 461 | REPORT_CASH_SPAWN_EVENT, 462 | ACTIVATE_VEHICLE_SPECIAL_ABILITY_EVENT, 463 | NETWORK_CHECK_CATALOG_CRC 464 | }; 465 | 466 | enum eBlipColor 467 | { 468 | ColorWhite = 0, 469 | ColorRed = 1, 470 | ColorGreen = 2, 471 | ColorBlue = 3, 472 | ColorPlayer = 4, 473 | ColorYellow = 5, 474 | ColorPurple = 7, 475 | ColorVehicle = 38, 476 | ColorMichael = 42, 477 | ColorFranklin = 43, 478 | ColorTrevor = 44, 479 | ColorMissionRed = 49, 480 | ColorMissionVehicle = 54, 481 | ColorYellowMission = 66, 482 | ColorYellowMission2 = 60, 483 | ColorWaypoint = 83, 484 | }; 485 | 486 | enum eBlipSprite 487 | { 488 | SpriteStandard = 1, 489 | SpriteBig = 2, 490 | SpritePoliceOfficer = 3, 491 | SpritePoliceArea = 4, 492 | SpriteSquare = 5, 493 | SpritePlayer = 6, 494 | SpriteNorth = 7, 495 | SpriteWaypoint = 8, 496 | SpriteBigCircle = 9, 497 | SpriteBigCircleOutline = 10, 498 | SpriteArrowUpOutlined = 11, 499 | SpriteArrowDownOutlined = 12, 500 | SpriteArrowUp = 13, 501 | SpriteArrowDown = 14, 502 | SpritePoliceHelicopterAnimated = 15, 503 | SpriteJet = 16, 504 | SpriteNumber1 = 17, 505 | SpriteNumber2 = 18, 506 | SpriteNumber3 = 19, 507 | SpriteNumber4 = 20, 508 | SpriteNumber5 = 21, 509 | SpriteNumber6 = 22, 510 | SpriteNumber7 = 23, 511 | SpriteNumber8 = 24, 512 | SpriteNumber9 = 25, 513 | SpriteNumber10 = 26, 514 | SpriteGTAOCrew = 27, 515 | SpriteGTAOFriendly = 28, 516 | SpriteLift = 36, 517 | SpriteRaceFinish = 38, 518 | SpriteSafehouse = 40, 519 | SpritePoliceOfficer2 = 41, 520 | SpritePoliceCarDot = 42, 521 | SpritePoliceHelicopter = 43, 522 | SpriteChatBubble = 47, 523 | SpriteGarage2 = 50, 524 | SpriteDrugs = 51, 525 | SpriteStore = 52, 526 | SpritePoliceCar = 56, 527 | SpritePolicePlayer = 58, 528 | SpritePoliceStation = 60, 529 | SpriteHospital = 61, 530 | SpriteHelicopter = 64, 531 | SpriteStrangersAndFreaks = 65, 532 | SpriteArmoredTruck = 66, 533 | SpriteTowTruck = 68, 534 | SpriteBarber = 71, 535 | SpriteLosSantosCustoms = 72, 536 | SpriteClothes = 73, 537 | SpriteTattooParlor = 75, 538 | SpriteSimeon = 76, 539 | SpriteLester = 77, 540 | SpriteMichael = 78, 541 | SpriteTrevor = 79, 542 | SpriteRampage = 84, 543 | SpriteVinewoodTours = 85, 544 | SpriteLamar = 86, 545 | SpriteFranklin = 88, 546 | SpriteChinese = 89, 547 | SpriteAirport = 90, 548 | SpriteBar = 93, 549 | SpriteBaseJump = 94, 550 | SpriteCarWash = 100, 551 | SpriteComedyClub = 102, 552 | SpriteDart = 103, 553 | SpriteFIB = 106, 554 | SpriteDollarSign = 108, 555 | SpriteGolf = 109, 556 | SpriteAmmuNation = 110, 557 | SpriteExile = 112, 558 | SpriteShootingRange = 119, 559 | SpriteSolomon = 120, 560 | SpriteStripClub = 121, 561 | SpriteTennis = 122, 562 | SpriteTriathlon = 126, 563 | SpriteOffRoadRaceFinish = 127, 564 | SpriteKey = 134, 565 | SpriteMovieTheater = 135, 566 | SpriteMusic = 136, 567 | SpriteMarijuana = 140, 568 | SpriteHunting = 141, 569 | SpriteArmsTraffickingGround = 147, 570 | SpriteNigel = 149, 571 | SpriteAssaultRifle = 150, 572 | SpriteBat = 151, 573 | SpriteGrenade = 152, 574 | SpriteHealth = 153, 575 | SpriteKnife = 154, 576 | SpriteMolotov = 155, 577 | SpritePistol = 156, 578 | SpriteRPG = 157, 579 | SpriteShotgun = 158, 580 | SpriteSMG = 159, 581 | SpriteSniper = 160, 582 | SpriteSonicWave = 161, 583 | SpritePointOfInterest = 162, 584 | SpriteGTAOPassive = 163, 585 | SpriteGTAOUsingMenu = 164, 586 | SpriteLink = 171, 587 | SpriteMinigun = 173, 588 | SpriteGrenadeLauncher = 174, 589 | SpriteArmor = 175, 590 | SpriteCastle = 176, 591 | SpriteCamera = 184, 592 | SpriteHandcuffs = 188, 593 | SpriteYoga = 197, 594 | SpriteCab = 198, 595 | SpriteNumber11 = 199, 596 | SpriteNumber12 = 200, 597 | SpriteNumber13 = 201, 598 | SpriteNumber14 = 202, 599 | SpriteNumber15 = 203, 600 | SpriteNumber16 = 204, 601 | SpriteShrink = 205, 602 | SpriteEpsilon = 206, 603 | SpritePersonalVehicleCar = 225, 604 | SpritePersonalVehicleBike = 226, 605 | SpriteCustody = 237, 606 | SpriteArmsTraffickingAir = 251, 607 | SpriteFairground = 266, 608 | SpritePropertyManagement = 267, 609 | SpriteAltruist = 269, 610 | SpriteEnemy = 270, 611 | SpriteChop = 273, 612 | SpriteDead = 274, 613 | SpriteHooker = 279, 614 | SpriteFriend = 280, 615 | SpriteBountyHit = 303, 616 | SpriteGTAOMission = 304, 617 | SpriteGTAOSurvival = 305, 618 | SpriteCrateDrop = 306, 619 | SpritePlaneDrop = 307, 620 | SpriteSub = 308, 621 | SpriteRace = 309, 622 | SpriteDeathmatch = 310, 623 | SpriteArmWrestling = 311, 624 | SpriteAmmuNationShootingRange = 313, 625 | SpriteRaceAir = 314, 626 | SpriteRaceCar = 315, 627 | SpriteRaceSea = 316, 628 | SpriteGarbageTruck = 318, 629 | SpriteMotorCycle = 348, 630 | SpriteSafehouseForSale = 350, 631 | SpritePackage = 351, 632 | SpriteMartinMadrazo = 352, 633 | SpriteEnemyHelicopter = 353, 634 | SpriteBoost = 354, 635 | SpriteDevin = 355, 636 | SpriteMarina = 356, 637 | SpriteGarage = 357, 638 | SpriteGolfFlag = 358, 639 | SpriteHangar = 359, 640 | SpriteHelipad = 360, 641 | SpriteJerryCan = 361, 642 | SpriteMasks = 362, 643 | SpriteHeistSetup = 363, 644 | SpriteIncapacitated = 364, 645 | SpritePickupSpawn = 365, 646 | SpriteBoilerSuit = 366, 647 | SpriteCompleted = 367, 648 | SpriteRockets = 368, 649 | SpriteGarageForSale = 369, 650 | SpriteHelipadForSale = 370, 651 | SpriteMarinaForSale = 371, 652 | SpriteHangarForSale = 372, 653 | SpriteBusiness = 374, 654 | SpriteBusinessForSale = 375, 655 | SpriteRaceBike = 376, 656 | SpriteParachute = 377, 657 | SpriteTeamDeathmatch = 378, 658 | SpriteRaceFoot = 379, 659 | SpriteVehicleDeathmatch = 380, 660 | SpriteBarry = 381, 661 | SpriteDom = 382, 662 | SpriteMaryAnn = 383, 663 | SpriteCletus = 384, 664 | SpriteJosh = 385, 665 | SpriteMinute = 386, 666 | SpriteOmega = 387, 667 | SpriteTonya = 388, 668 | SpritePaparazzo = 389, 669 | SpriteCrosshair = 390, 670 | SpriteCreator = 398, 671 | SpriteCreatorDirection = 399, 672 | SpriteAbigail = 400, 673 | SpriteBlimp = 401, 674 | SpriteRepair = 402, 675 | SpriteTestosterone = 403, 676 | SpriteDinghy = 404, 677 | SpriteFanatic = 405, 678 | SpriteInformation = 407, 679 | SpriteCaptureBriefcase = 408, 680 | SpriteLastTeamStanding = 409, 681 | SpriteBoat = 410, 682 | SpriteCaptureHouse = 411, 683 | SpriteJerryCan2 = 415, 684 | SpriteRP = 416, 685 | SpriteGTAOPlayerSafehouse = 417, 686 | SpriteGTAOPlayerSafehouseDead = 418, 687 | SpriteCaptureAmericanFlag = 419, 688 | SpriteCaptureFlag = 420, 689 | SpriteTank = 421, 690 | SpriteHelicopterAnimated = 422, 691 | SpritePlane = 423, 692 | SpriteJet2 = 424, 693 | SpritePlayerNoColor = 425, 694 | SpriteGunCar = 426, 695 | SpriteSpeedboat = 427, 696 | SpriteHeist = 428, 697 | SpriteStopwatch = 430, 698 | SpriteDollarSignCircled = 431, 699 | SpriteCrosshair2 = 432, 700 | SpriteDollarSignSquared = 434, 701 | }; 702 | 703 | enum eCameraShake 704 | { 705 | CameraShakeHand = 0, 706 | CameraShakeSmallExplosion, 707 | CameraShakeMediumExplosion, 708 | CameraShakeLargeExplosion, 709 | CameraShakeJolt, 710 | CameraShakeVibrate, 711 | CameraShakeRoadVibration, 712 | CameraShakeDrunk, 713 | CameraShakeSkyDiving, 714 | CameraShakeFamilyDrugTrip, 715 | CameraShakeDeathFail 716 | }; 717 | 718 | enum eControl 719 | { 720 | ControlNextCamera = 0, 721 | ControlLookLeftRight = 1, 722 | ControlLookUpDown = 2, 723 | ControlLookUpOnly = 3, 724 | ControlLookDownOnly = 4, 725 | ControlLookLeftOnly = 5, 726 | ControlLookRightOnly = 6, 727 | ControlCinematicSlowMo = 7, 728 | ControlFlyUpDown = 8, 729 | ControlFlyLeftRight = 9, 730 | ControlScriptedFlyZUp = 10, 731 | ControlScriptedFlyZDown = 11, 732 | ControlWeaponWheelUpDown = 12, 733 | ControlWeaponWheelLeftRight = 13, 734 | ControlWeaponWheelNext = 14, 735 | ControlWeaponWheelPrev = 15, 736 | ControlSelectNextWeapon = 16, 737 | ControlSelectPrevWeapon = 17, 738 | ControlSkipCutscene = 18, 739 | ControlCharacterWheel = 19, 740 | ControlMultiplayerInfo = 20, 741 | ControlSprint = 21, 742 | ControlJump = 22, 743 | ControlEnter = 23, 744 | ControlAttack = 24, 745 | ControlAim = 25, 746 | ControlLookBehind = 26, 747 | ControlPhone = 27, 748 | ControlSpecialAbility = 28, 749 | ControlSpecialAbilitySecondary = 29, 750 | ControlMoveLeftRight = 30, 751 | ControlMoveUpDown = 31, 752 | ControlMoveUpOnly = 32, 753 | ControlMoveDownOnly = 33, 754 | ControlMoveLeftOnly = 34, 755 | ControlMoveRightOnly = 35, 756 | ControlDuck = 36, 757 | ControlSelectWeapon = 37, 758 | ControlPickup = 38, 759 | ControlSniperZoom = 39, 760 | ControlSniperZoomInOnly = 40, 761 | ControlSniperZoomOutOnly = 41, 762 | ControlSniperZoomInSecondary = 42, 763 | ControlSniperZoomOutSecondary = 43, 764 | ControlCover = 44, 765 | ControlReload = 45, 766 | ControlTalk = 46, 767 | ControlDetonate = 47, 768 | ControlHUDSpecial = 48, 769 | ControlArrest = 49, 770 | ControlAccurateAim = 50, 771 | ControlContext = 51, 772 | ControlContextSecondary = 52, 773 | ControlWeaponSpecial = 53, 774 | ControlWeaponSpecial2 = 54, 775 | ControlDive = 55, 776 | ControlDropWeapon = 56, 777 | ControlDropAmmo = 57, 778 | ControlThrowGrenade = 58, 779 | ControlVehicleMoveLeftRight = 59, 780 | ControlVehicleMoveUpDown = 60, 781 | ControlVehicleMoveUpOnly = 61, 782 | ControlVehicleMoveDownOnly = 62, 783 | ControlVehicleMoveLeftOnly = 63, 784 | ControlVehicleMoveRightOnly = 64, 785 | ControlVehicleSpecial = 65, 786 | ControlVehicleGunLeftRight = 66, 787 | ControlVehicleGunUpDown = 67, 788 | ControlVehicleAim = 68, 789 | ControlVehicleAttack = 69, 790 | ControlVehicleAttack2 = 70, 791 | ControlVehicleAccelerate = 71, 792 | ControlVehicleBrake = 72, 793 | ControlVehicleDuck = 73, 794 | ControlVehicleHeadlight = 74, 795 | ControlVehicleExit = 75, 796 | ControlVehicleHandbrake = 76, 797 | ControlVehicleHotwireLeft = 77, 798 | ControlVehicleHotwireRight = 78, 799 | ControlVehicleLookBehind = 79, 800 | ControlVehicleCinCam = 80, 801 | ControlVehicleNextRadio = 81, 802 | ControlVehiclePrevRadio = 82, 803 | ControlVehicleNextRadioTrack = 83, 804 | ControlVehiclePrevRadioTrack = 84, 805 | ControlVehicleRadioWheel = 85, 806 | ControlVehicleHorn = 86, 807 | ControlVehicleFlyThrottleUp = 87, 808 | ControlVehicleFlyThrottleDown = 88, 809 | ControlVehicleFlyYawLeft = 89, 810 | ControlVehicleFlyYawRight = 90, 811 | ControlVehiclePassengerAim = 91, 812 | ControlVehiclePassengerAttack = 92, 813 | ControlVehicleSpecialAbilityFranklin = 93, 814 | ControlVehicleStuntUpDown = 94, 815 | ControlVehicleCinematicUpDown = 95, 816 | ControlVehicleCinematicUpOnly = 96, 817 | ControlVehicleCinematicDownOnly = 97, 818 | ControlVehicleCinematicLeftRight = 98, 819 | ControlVehicleSelectNextWeapon = 99, 820 | ControlVehicleSelectPrevWeapon = 100, 821 | ControlVehicleRoof = 101, 822 | ControlVehicleJump = 102, 823 | ControlVehicleGrapplingHook = 103, 824 | ControlVehicleShuffle = 104, 825 | ControlVehicleDropProjectile = 105, 826 | ControlVehicleMouseControlOverride = 106, 827 | ControlVehicleFlyRollLeftRight = 107, 828 | ControlVehicleFlyRollLeftOnly = 108, 829 | ControlVehicleFlyRollRightOnly = 109, 830 | ControlVehicleFlyPitchUpDown = 110, 831 | ControlVehicleFlyPitchUpOnly = 111, 832 | ControlVehicleFlyPitchDownOnly = 112, 833 | ControlVehicleFlyUnderCarriage = 113, 834 | ControlVehicleFlyAttack = 114, 835 | ControlVehicleFlySelectNextWeapon = 115, 836 | ControlVehicleFlySelectPrevWeapon = 116, 837 | ControlVehicleFlySelectTargetLeft = 117, 838 | ControlVehicleFlySelectTargetRight = 118, 839 | ControlVehicleFlyVerticalFlightMode = 119, 840 | ControlVehicleFlyDuck = 120, 841 | ControlVehicleFlyAttackCamera = 121, 842 | ControlVehicleFlyMouseControlOverride = 122, 843 | ControlVehicleSubTurnLeftRight = 123, 844 | ControlVehicleSubTurnLeftOnly = 124, 845 | ControlVehicleSubTurnRightOnly = 125, 846 | ControlVehicleSubPitchUpDown = 126, 847 | ControlVehicleSubPitchUpOnly = 127, 848 | ControlVehicleSubPitchDownOnly = 128, 849 | ControlVehicleSubThrottleUp = 129, 850 | ControlVehicleSubThrottleDown = 130, 851 | ControlVehicleSubAscend = 131, 852 | ControlVehicleSubDescend = 132, 853 | ControlVehicleSubTurnHardLeft = 133, 854 | ControlVehicleSubTurnHardRight = 134, 855 | ControlVehicleSubMouseControlOverride = 135, 856 | ControlVehiclePushbikePedal = 136, 857 | ControlVehiclePushbikeSprint = 137, 858 | ControlVehiclePushbikeFrontBrake = 138, 859 | ControlVehiclePushbikeRearBrake = 139, 860 | ControlMeleeAttackLight = 140, 861 | ControlMeleeAttackHeavy = 141, 862 | ControlMeleeAttackAlternate = 142, 863 | ControlMeleeBlock = 143, 864 | ControlParachuteDeploy = 144, 865 | ControlParachuteDetach = 145, 866 | ControlParachuteTurnLeftRight = 146, 867 | ControlParachuteTurnLeftOnly = 147, 868 | ControlParachuteTurnRightOnly = 148, 869 | ControlParachutePitchUpDown = 149, 870 | ControlParachutePitchUpOnly = 150, 871 | ControlParachutePitchDownOnly = 151, 872 | ControlParachuteBrakeLeft = 152, 873 | ControlParachuteBrakeRight = 153, 874 | ControlParachuteSmoke = 154, 875 | ControlParachutePrecisionLanding = 155, 876 | ControlMap = 156, 877 | ControlSelectWeaponUnarmed = 157, 878 | ControlSelectWeaponMelee = 158, 879 | ControlSelectWeaponHandgun = 159, 880 | ControlSelectWeaponShotgun = 160, 881 | ControlSelectWeaponSmg = 161, 882 | ControlSelectWeaponAutoRifle = 162, 883 | ControlSelectWeaponSniper = 163, 884 | ControlSelectWeaponHeavy = 164, 885 | ControlSelectWeaponSpecial = 165, 886 | ControlSelectCharacterMichael = 166, 887 | ControlSelectCharacterFranklin = 167, 888 | ControlSelectCharacterTrevor = 168, 889 | ControlSelectCharacterMultiplayer = 169, 890 | ControlSaveReplayClip = 170, 891 | ControlSpecialAbilityPC = 171, 892 | ControlPhoneUp = 172, 893 | ControlPhoneDown = 173, 894 | ControlPhoneLeft = 174, 895 | ControlPhoneRight = 175, 896 | ControlPhoneSelect = 176, 897 | ControlPhoneCancel = 177, 898 | ControlPhoneOption = 178, 899 | ControlPhoneExtraOption = 179, 900 | ControlPhoneScrollForward = 180, 901 | ControlPhoneScrollBackward = 181, 902 | ControlPhoneCameraFocusLock = 182, 903 | ControlPhoneCameraGrid = 183, 904 | ControlPhoneCameraSelfie = 184, 905 | ControlPhoneCameraDOF = 185, 906 | ControlPhoneCameraExpression = 186, 907 | ControlFrontendDown = 187, 908 | ControlFrontendUp = 188, 909 | ControlFrontendLeft = 189, 910 | ControlFrontendRight = 190, 911 | ControlFrontendRdown = 191, 912 | ControlFrontendRup = 192, 913 | ControlFrontendRleft = 193, 914 | ControlFrontendRright = 194, 915 | ControlFrontendAxisX = 195, 916 | ControlFrontendAxisY = 196, 917 | ControlFrontendRightAxisX = 197, 918 | ControlFrontendRightAxisY = 198, 919 | ControlFrontendPause = 199, 920 | ControlFrontendPauseAlternate = 200, 921 | ControlFrontendAccept = 201, 922 | ControlFrontendCancel = 202, 923 | ControlFrontendX = 203, 924 | ControlFrontendY = 204, 925 | ControlFrontendLb = 205, 926 | ControlFrontendRb = 206, 927 | ControlFrontendLt = 207, 928 | ControlFrontendRt = 208, 929 | ControlFrontendLs = 209, 930 | ControlFrontendRs = 210, 931 | ControlFrontendLeaderboard = 211, 932 | ControlFrontendSocialClub = 212, 933 | ControlFrontendSocialClubSecondary = 213, 934 | ControlFrontendDelete = 214, 935 | ControlFrontendEndscreenAccept = 215, 936 | ControlFrontendEndscreenExpand = 216, 937 | ControlFrontendSelect = 217, 938 | ControlScriptLeftAxisX = 218, 939 | ControlScriptLeftAxisY = 219, 940 | ControlScriptRightAxisX = 220, 941 | ControlScriptRightAxisY = 221, 942 | ControlScriptRUp = 222, 943 | ControlScriptRDown = 223, 944 | ControlScriptRLeft = 224, 945 | ControlScriptRRight = 225, 946 | ControlScriptLB = 226, 947 | ControlScriptRB = 227, 948 | ControlScriptLT = 228, 949 | ControlScriptRT = 229, 950 | ControlScriptLS = 230, 951 | ControlScriptRS = 231, 952 | ControlScriptPadUp = 232, 953 | ControlScriptPadDown = 233, 954 | ControlScriptPadLeft = 234, 955 | ControlScriptPadRight = 235, 956 | ControlScriptSelect = 236, 957 | ControlCursorAccept = 237, 958 | ControlCursorCancel = 238, 959 | ControlCursorX = 239, 960 | ControlCursorY = 240, 961 | ControlCursorScrollUp = 241, 962 | ControlCursorScrollDown = 242, 963 | ControlEnterCheatCode = 243, 964 | ControlInteractionMenu = 244, 965 | ControlMpTextChatAll = 245, 966 | ControlMpTextChatTeam = 246, 967 | ControlMpTextChatFriends = 247, 968 | ControlMpTextChatCrew = 248, 969 | ControlPushToTalk = 249, 970 | ControlCreatorLS = 250, 971 | ControlCreatorRS = 251, 972 | ControlCreatorLT = 252, 973 | ControlCreatorRT = 253, 974 | ControlCreatorMenuToggle = 254, 975 | ControlCreatorAccept = 255, 976 | ControlCreatorDelete = 256, 977 | ControlAttack2 = 257, 978 | ControlRappelJump = 258, 979 | ControlRappelLongJump = 259, 980 | ControlRappelSmashWindow = 260, 981 | ControlPrevWeapon = 261, 982 | ControlNextWeapon = 262, 983 | ControlMeleeAttack1 = 263, 984 | ControlMeleeAttack2 = 264, 985 | ControlWhistle = 265, 986 | ControlMoveLeft = 266, 987 | ControlMoveRight = 267, 988 | ControlMoveUp = 268, 989 | ControlMoveDown = 269, 990 | ControlLookLeft = 270, 991 | ControlLookRight = 271, 992 | ControlLookUp = 272, 993 | ControlLookDown = 273, 994 | ControlSniperZoomIn = 274, 995 | ControlSniperZoomOut = 275, 996 | ControlSniperZoomInAlternate = 276, 997 | ControlSniperZoomOutAlternate = 277, 998 | ControlVehicleMoveLeft = 278, 999 | ControlVehicleMoveRight = 279, 1000 | ControlVehicleMoveUp = 280, 1001 | ControlVehicleMoveDown = 281, 1002 | ControlVehicleGunLeft = 282, 1003 | ControlVehicleGunRight = 283, 1004 | ControlVehicleGunUp = 284, 1005 | ControlVehicleGunDown = 285, 1006 | ControlVehicleLookLeft = 286, 1007 | ControlVehicleLookRight = 287, 1008 | ControlReplayStartStopRecording = 288, 1009 | ControlReplayStartStopRecordingSecondary = 289, 1010 | ControlScaledLookLeftRight = 290, 1011 | ControlScaledLookUpDown = 291, 1012 | ControlScaledLookUpOnly = 292, 1013 | ControlScaledLookDownOnly = 293, 1014 | ControlScaledLookLeftOnly = 294, 1015 | ControlScaledLookRightOnly = 295, 1016 | ControlReplayMarkerDelete = 296, 1017 | ControlReplayClipDelete = 297, 1018 | ControlReplayPause = 298, 1019 | ControlReplayRewind = 299, 1020 | ControlReplayFfwd = 300, 1021 | ControlReplayNewmarker = 301, 1022 | ControlReplayRecord = 302, 1023 | ControlReplayScreenshot = 303, 1024 | ControlReplayHidehud = 304, 1025 | ControlReplayStartpoint = 305, 1026 | ControlReplayEndpoint = 306, 1027 | ControlReplayAdvance = 307, 1028 | ControlReplayBack = 308, 1029 | ControlReplayTools = 309, 1030 | ControlReplayRestart = 310, 1031 | ControlReplayShowhotkey = 311, 1032 | ControlReplayCycleMarkerLeft = 312, 1033 | ControlReplayCycleMarkerRight = 313, 1034 | ControlReplayFOVIncrease = 314, 1035 | ControlReplayFOVDecrease = 315, 1036 | ControlReplayCameraUp = 316, 1037 | ControlReplayCameraDown = 317, 1038 | ControlReplaySave = 318, 1039 | ControlReplayToggletime = 319, 1040 | ControlReplayToggletips = 320, 1041 | ControlReplayPreview = 321, 1042 | ControlReplayToggleTimeline = 322, 1043 | ControlReplayTimelinePickupClip = 323, 1044 | ControlReplayTimelineDuplicateClip = 324, 1045 | ControlReplayTimelinePlaceClip = 325, 1046 | ControlReplayCtrl = 326, 1047 | ControlReplayTimelineSave = 327, 1048 | ControlReplayPreviewAudio = 328, 1049 | ControlVehicleDriveLook = 329, 1050 | ControlVehicleDriveLook2 = 330, 1051 | ControlVehicleFlyAttack2 = 331, 1052 | ControlRadioWheelUpDown = 332, 1053 | ControlRadioWheelLeftRight = 333, 1054 | ControlVehicleSlowMoUpDown = 334, 1055 | ControlVehicleSlowMoUpOnly = 335, 1056 | ControlVehicleSlowMoDownOnly = 336, 1057 | ControlMapPointOfInterest = 337, 1058 | }; 1059 | 1060 | enum eRadioStation 1061 | { 1062 | RadioStationLosSantosRockRadio, 1063 | RadioStationNonStopPopFM, 1064 | RadioStationLosSantos, 1065 | RadioStationChannelX, 1066 | RadioStationWestCoastTalkRadio, 1067 | RadioStationRebelRadio, 1068 | RadioStationSoulwaxFM, 1069 | RadioStationEastLosFM, 1070 | RadioStationWestCoastClassics, 1071 | RadioStationTheBlueArk, 1072 | RadioStationWorldWideFM, 1073 | RadioStationFlyloFM, 1074 | RadioStationTheLowdown, 1075 | RadioStationTheLab, 1076 | RadioStationMirrorPark, 1077 | RadioStationSpace, 1078 | RadioStationVinewoodBoulevardRadio, 1079 | }; 1080 | 1081 | enum eWindowTitle 1082 | { 1083 | CELL_EMAIL_BOD, 1084 | CELL_EMAIL_BODE, 1085 | CELL_EMAIL_BODF, 1086 | CELL_EMAIL_SOD, 1087 | CELL_EMAIL_SODE, 1088 | CELL_EMAIL_SODF, 1089 | CELL_EMASH_BOD, 1090 | CELL_EMASH_BODE, 1091 | CELL_EMASH_BODF, 1092 | CELL_EMASH_SOD, 1093 | CELL_EMASH_SODE, 1094 | CELL_EMASH_SODF, 1095 | FMMC_KEY_TIP10, 1096 | FMMC_KEY_TIP12, 1097 | FMMC_KEY_TIP12F, 1098 | FMMC_KEY_TIP12N, 1099 | FMMC_KEY_TIP8, 1100 | FMMC_KEY_TIP8F, 1101 | FMMC_KEY_TIP8FS, 1102 | FMMC_KEY_TIP8S, 1103 | FMMC_KEY_TIP9, 1104 | FMMC_KEY_TIP9F, 1105 | FMMC_KEY_TIP9N, 1106 | PM_NAME_CHALL, 1107 | }; 1108 | 1109 | enum eGender 1110 | { 1111 | GenderMale, 1112 | GenderFemale 1113 | }; 1114 | 1115 | enum eDrivingStyle 1116 | { 1117 | DrivingStyleNormal = 0xC00AB, 1118 | DrivingStyleIgnoreLights = 0x2C0025, 1119 | DrivingStyleSometimesOvertakeTraffic = 5, 1120 | DrivingStyleRushed = 0x400C0025, 1121 | DrivingStyleAvoidTraffic = 0xC0024, 1122 | DrivingStyleAvoidTrafficExtremely = 6 1123 | }; 1124 | 1125 | enum eBone 1126 | { 1127 | SKEL_ROOT = 0x0, 1128 | SKEL_Pelvis = 0x2e28, 1129 | SKEL_L_Thigh = 0xe39f, 1130 | SKEL_L_Calf = 0xf9bb, 1131 | SKEL_L_Foot = 0x3779, 1132 | SKEL_L_Toe0 = 0x83c, 1133 | IK_L_Foot = 0xfedd, 1134 | PH_L_Foot = 0xe175, 1135 | MH_L_Knee = 0xb3fe, 1136 | SKEL_R_Thigh = 0xca72, 1137 | SKEL_R_Calf = 0x9000, 1138 | SKEL_R_Foot = 0xcc4d, 1139 | SKEL_R_Toe0 = 0x512d, 1140 | IK_R_Foot = 0x8aae, 1141 | PH_R_Foot = 0x60e6, 1142 | MH_R_Knee = 0x3fcf, 1143 | RB_L_ThighRoll = 0x5c57, 1144 | RB_R_ThighRoll = 0x192a, 1145 | SKEL_Spine_Root = 0xe0fd, 1146 | SKEL_Spine0 = 0x5c01, 1147 | SKEL_Spine1 = 0x60f0, 1148 | SKEL_Spine2 = 0x60f1, 1149 | SKEL_Spine3 = 0x60f2, 1150 | SKEL_L_Clavicle = 0xfcd9, 1151 | SKEL_L_UpperArm = 0xb1c5, 1152 | SKEL_L_Forearm = 0xeeeb, 1153 | SKEL_L_Hand = 0x49d9, 1154 | SKEL_L_Finger00 = 0x67f2, 1155 | SKEL_L_Finger01 = 0xff9, 1156 | SKEL_L_Finger02 = 0xffa, 1157 | SKEL_L_Finger10 = 0x67f3, 1158 | SKEL_L_Finger11 = 0x1049, 1159 | SKEL_L_Finger12 = 0x104a, 1160 | SKEL_L_Finger20 = 0x67f4, 1161 | SKEL_L_Finger21 = 0x1059, 1162 | SKEL_L_Finger22 = 0x105a, 1163 | SKEL_L_Finger30 = 0x67f5, 1164 | SKEL_L_Finger31 = 0x1029, 1165 | SKEL_L_Finger32 = 0x102a, 1166 | SKEL_L_Finger40 = 0x67f6, 1167 | SKEL_L_Finger41 = 0x1039, 1168 | SKEL_L_Finger42 = 0x103a, 1169 | PH_L_Hand = 0xeb95, 1170 | IK_L_Hand = 0x8cbd, 1171 | RB_L_ForeArmRoll = 0xee4f, 1172 | RB_L_ArmRoll = 0x1470, 1173 | MH_L_Elbow = 0x58b7, 1174 | SKEL_R_Clavicle = 0x29d2, 1175 | SKEL_R_UpperArm = 0x9d4d, 1176 | SKEL_R_Forearm = 0x6e5c, 1177 | SKEL_R_Hand = 0xdead, 1178 | SKEL_R_Finger00 = 0xe5f2, 1179 | SKEL_R_Finger01 = 0xfa10, 1180 | SKEL_R_Finger02 = 0xfa11, 1181 | SKEL_R_Finger10 = 0xe5f3, 1182 | SKEL_R_Finger11 = 0xfa60, 1183 | SKEL_R_Finger12 = 0xfa61, 1184 | SKEL_R_Finger20 = 0xe5f4, 1185 | SKEL_R_Finger21 = 0xfa70, 1186 | SKEL_R_Finger22 = 0xfa71, 1187 | SKEL_R_Finger30 = 0xe5f5, 1188 | SKEL_R_Finger31 = 0xfa40, 1189 | SKEL_R_Finger32 = 0xfa41, 1190 | SKEL_R_Finger40 = 0xe5f6, 1191 | SKEL_R_Finger41 = 0xfa50, 1192 | SKEL_R_Finger42 = 0xfa51, 1193 | PH_R_Hand = 0x6f06, 1194 | IK_R_Hand = 0x188e, 1195 | RB_R_ForeArmRoll = 0xab22, 1196 | RB_R_ArmRoll = 0x90ff, 1197 | MH_R_Elbow = 0xbb0, 1198 | SKEL_Neck_1 = 0x9995, 1199 | SKEL_Head = 0x796e, 1200 | IK_Head = 0x322c, 1201 | FACIAL_facialRoot = 0xfe2c, 1202 | FB_L_Brow_Out_000 = 0xe3db, 1203 | FB_L_Lid_Upper_000 = 0xb2b6, 1204 | FB_L_Eye_000 = 0x62ac, 1205 | FB_L_CheekBone_000 = 0x542e, 1206 | FB_L_Lip_Corner_000 = 0x74ac, 1207 | FB_R_Lid_Upper_000 = 0xaa10, 1208 | FB_R_Eye_000 = 0x6b52, 1209 | FB_R_CheekBone_000 = 0x4b88, 1210 | FB_R_Brow_Out_000 = 0x54c, 1211 | FB_R_Lip_Corner_000 = 0x2ba6, 1212 | FB_Brow_Centre_000 = 0x9149, 1213 | FB_UpperLipRoot_000 = 0x4ed2, 1214 | FB_UpperLip_000 = 0xf18f, 1215 | FB_L_Lip_Top_000 = 0x4f37, 1216 | FB_R_Lip_Top_000 = 0x4537, 1217 | FB_Jaw_000 = 0xb4a0, 1218 | FB_LowerLipRoot_000 = 0x4324, 1219 | FB_LowerLip_000 = 0x508f, 1220 | FB_L_Lip_Bot_000 = 0xb93b, 1221 | FB_R_Lip_Bot_000 = 0xc33b, 1222 | FB_Tongue_000 = 0xb987, 1223 | RB_Neck_1 = 0x8b93, 1224 | IK_Root = 0xdd1c 1225 | }; 1226 | 1227 | enum eFiringPattern : DWORD 1228 | { 1229 | FiringPatternFullAuto = 0xC6EE6B4C, 1230 | FiringPatternBurstFire = 0xD6FF6D61, 1231 | FiringPatternBurstInCover = 0x026321F1, 1232 | FiringPatternBurstFireDriveby = 0xD31265F2, 1233 | FiringPatternFromGround = 0x2264E5D6, 1234 | FiringPatternDelayFireByOneSec = 0x7A845691, 1235 | FiringPatternSingleShot = 0x5D60E4E0, 1236 | FiringPatternBurstFirePistol = 0xA018DB8A, 1237 | FiringPatternBurstFireSMG = 0xD10DADEE, 1238 | FiringPatternBurstFireRifle = 0x9C74B406, 1239 | FiringPatternBurstFireMG = 0xB573C5B4, 1240 | FiringPatternBurstFirePumpShotGun = 0x00BAC39B, 1241 | FiringPatternBurstFireHeli = 0x914E786F, 1242 | FiringPatternBurstFireMicro = 0x42EF03FD, 1243 | FiringPatternBurstFireBursts = 0x42EF03FD, 1244 | FiringPatternBurstFireTank = 0xE2CA3A71 1245 | }; 1246 | 1247 | enum eFont 1248 | { 1249 | FontChaletLondon = 0, 1250 | FontHouseScript = 1, 1251 | FontMonospace = 2, 1252 | FontWingDings = 3, 1253 | FontChaletComprimeCologne = 4, 1254 | FontPricedown = 7 1255 | }; 1256 | 1257 | enum eVehicleColor 1258 | { 1259 | VehicleColorMetallicBlack = 0, 1260 | VehicleColorMetallicGraphiteBlack = 1, 1261 | VehicleColorMetallicBlackSteel = 2, 1262 | VehicleColorMetallicDarkSilver = 3, 1263 | VehicleColorMetallicSilver = 4, 1264 | VehicleColorMetallicBlueSilver = 5, 1265 | VehicleColorMetallicSteelGray = 6, 1266 | VehicleColorMetallicShadowSilver = 7, 1267 | VehicleColorMetallicStoneSilver = 8, 1268 | VehicleColorMetallicMidnightSilver = 9, 1269 | VehicleColorMetallicGunMetal = 10, 1270 | VehicleColorMetallicAnthraciteGray = 11, 1271 | VehicleColorMatteBlack = 12, 1272 | VehicleColorMatteGray = 13, 1273 | VehicleColorMatteLightGray = 14, 1274 | VehicleColorUtilBlack = 15, 1275 | VehicleColorUtilBlackPoly = 16, 1276 | VehicleColorUtilDarksilver = 17, 1277 | VehicleColorUtilSilver = 18, 1278 | VehicleColorUtilGunMetal = 19, 1279 | VehicleColorUtilShadowSilver = 20, 1280 | VehicleColorWornBlack = 21, 1281 | VehicleColorWornGraphite = 22, 1282 | VehicleColorWornSilverGray = 23, 1283 | VehicleColorWornSilver = 24, 1284 | VehicleColorWornBlueSilver = 25, 1285 | VehicleColorWornShadowSilver = 26, 1286 | VehicleColorMetallicRed = 27, 1287 | VehicleColorMetallicTorinoRed = 28, 1288 | VehicleColorMetallicFormulaRed = 29, 1289 | VehicleColorMetallicBlazeRed = 30, 1290 | VehicleColorMetallicGracefulRed = 31, 1291 | VehicleColorMetallicGarnetRed = 32, 1292 | VehicleColorMetallicDesertRed = 33, 1293 | VehicleColorMetallicCabernetRed = 34, 1294 | VehicleColorMetallicCandyRed = 35, 1295 | VehicleColorMetallicSunriseOrange = 36, 1296 | VehicleColorMetallicClassicGold = 37, 1297 | VehicleColorMetallicOrange = 38, 1298 | VehicleColorMatteRed = 39, 1299 | VehicleColorMatteDarkRed = 40, 1300 | VehicleColorMatteOrange = 41, 1301 | VehicleColorMatteYellow = 42, 1302 | VehicleColorUtilRed = 43, 1303 | VehicleColorUtilBrightRed = 44, 1304 | VehicleColorUtilGarnetRed = 45, 1305 | VehicleColorWornRed = 46, 1306 | VehicleColorWornGoldenRed = 47, 1307 | VehicleColorWornDarkRed = 48, 1308 | VehicleColorMetallicDarkGreen = 49, 1309 | VehicleColorMetallicRacingGreen = 50, 1310 | VehicleColorMetallicSeaGreen = 51, 1311 | VehicleColorMetallicOliveGreen = 52, 1312 | VehicleColorMetallicGreen = 53, 1313 | VehicleColorMetallicGasolineBlueGreen = 54, 1314 | VehicleColorMatteLimeGreen = 55, 1315 | VehicleColorUtilDarkGreen = 56, 1316 | VehicleColorUtilGreen = 57, 1317 | VehicleColorWornDarkGreen = 58, 1318 | VehicleColorWornGreen = 59, 1319 | VehicleColorWornSeaWash = 60, 1320 | VehicleColorMetallicMidnightBlue = 61, 1321 | VehicleColorMetallicDarkBlue = 62, 1322 | VehicleColorMetallicSaxonyBlue = 63, 1323 | VehicleColorMetallicBlue = 64, 1324 | VehicleColorMetallicMarinerBlue = 65, 1325 | VehicleColorMetallicHarborBlue = 66, 1326 | VehicleColorMetallicDiamondBlue = 67, 1327 | VehicleColorMetallicSurfBlue = 68, 1328 | VehicleColorMetallicNauticalBlue = 69, 1329 | VehicleColorMetallicBrightBlue = 70, 1330 | VehicleColorMetallicPurpleBlue = 71, 1331 | VehicleColorMetallicSpinnakerBlue = 72, 1332 | VehicleColorMetallicUltraBlue = 73, 1333 | VehicleColorUtilDarkBlue = 75, 1334 | VehicleColorUtilMidnightBlue = 76, 1335 | VehicleColorUtilBlue = 77, 1336 | VehicleColorUtilSeaFoamBlue = 78, 1337 | VehicleColorUtilLightningBlue = 79, 1338 | VehicleColorUtilMauiBluePoly = 80, 1339 | VehicleColorUtilBrightBlue = 81, 1340 | VehicleColorMatteDarkBlue = 82, 1341 | VehicleColorMatteBlue = 83, 1342 | VehicleColorMatteMidnightBlue = 84, 1343 | VehicleColorWornDarkBlue = 85, 1344 | VehicleColorWornBlue = 86, 1345 | VehicleColorWornLightBlue = 87, 1346 | VehicleColorMetallicTaxiYellow = 88, 1347 | VehicleColorMetallicRaceYellow = 89, 1348 | VehicleColorMetallicBronze = 90, 1349 | VehicleColorMetallicYellowBird = 91, 1350 | VehicleColorMetallicLime = 92, 1351 | VehicleColorMetallicChampagne = 93, 1352 | VehicleColorMetallicPuebloBeige = 94, 1353 | VehicleColorMetallicDarkIvory = 95, 1354 | VehicleColorMetallicChocoBrown = 96, 1355 | VehicleColorMetallicGoldenBrown = 97, 1356 | VehicleColorMetallicLightBrown = 98, 1357 | VehicleColorMetallicStrawBeige = 99, 1358 | VehicleColorMetallicMossBrown = 100, 1359 | VehicleColorMetallicBistonBrown = 101, 1360 | VehicleColorMetallicBeechwood = 102, 1361 | VehicleColorMetallicDarkBeechwood = 103, 1362 | VehicleColorMetallicChocoOrange = 104, 1363 | VehicleColorMetallicBeachSand = 105, 1364 | VehicleColorMetallicSunBleechedSand = 106, 1365 | VehicleColorMetallicCream = 107, 1366 | VehicleColorUtilBrown = 108, 1367 | VehicleColorUtilMediumBrown = 109, 1368 | VehicleColorUtilLightBrown = 110, 1369 | VehicleColorMetallicWhite = 111, 1370 | VehicleColorMetallicFrostWhite = 112, 1371 | VehicleColorWornHoneyBeige = 113, 1372 | VehicleColorWornBrown = 114, 1373 | VehicleColorWornDarkBrown = 115, 1374 | VehicleColorWornStrawBeige = 116, 1375 | VehicleColorBrushedSteel = 117, 1376 | VehicleColorBrushedBlackSteel = 118, 1377 | VehicleColorBrushedAluminium = 119, 1378 | VehicleColorChrome = 120, 1379 | VehicleColorWornOffWhite = 121, 1380 | VehicleColorUtilOffWhite = 122, 1381 | VehicleColorWornOrange = 123, 1382 | VehicleColorWornLightOrange = 124, 1383 | VehicleColorMetallicSecuricorGreen = 125, 1384 | VehicleColorWornTaxiYellow = 126, 1385 | VehicleColorPoliceCarBlue = 127, 1386 | VehicleColorMatteGreen = 128, 1387 | VehicleColorMatteBrown = 129, 1388 | VehicleColorMatteWhite = 131, 1389 | VehicleColorWornWhite = 132, 1390 | VehicleColorWornOliveArmyGreen = 133, 1391 | VehicleColorPureWhite = 134, 1392 | VehicleColorHotPink = 135, 1393 | VehicleColorSalmonpink = 136, 1394 | VehicleColorMetallicVermillionPink = 137, 1395 | VehicleColorOrange = 138, 1396 | VehicleColorGreen = 139, 1397 | VehicleColorBlue = 140, 1398 | VehicleColorMettalicBlackBlue = 141, 1399 | VehicleColorMetallicBlackPurple = 142, 1400 | VehicleColorMetallicBlackRed = 143, 1401 | VehicleColorHunterGreen = 144, 1402 | VehicleColorMetallicPurple = 145, 1403 | VehicleColorMetaillicVDarkBlue = 146, 1404 | VehicleColorModshopBlack1 = 147, 1405 | VehicleColorMattePurple = 148, 1406 | VehicleColorMatteDarkPurple = 149, 1407 | VehicleColorMetallicLavaRed = 150, 1408 | VehicleColorMatteForestGreen = 151, 1409 | VehicleColorMatteOliveDrab = 152, 1410 | VehicleColorMatteDesertBrown = 153, 1411 | VehicleColorMatteDesertTan = 154, 1412 | VehicleColorMatteFoliageGreen = 155, 1413 | VehicleColorDefaultAlloyColor = 156, 1414 | VehicleColorEpsilonBlue = 157, 1415 | VehicleColorPureGold = 158, 1416 | VehicleColorBrushedGold = 159, 1417 | }; 1418 | 1419 | enum eVehicleDoor 1420 | { 1421 | VehicleDoorFrontLeftDoor = 0, 1422 | VehicleDoorFrontRightDoor = 1, 1423 | VehicleDoorBackLeftDoor = 2, 1424 | VehicleDoorBackRightDoor = 3, 1425 | VehicleDoorHood = 4, 1426 | VehicleDoorTrunk = 5, 1427 | VehicleDoorTrunk2 = 6, 1428 | }; 1429 | 1430 | enum eVehicleLockStatus 1431 | { 1432 | VehicleLockStatusNone = 0, 1433 | VehicleLockStatusUnlocked = 1, 1434 | VehicleLockStatusLocked = 2, 1435 | VehicleLockStatusLockedForPlayer = 3, 1436 | VehicleLockStatusStickPlayerInside = 4, 1437 | VehicleLockStatusCanBeBrokenInto = 7, 1438 | VehicleLockStatusCanBeBrokenIntoPersist = 8, 1439 | VehicleLockStatusCannotBeTriedToEnter = 10 1440 | }; 1441 | 1442 | enum eVehicleLandingGear 1443 | { 1444 | VehicleLandingGearDeployed = 0, 1445 | VehicleLandingGearClosing = 1, 1446 | VehicleLandingGearOpening = 2, 1447 | VehicleLandingGearRetracted = 3, 1448 | }; 1449 | 1450 | enum eVehicleMod 1451 | { 1452 | VehicleModSpoilers = 0, 1453 | VehicleModFrontBumper = 1, 1454 | VehicleModRearBumper = 2, 1455 | VehicleModSideSkirt = 3, 1456 | VehicleModExhaust = 4, 1457 | VehicleModFrame = 5, 1458 | VehicleModGrille = 6, 1459 | VehicleModHood = 7, 1460 | VehicleModFender = 8, 1461 | VehicleModRightFender = 9, 1462 | VehicleModRoof = 10, 1463 | VehicleModEngine = 11, 1464 | VehicleModBrakes = 12, 1465 | VehicleModTransmission = 13, 1466 | VehicleModHorns = 14, 1467 | VehicleModSuspension = 15, 1468 | VehicleModArmor = 16, 1469 | VehicleModFrontWheels = 23, 1470 | VehicleModBackWheels = 24 // only for motocycles 1471 | }; 1472 | 1473 | enum eVehicleNeonLight 1474 | { 1475 | VehicleNeonLightLeft = 0, 1476 | VehicleNeonLightRight = 1, 1477 | VehicleNeonLightFront = 2, 1478 | VehicleNeonLightBack = 3, 1479 | }; 1480 | 1481 | enum eVehicleRoofState 1482 | { 1483 | VehicleRoofStateClosed, 1484 | VehicleRoofStateOpening, 1485 | VehicleRoofStateOpened, 1486 | VehicleRoofStateClosing, 1487 | }; 1488 | 1489 | enum eVehicleSeat 1490 | { 1491 | VehicleSeatNone = -3, 1492 | VehicleSeatAny = -2, 1493 | VehicleSeatDriver = -1, 1494 | VehicleSeatPassenger = 0, 1495 | VehicleSeatLeftFront = -1, 1496 | VehicleSeatRightFront = 0, 1497 | VehicleSeatLeftRear = 1, 1498 | VehicleSeatRightRear = 2, 1499 | }; 1500 | 1501 | enum eVehicleToggleMod 1502 | { 1503 | VehicleToggleModTurbo = 18, 1504 | VehicleToggleModTireSmoke = 20, 1505 | VehicleToggleModXenonHeadlights = 22 1506 | }; 1507 | 1508 | enum eVehicleWheelType 1509 | { 1510 | VehicleWheelTypeSport = 0, 1511 | VehicleWheelTypeMuscle = 1, 1512 | VehicleWheelTypeLowrider = 2, 1513 | VehicleWheelTypeSUV = 3, 1514 | VehicleWheelTypeOffroad = 4, 1515 | VehicleWheelTypeTuner = 5, 1516 | VehicleWheelTypeBikeWheels = 6, 1517 | VehicleWheelTypeHighEnd = 7 1518 | }; 1519 | 1520 | enum eVehicleWindow 1521 | { 1522 | VehicleWindowFrontRight = 1, 1523 | VehicleWindowFrontLeft = 0, 1524 | VehicleWindowBackRight = 3, 1525 | VehicleWindowBackLeft = 2 1526 | }; 1527 | 1528 | enum eVehicleWindowTint 1529 | { 1530 | VehicleWindowTintNone = 0, 1531 | VehicleWindowTintPureBlack = 1, 1532 | VehicleWindowTintDarkSmoke = 2, 1533 | VehicleWindowTintLightSmoke = 3, 1534 | VehicleWindowTintStock = 4, 1535 | VehicleWindowTintLimo = 5, 1536 | VehicleWindowTintGreen = 6 1537 | }; 1538 | 1539 | enum eNumberPlateMounting 1540 | { 1541 | NumberPlateMountingFrontAndRear = 0, 1542 | NumberPlateMountingFront = 1, 1543 | NumberPlateMountingRear = 2, 1544 | NumberPlateMountingNone = 3, 1545 | }; 1546 | 1547 | enum eNumberPlateType 1548 | { 1549 | NumberPlateTypeBlueOnWhite1 = 0, 1550 | NumberPlateTypeYellowOnBlack = 1, 1551 | NumberPlateTypeYellowOnBlue = 2, 1552 | NumberPlateTypeBlueOnWhite2 = 3, 1553 | NumberPlateTypeBlueOnWhite3 = 4, 1554 | NumberPlateTypeNorthYankton = 5, 1555 | }; 1556 | 1557 | enum eVehicleClass 1558 | { 1559 | VehicleClassCompacts = 0, 1560 | VehicleClassSedans = 1, 1561 | VehicleClassSUVs = 2, 1562 | VehicleClassCoupes = 3, 1563 | VehicleClassMuscle = 4, 1564 | VehicleClassSportsClassics = 5, 1565 | VehicleClassSports = 6, 1566 | VehicleClassSuper = 7, 1567 | VehicleClassMotorcycles = 8, 1568 | VehicleClassOffRoad = 9, 1569 | VehicleClassIndustrial = 10, 1570 | VehicleClassUtility = 11, 1571 | VehicleClassVans = 12, 1572 | VehicleClassCycles = 13, 1573 | VehicleClassBoats = 14, 1574 | VehicleClassHelicopters = 15, 1575 | VehicleClassPlanes = 16, 1576 | VehicleClassService = 17, 1577 | VehicleClassEmergency = 18, 1578 | VehicleClassMilitary = 19, 1579 | VehicleClassCommercial = 20, 1580 | VehicleClassTrains = 21, 1581 | }; 1582 | 1583 | enum eExplosionType 1584 | { 1585 | ExplosionTypeGrenade = 0, 1586 | ExplosionTypeGrenadeL = 1, 1587 | ExplosionTypeStickyBomb = 2, 1588 | ExplosionTypeMolotov = 3, 1589 | ExplosionTypeRocket = 4, 1590 | ExplosionTypeTankShell = 5, 1591 | ExplosionTypeHiOctane = 6, 1592 | ExplosionTypeCar = 7, 1593 | ExplosionTypePlane = 8, 1594 | ExplosionTypePetrolPump = 9, 1595 | ExplosionTypeBike = 10, 1596 | ExplosionTypeSteam = 11, 1597 | ExplosionTypeFlame = 12, 1598 | ExplosionTypeWaterHydrant = 13, 1599 | ExplosionTypeGasCanister = 14, 1600 | ExplosionTypeBoat = 15, 1601 | ExplosionTypeShipDestroy = 16, 1602 | ExplosionTypeTruck = 17, 1603 | ExplosionTypeBullet = 18, 1604 | ExplosionTypeSmokeGL = 19, 1605 | ExplosionTypeSmokeG = 20, 1606 | ExplosionTypeBZGas = 21, 1607 | ExplosionTypeFlare = 22, 1608 | ExplosionTypeGasCanister2 = 23, 1609 | ExplosionTypeExtinguisher = 24, 1610 | ExplosionTypeProgramAR = 25, 1611 | ExplosionTypeTrain = 26, 1612 | ExplosionTypeBarrel = 27, 1613 | ExplosionTypePropane = 28, 1614 | ExplosionTypeBlimp = 29, 1615 | ExplosionTypeFlameExplode = 30, 1616 | ExplosionTypeTanker = 31, 1617 | ExplosionTypePlaneRocket = 32, 1618 | ExplosionTypeVehicleBullet = 33, 1619 | ExplosionTypeGasTank = 34, 1620 | ExplosionTypeFireWork = 35, 1621 | ExplosionTypeSnowBall = 36, 1622 | ExplosionTypeProxMine = 37, 1623 | ExplosionTypeValkyrie = 38 1624 | }; 1625 | 1626 | enum eIntersectFlags 1627 | { 1628 | IntersectFlagsEverything = -1, 1629 | IntersectFlagsMap = 1, 1630 | IntersectFlagsMissionEntities = 2, 1631 | IntersectFlagsPeds1 = 12, // 4 and 8 both seem to be peds 1632 | IntersectFlagsObjects = 16, 1633 | IntersectFlagsUnk1 = 32, 1634 | IntersectFlagsUnk2 = 64, 1635 | IntersectFlagsUnk3 = 128, 1636 | IntersectFlagsVegetation = 256, 1637 | IntersectFlagsUnk4 = 512 1638 | }; 1639 | 1640 | enum eMarkerType 1641 | { 1642 | MarkerTypeUpsideDownCone = 0, 1643 | MarkerTypeVerticalCylinder = 1, 1644 | MarkerTypeThickChevronUp = 2, 1645 | MarkerTypeThinChevronUp = 3, 1646 | MarkerTypeCheckeredFlagRect = 4, 1647 | MarkerTypeCheckeredFlagCircle = 5, 1648 | MarkerTypeVerticleCircle = 6, 1649 | MarkerTypePlaneModel = 7, 1650 | MarkerTypeLostMCDark = 8, 1651 | MarkerTypeLostMCLight = 9, 1652 | MarkerTypeNumber0 = 10, 1653 | MarkerTypeNumber1 = 11, 1654 | MarkerTypeNumber2 = 12, 1655 | MarkerTypeNumber3 = 13, 1656 | MarkerTypeNumber4 = 14, 1657 | MarkerTypeNumber5 = 15, 1658 | MarkerTypeNumber6 = 16, 1659 | MarkerTypeNumber7 = 17, 1660 | MarkerTypeNumber8 = 18, 1661 | MarkerTypeNumber9 = 19, 1662 | MarkerTypeChevronUpx1 = 20, 1663 | MarkerTypeChevronUpx2 = 21, 1664 | MarkerTypeChevronUpx3 = 22, 1665 | MarkerTypeHorizontalCircleFat = 23, 1666 | MarkerTypeReplayIcon = 24, 1667 | MarkerTypeHorizontalCircleSkinny = 25, 1668 | MarkerTypeHorizontalCircleSkinny_Arrow = 26, 1669 | MarkerTypeHorizontalSplitArrowCircle = 27, 1670 | MarkerTypeDebugSphere = 28 1671 | }; 1672 | 1673 | enum eRelationship 1674 | { 1675 | RelationshipHate = 5, 1676 | RelationshipDislike = 4, 1677 | RelationshipNeutral = 3, 1678 | RelationshipLike = 2, 1679 | RelationshipRespect = 1, 1680 | RelationshipCompanion = 0, 1681 | RelationshipPedestrians = 255 // or neutral 1682 | }; 1683 | 1684 | enum eRopeType 1685 | { 1686 | RopeTypeNormal = 4, 1687 | }; 1688 | 1689 | enum eWeapon : DWORD 1690 | { 1691 | WeaponKnife = 0x99B507EA, 1692 | WeaponNightstick = 0x678B81B1, 1693 | WeaponHammer = 0x4E875F73, 1694 | WeaponBat = 0x958A4A8F, 1695 | WeaponGolfClub = 0x440E4788, 1696 | WeaponCrowbar = 0x84BD7BFD, 1697 | WeaponPistol = 0x1B06D571, 1698 | WeaponCombatPistol = 0x5EF9FEC4, 1699 | WeaponAPPistol = 0x22D8FE39, 1700 | WeaponPistol50 = 0x99AEEB3B, 1701 | WeaponMicroSMG = 0x13532244, 1702 | WeaponSMG = 0x2BE6766B, 1703 | WeaponAssaultSMG = 0xEFE7E2DF, 1704 | WeaponCombatPDW = 0x0A3D4D34, 1705 | WeaponAssaultRifle = 0xBFEFFF6D, 1706 | WeaponCarbineRifle = 0x83BF0278, 1707 | WeaponAdvancedRifle = 0xAF113F99, 1708 | WeaponMG = 0x9D07F764, 1709 | WeaponCombatMG = 0x7FD62962, 1710 | WeaponPumpShotgun = 0x1D073A89, 1711 | WeaponSawnOffShotgun = 0x7846A318, 1712 | WeaponAssaultShotgun = 0xE284C527, 1713 | WeaponBullpupShotgun = 0x9D61E50F, 1714 | WeaponStunGun = 0x3656C8C1, 1715 | WeaponSniperRifle = 0x5FC3C11, 1716 | WeaponHeavySniper = 0xC472FE2, 1717 | WeaponGrenadeLauncher = 0xA284510B, 1718 | WeaponGrenadeLauncherSmoke = 0x4DD2DC56, 1719 | WeaponRPG = 0xB1CA77B1, 1720 | WeaponMinigun = 0x42BF8A85, 1721 | WeaponGrenade = 0x93E220BD, 1722 | WeaponStickyBomb = 0x2C3731D9, 1723 | WeaponSmokeGrenade = 0xFDBC8A50, 1724 | WeaponBZGas = 0xA0973D5E, 1725 | WeaponMolotov = 0x24B17070, 1726 | WeaponFireExtinguisher = 0x60EC506, 1727 | WeaponPetrolCan = 0x34A67B97, 1728 | WeaponSNSPistol = 0xBFD21232, 1729 | WeaponSpecialCarbine = 0xC0A3098D, 1730 | WeaponHeavyPistol = 0xD205520E, 1731 | WeaponBullpupRifle = 0x7F229F94, 1732 | WeaponHomingLauncher = 0x63AB0442, 1733 | WeaponProximityMine = 0xAB564B93, 1734 | WeaponSnowball = 0x787F0BB, 1735 | WeaponVintagePistol = 0x83839C4, 1736 | WeaponDagger = 0x92A27487, 1737 | WeaponFirework = 0x7F7497E5, 1738 | WeaponMusket = 0xA89CB99E, 1739 | WeaponMarksmanRifle = 0xC734385A, 1740 | WeaponHeavyShotgun = 0x3AABBBAA, 1741 | WeaponGusenberg = 0x61012683, 1742 | WeaponHatchet = 0xF9DCBF2D, 1743 | WeaponRailgun = 0x6D544C99, 1744 | WeaponUnarmed = 0xA2719263 1745 | }; 1746 | 1747 | enum eWeaponGroup : DWORD 1748 | { 1749 | WeaponGroupUnarmed = 0xA00FC1E4, 1750 | WeaponGroupMelee = 0xD49321D4, 1751 | WeaponGroupPistol = 0x18D5FA97, 1752 | WeaponGroupSMG = 0xC6E9A5C5, 1753 | WeaponGroupAssaultRifle = 0xC7D15052, 1754 | WeaponGroupMG = 0x451B04BC, 1755 | WeaponGroupShotgun = 0x33431399, 1756 | WeaponGroupSniper = 0xB7BBD827, 1757 | WeaponGroupHeavy = 0xA27A4F9F, 1758 | WeaponGroupThrown = 0x5C4C5883, 1759 | WeaponGroupPetrolCan = 0x5F1BE07C 1760 | }; 1761 | 1762 | enum eWeaponTint 1763 | { 1764 | WeaponTintNormal = 0, 1765 | WeaponTintGreen = 1, 1766 | WeaponTintGold = 2, 1767 | WeaponTintPink = 3, 1768 | WeaponTintArmy = 4, 1769 | WeaponTintLSPD = 5, 1770 | WeaponTintOrange = 6, 1771 | WeaponTintPlatinum = 7 1772 | }; 1773 | 1774 | enum ePickupType : DWORD 1775 | { 1776 | PickupTypeCustomScript = 0x2C014CA6, 1777 | PickupTypeVehicleCustomScript = 0xA5B8CAA9, 1778 | PickupTypeParachute = 0x6773257D, 1779 | PickupTypePortablePackage = 0x80AB931C, 1780 | PickupTypePortableCrateUnfixed = 0x6E717A95, 1781 | 1782 | PickupTypeHealth = 0x8F707C18, 1783 | PickupTypeHealthSnack = 0x1CD2CF66, 1784 | PickupTypeArmour = 0x4BFB42D1, 1785 | 1786 | PickupTypeMoneyCase = 0xCE6FDD6B, 1787 | PickupTypeMoneySecurityCase = 0xDE78F17E, 1788 | PickupTypeMoneyVariable = 0xFE18F3AF, 1789 | PickupTypeMoneyMedBag = 0x14568F28, 1790 | PickupTypeMoneyPurse = 0x1E9A99F8, 1791 | PickupTypeMoneyDepBag = 0x20893292, 1792 | PickupTypeMoneyWallet = 0x5DE0AD3E, 1793 | PickupTypeMoneyPaperBag = 0x711D02A4, 1794 | 1795 | PickupTypeWeaponPistol = 0xF9AFB48F, 1796 | PickupTypeWeaponCombatPistol = 0x8967B4F3, 1797 | PickupTypeWeaponAPPistol = 0x3B662889, 1798 | PickupTypeWeaponSNSPistol = 0xC5B72713, 1799 | PickupTypeWeaponHeavyPistol = 0x9CF13918, 1800 | PickupTypeWeaponMicroSMG = 0x1D9588D3, 1801 | PickupTypeWeaponSMG = 0x3A4C2AD2, 1802 | PickupTypeWeaponMG = 0x85CAA9B1, 1803 | PickupTypeWeaponCombatMG = 0xB2930A14, 1804 | PickupTypeWeaponAssaultRifle = 0xF33C83B0, 1805 | PickupTypeWeaponCarbineRifle = 0xDF711959, 1806 | PickupTypeWeaponAdvancedRifle = 0xB2B5325E, 1807 | PickupTypeWeaponSpecialCarbine = 0x968339D, 1808 | PickupTypeWeaponBullpupRifle = 0x815D66E8, 1809 | PickupTypeWeaponPumpShotgun = 0xA9355DCD, 1810 | PickupTypeWeaponSawnoffShotgun = 0x96B412A3, 1811 | PickupTypeWeaponAssaultShotgun = 0x9299C95B, 1812 | PickupTypeWeaponSniperRifle = 0xFE2A352C, 1813 | PickupTypeWeaponHeavySniper = 0x693583AD, 1814 | PickupTypeWeaponGrenadeLauncher = 0x2E764125, 1815 | PickupTypeWeaponRPG = 0x4D36C349, 1816 | PickupTypeWeaponMinigun = 0x2F36B434, 1817 | PickupTypeWeaponGrenade = 0x5E0683A1, 1818 | PickupTypeWeaponStickyBomb = 0x7C119D58, 1819 | PickupTypeWeaponSmokeGrenade = 0x1CD604C7, 1820 | PickupTypeWeaponMolotov = 0x2DD30479, 1821 | PickupTypeWeaponPetrolCan = 0xC69DE3FF, 1822 | PickupTypeWeaponKnife = 0x278D8734, 1823 | PickupTypeWeaponNightstick = 0x5EA16D74, 1824 | PickupTypeWeaponBat = 0x81EE601E, 1825 | PickupTypeWeaponCrowbar = 0x872DC888, 1826 | PickupTypeWeaponGolfclub = 0x88EAACA7, 1827 | PickupTypeWeaponBottle = 0xFA51ABF5, 1828 | 1829 | PickupTypeVehicleWeaponPistol = 0xA54AE7B7, 1830 | PickupTypeVehicleWeaponCombatPistol = 0xD0AACEF7, 1831 | PickupTypeVehicleWeaponAPPistol = 0xCC8B3905, 1832 | PickupTypeVehicleWeaponMicroSMG = 0xB86AEE5B, 1833 | PickupTypeVehicleWeaponSawnoffShotgun = 0x2E071B5A, 1834 | PickupTypeVehicleWeaponGrenade = 0xA717F898, 1835 | PickupTypeVehicleWeaponSmokeGrenade = 0x65A7D8E9, 1836 | PickupTypeVehicleWeaponStickyBomb = 0x2C804FE3, 1837 | PickupTypeVehicleWeaponMolotov = 0x84D676D4, 1838 | PickupTypeVehicleHealth = 0x98D79EF, 1839 | 1840 | PickupTypeAmmoPistol = 0x20796A82, 1841 | PickupTypeAmmoSMG = 0x116FC4E6, 1842 | PickupTypeAmmoMG = 0xDE58E0B3, 1843 | PickupTypeAmmoRifle = 0xE4BD2FC6, 1844 | PickupTypeAmmoShotgun = 0x77F3F2DD, 1845 | PickupTypeAmmoSniper = 0xC02CF125, 1846 | PickupTypeAmmoGrenadeLauncher = 0x881AB0A8, 1847 | PickupTypeAmmoRPG = 0x84837FD7, 1848 | PickupTypeAmmoMinigun = 0xF25A01B9, 1849 | PickupTypeAmmoMissileMP = 0xF99E15D0, 1850 | PickupTypeAmmoBulletMP = 0x550447A9, 1851 | PickupTypeAmmoGrenadeLauncherMP = 0xA421A532 1852 | }; 1853 | 1854 | enum eHudComponent 1855 | { 1856 | HudComponentMain = 0, 1857 | HudComponentWantedStars, 1858 | HudComponentWeaponIcon, 1859 | HudComponentCash, 1860 | HudComponentMpCash, 1861 | HudComponentMpMessage, 1862 | HudComponentVehicleName, 1863 | HudComponentAreaName, 1864 | HudComponentUnused, 1865 | HudComponentStreetName, 1866 | HudComponentHelpText, 1867 | HudComponentFloatingHelpText1, 1868 | HudComponentFloatingHelpText2, 1869 | HudComponentCashChange, 1870 | HudComponentReticle, 1871 | HudComponentSubtitleText, 1872 | HudComponentRadioStationsWheel, 1873 | HudComponentSaving, 1874 | HudComponentGameStreamUnused, 1875 | HudComponentWeaponWheel, 1876 | HudComponentWeaponWheelStats, 1877 | HudComponentDrugsPurse01, 1878 | HudComponentDrugsPurse02, 1879 | HudComponentDrugsPurse03, 1880 | HudComponentDrugsPurse04, 1881 | HudComponentMpTagCashFromBank, 1882 | HudComponentMpTagPackages, 1883 | HudComponentMpTagCuffKeys, 1884 | HudComponentMpTagDownloadData, 1885 | HudComponentMpTagIfPedFollowing, 1886 | HudComponentMpTagKeyCard, 1887 | HudComponentMpTagRandomObject, 1888 | HudComponentMpTagRemoteControl, 1889 | HudComponentMpTagCashFromSafe, 1890 | HudComponentMpTagWeaponsPackage, 1891 | HudComponentMpTagKeys, 1892 | HudComponentMpVehicle, 1893 | HudComponentMpVehicleHeli, 1894 | HudComponentMpVehiclePlane, 1895 | HudComponentPlayerSwitchAlert, 1896 | HudComponentMpRankBar, 1897 | HudComponentDirectorMode, 1898 | HudComponentReplayController, 1899 | HudComponentReplayMouse, 1900 | HudComponentReplayHeader, 1901 | HudComponentReplayOptions, 1902 | HudComponentReplayHelpText, 1903 | HudComponentReplayMiscText, 1904 | HudComponentReplayTopLine, 1905 | HudComponentReplayBottomLine, 1906 | HudComponentReplayLeftBar, 1907 | HudComponentReplayTimer 1908 | }; 1909 | 1910 | enum eGameState { 1911 | GameStatePlaying, 1912 | GameStateIntro, 1913 | GameStateLicenseShit = 3, 1914 | GameStateMainMenu = 5, 1915 | GameStateLoadingSP_MP = 6 1916 | }; 1917 | 1918 | --------------------------------------------------------------------------------