├── 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