├── .github
├── FUNDING.yml
├── ISSUE_TEMPLATE
│ ├── bug_report.yaml
│ ├── config.yml
│ └── feature_request.yaml
└── PULL_REQUEST_TEMPLATE.md
├── .gitignore
├── AIO_FH5-ver-validation.json
├── Forza-Mods-AIO
├── Forza-Mods-AIO.sln
└── Forza-Mods-AIO
│ ├── AIO.snk
│ ├── App.config
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── AssemblyInfo.cs
│ ├── Cheats
│ ├── CheatsUtilities.cs
│ ├── ForzaHorizon4
│ │ ├── Bypass.cs
│ │ ├── CameraCheats.cs
│ │ ├── CarCheats.cs
│ │ ├── CustomizationCheats.cs
│ │ ├── EnvironmentCheats.cs
│ │ ├── MiscCheats.cs
│ │ ├── PhotomodeCheats.cs
│ │ ├── Sql.cs
│ │ └── UnlocksCheats.cs
│ ├── ForzaHorizon5
│ │ ├── Bypass.cs
│ │ ├── CameraCheats.cs
│ │ ├── CarCheats.cs
│ │ ├── CustomizationCheats.cs
│ │ ├── EnvironmentCheats.cs
│ │ ├── MiscCheats.cs
│ │ ├── PhotomodeCheats.cs
│ │ ├── Sql.cs
│ │ ├── TuningCheats.cs
│ │ ├── UnlocksCheats.cs
│ │ └── ValueEncryption.cs
│ ├── ICheatsBase.cs
│ └── IRevertBase.cs
│ ├── Controls
│ ├── StatusComboboxItem
│ │ ├── StatusComboboxItem.cs
│ │ └── StatusComboboxItem.xaml
│ └── TranslationComboboxItem
│ │ ├── TranslationComboboxItem.cs
│ │ └── TranslationComboboxItem.xaml
│ ├── Converters
│ ├── BoolParamConverter.cs
│ ├── InstanceEqualsConverter.cs
│ ├── IntParamConverter.cs
│ ├── MultiplyConverter.cs
│ └── TypeToInstanceConverter.cs
│ ├── Forza-Mods-AIO.csproj
│ ├── Helpers
│ └── Settings.cs
│ ├── Models
│ ├── DebugInfoReport.cs
│ ├── DebugSession.cs
│ ├── GameVerPlat.cs
│ └── SearchResult.cs
│ ├── Resources
│ ├── Cheats.cs
│ ├── DebugSessions.cs
│ ├── External
│ │ └── Memory.dll
│ ├── Imports.cs
│ ├── Keybinds
│ │ ├── GlobalHotkey.cs
│ │ └── HotkeysManager.cs
│ ├── Memory.cs
│ ├── Pages.cs
│ ├── Search
│ │ └── SearchResults.cs
│ ├── Square150x150Logo.scale-200.png
│ ├── Theme
│ │ ├── CommonBorderStyle.xaml
│ │ ├── ThemeConstants.xaml
│ │ └── Theming.cs
│ └── Translations
│ │ ├── ChineseSimplified.xaml
│ │ ├── English.xaml
│ │ └── French.xaml
│ ├── Services
│ ├── ApplicationHostService.cs
│ └── WindowsProviderService.cs
│ ├── ViewModels
│ ├── Pages
│ │ ├── AboutViewModel.cs
│ │ ├── AioInfoViewModel.cs
│ │ ├── AutoshowViewModel.cs
│ │ ├── SearchViewModel.cs
│ │ ├── SettingsViewModel.cs
│ │ └── TuningViewModel.cs
│ ├── SubPages
│ │ └── SelfVehicle
│ │ │ ├── CameraViewModel.cs
│ │ │ ├── CustomizationViewModel.cs
│ │ │ ├── EnvironmentViewModel.cs
│ │ │ ├── HandlingViewModel.cs
│ │ │ ├── MiscViewModel.cs
│ │ │ ├── PhotoModeViewModel.cs
│ │ │ └── UnlocksViewModel.cs
│ └── Windows
│ │ ├── DebugWindowViewModel.cs
│ │ └── MainWindowViewModel.cs
│ ├── Views
│ ├── Pages
│ │ ├── About.xaml
│ │ ├── About.xaml.cs
│ │ ├── AioInfo.xaml
│ │ ├── AioInfo.xaml.cs
│ │ ├── Autoshow.xaml
│ │ ├── Autoshow.xaml.cs
│ │ ├── Search.xaml
│ │ ├── Search.xaml.cs
│ │ ├── SelfVehicle.xaml
│ │ ├── SelfVehicle.xaml.cs
│ │ ├── Settings.xaml
│ │ ├── Settings.xaml.cs
│ │ ├── Tuning.xaml
│ │ └── Tuning.xaml.cs
│ ├── SubPages
│ │ ├── SelfVehicle
│ │ │ ├── Camera.xaml
│ │ │ ├── Camera.xaml.cs
│ │ │ ├── Customization.xaml
│ │ │ ├── Customization.xaml.cs
│ │ │ ├── Environment.xaml
│ │ │ ├── Environment.xaml.cs
│ │ │ ├── Handling.xaml
│ │ │ ├── Handling.xaml.cs
│ │ │ ├── Misc.xaml
│ │ │ ├── Misc.xaml.cs
│ │ │ ├── PhotoMode.xaml
│ │ │ ├── PhotoMode.xaml.cs
│ │ │ ├── Unlocks.xaml
│ │ │ └── Unlocks.xaml.cs
│ │ └── Tuning
│ │ │ ├── Aero.xaml
│ │ │ ├── Aero.xaml.cs
│ │ │ ├── Alignment.xaml
│ │ │ ├── Alignment.xaml.cs
│ │ │ ├── Damping.xaml
│ │ │ ├── Damping.xaml.cs
│ │ │ ├── Gearing.xaml
│ │ │ ├── Gearing.xaml.cs
│ │ │ ├── Others.xaml
│ │ │ ├── Others.xaml.cs
│ │ │ ├── Springs.xaml
│ │ │ ├── Springs.xaml.cs
│ │ │ ├── Steering.xaml
│ │ │ ├── Steering.xaml.cs
│ │ │ ├── Tires.xaml
│ │ │ └── Tires.xaml.cs
│ └── Windows
│ │ ├── DebugWindow.xaml
│ │ ├── DebugWindow.xaml.cs
│ │ ├── MainWindow.xaml
│ │ ├── MainWindow.xaml.cs
│ │ ├── OverlayWindow.xaml
│ │ └── OverlayWindow.xaml.cs
│ └── app.manifest
├── LICENSE
├── README.md
└── SECURITY.md
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | ko_fi: merikaaaaa
2 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.yaml:
--------------------------------------------------------------------------------
1 | name: Bug report
2 | description: File a bug report
3 | title: "Bug title"
4 | labels: ["bug", "needs-triage"]
5 | body:
6 | - type: input
7 | validations:
8 | required: true
9 | attributes:
10 | label: Which version of the app?
11 | - type: textarea
12 | validations:
13 | required: true
14 | attributes:
15 | label: Description
16 | description: Please provide a description of the bug and how to reproduce it
17 | - type: textarea
18 | validations:
19 | required: true
20 | attributes:
21 | label: Screenshots
22 | description: If applicable, add screenshots here to help explain your problem
23 | - type: dropdown
24 | validations:
25 | required: true
26 | attributes:
27 | label: Windows version
28 | description: Which Windows versions did you see the issue on?
29 | multiple: true
30 | options:
31 | - Insider Build (xxxxx)
32 | - Windows 11 24H2 (26052)
33 | - Windows 11 23H2 (22631)
34 | - Windows 11 22H2 (22621)
35 | - Windows 11 21H2 (22000)
36 | - Windows 10 22H2 (19045)
37 | - November 2021 Update/21H2 (19044)
38 | - May 2021 Update/21H1 (19043)
39 | - October 2020 Update/20H2 (19042)
40 | - October 2018 Update/RS5 (17763)
41 | - type: textarea
42 | attributes:
43 | label: Additional context
44 | description: Enter any other applicable info here
45 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | blank_issues_enabled: false
2 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.yaml:
--------------------------------------------------------------------------------
1 | name: Feature request
2 | description: Suggest an enhancement for the AIO
3 | title: "Sample request title"
4 | labels: ["needs-triage", "enhancement"]
5 | body:
6 | - type: textarea
7 | validations:
8 | required: true
9 | attributes:
10 | label: Description
11 | description: Please provide a description of the enhancement
12 | - type: textarea
13 | validations:
14 | required: true
15 | attributes:
16 | label: Screenshots
17 | description: If applicable, add screenshots here to help explain your problem
18 | - type: textarea
19 | attributes:
20 | label: Additional context
21 | description: Enter any other applicable info here
22 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ## Pull request type
2 |
3 | Please check the type of change your PR introduces:
4 |
5 | - [ ] Update
6 | - [ ] Bugfix
7 | - [ ] Feature
8 | - [ ] Code style update (formatting, renaming)
9 | - [ ] Refactoring (no functional changes, no api changes)
10 | - [ ] Build related changes
11 | - [ ] Documentation content changes
12 |
13 | ## Closed Issues
14 |
15 | Closes: #xxxx
16 |
17 | ## What is the new behavior?
18 |
19 | Please describe the behavior or changes that are being added by this PR.
20 |
21 | -
22 | -
23 |
24 | ## Other information
25 |
26 | Any other information that is important to this PR such as screenshots of how the component looks before and after the change.
27 |
--------------------------------------------------------------------------------
/AIO_FH5-ver-validation.json:
--------------------------------------------------------------------------------
1 | {
2 | "2.6.0.0": {
3 | "minMinor": 683,
4 | "maxMinor": 683
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Forza-Mods-AIO", "Forza-Mods-AIO\Forza-Mods-AIO.csproj", "{C01F6F01-BD57-4CEB-88CF-B9CD905427A2}"
4 | EndProject
5 | Global
6 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
7 | Debug|Any CPU = Debug|Any CPU
8 | Release|Any CPU = Release|Any CPU
9 | EndGlobalSection
10 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
11 | {C01F6F01-BD57-4CEB-88CF-B9CD905427A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
12 | {C01F6F01-BD57-4CEB-88CF-B9CD905427A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
13 | {C01F6F01-BD57-4CEB-88CF-B9CD905427A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
14 | {C01F6F01-BD57-4CEB-88CF-B9CD905427A2}.Release|Any CPU.Build.0 = Release|Any CPU
15 | EndGlobalSection
16 | EndGlobal
17 |
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/AIO.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ForzaMods/Forza-Mods-AIO/447030847c136d0ef9fcc3c2d7ded2c0d13eb5bd/Forza-Mods-AIO/Forza-Mods-AIO/AIO.snk
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/App.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using Forza_Mods_AIO.Cheats;
3 | using Forza_Mods_AIO.Helpers;
4 | using Forza_Mods_AIO.Models;
5 | using Forza_Mods_AIO.Resources;
6 | using Forza_Mods_AIO.Resources.Keybinds;
7 | using Forza_Mods_AIO.Resources.Theme;
8 | using Forza_Mods_AIO.Services;
9 | using Forza_Mods_AIO.ViewModels.Windows;
10 | using Forza_Mods_AIO.Views.Windows;
11 | using MahApps.Metro.Controls;
12 | using Microsoft.Extensions.Configuration;
13 | using Microsoft.Extensions.DependencyInjection;
14 | using Microsoft.Extensions.Hosting;
15 | using static Forza_Mods_AIO.Resources.Cheats;
16 |
17 | namespace Forza_Mods_AIO;
18 |
19 | public partial class App
20 | {
21 | private const string MutexName = "{(4A771E61-6684-449F-8952-B31582A8877E)}";
22 | private Mutex _mutex = null!;
23 |
24 | private static readonly IHost Host = Microsoft.Extensions.Hosting.Host.CreateDefaultBuilder()
25 | .ConfigureAppConfiguration(c =>
26 | {
27 | c.SetBasePath(AppContext.BaseDirectory);
28 | }).
29 | ConfigureServices((_, services) =>
30 | {
31 | services.AddHostedService();
32 |
33 | services.AddSingleton();
34 | services.AddSingleton();
35 |
36 | services.AddSingleton();
37 | services.AddSingleton();
38 | }).Build();
39 |
40 | public static T GetRequiredService() where T : class
41 | {
42 | return Host.Services.GetRequiredService();
43 | }
44 |
45 | private async void App_OnStartup(object sender, StartupEventArgs e)
46 | {
47 | await Host.StartAsync();
48 | HotkeysManager.SetupSystemHook();
49 | }
50 |
51 | private async void App_OnExit(object sender, ExitEventArgs e)
52 | {
53 | HotkeysManager.ShutdownSystemHook();
54 | DisconnectFromGame();
55 |
56 | await Host.StopAsync();
57 | Host.Dispose();
58 | }
59 |
60 | protected override void OnStartup(StartupEventArgs e)
61 | {
62 | _mutex = new Mutex(true, MutexName, out var createdNew);
63 |
64 | if (createdNew)
65 | {
66 | base.OnStartup(e);
67 | SetupExceptionHandling();
68 |
69 | // Initialize the theme
70 | Theming.GetInstance().InitializeTheme();
71 |
72 | // Load saved language
73 | var savedLanguage = Settings.LoadLanguage();
74 | if (!string.IsNullOrEmpty(savedLanguage))
75 | {
76 | try
77 | {
78 | var uri = new Uri($"/Resources/Translations/{savedLanguage}.xaml", UriKind.Relative);
79 | var langDict = new ResourceDictionary { Source = uri };
80 |
81 | // Remove existing language dictionary if it exists
82 | var resources = Current.Resources.MergedDictionaries;
83 | var langDictToRemove = resources.FirstOrDefault(dict =>
84 | dict.Source?.OriginalString.Contains("/Resources/Translations/") == true);
85 |
86 | if (langDictToRemove != null)
87 | {
88 | resources.Remove(langDictToRemove);
89 | }
90 |
91 | // Add the new language dictionary
92 | resources.Add(langDict);
93 | }
94 | catch
95 | {
96 | // If loading fails, it will fallback to English
97 | }
98 | }
99 | }
100 | else
101 | {
102 | MessageBox.Show("Another instance of the tool is already running.", "Information", MessageBoxButton.OK, MessageBoxImage.Asterisk);
103 | Current.Shutdown();
104 | }
105 | }
106 |
107 | // https://stackoverflow.com/a/46804709
108 | private void SetupExceptionHandling()
109 | {
110 | AppDomain.CurrentDomain.UnhandledException += (_, e) =>
111 | ReportException((Exception)e.ExceptionObject, "AppDomain.CurrentDomain.UnhandledException");
112 |
113 | DispatcherUnhandledException += (_, e) =>
114 | {
115 | ReportException(e.Exception, "Application.Current.DispatcherUnhandledException");
116 | e.Handled = true;
117 | };
118 |
119 | TaskScheduler.UnobservedTaskException += (_, e) =>
120 | {
121 | ReportException(e.Exception, "TaskScheduler.UnobservedTaskException");
122 | e.SetObserved();
123 | };
124 | }
125 |
126 | private static void ReportException(Exception exception, string source)
127 | {
128 | MessageBox.Show(
129 | $"An unexpected error happened.\nPlease (Press Ctrl+C) to copy, and make an issue on the github repository or post the copied text on the aio mega-thread in our discord server (discord.gg/forzamods)\n\nSource:{source}\nException:{exception.Message}\nException Source:{exception.Source}\n\nTool Version: {System.Reflection.Assembly.GetExecutingAssembly().GetName().Version}\nGame: {GameVerPlat.GetInstance().Name}\nGame Version: {GameVerPlat.GetInstance().Update}\nPlatform: {GameVerPlat.GetInstance().Platform}",
130 | $"{GetRequiredService().Title} - Error",
131 | 0,
132 | MessageBoxImage.Error
133 | );
134 | }
135 |
136 | protected override void OnExit(ExitEventArgs e)
137 | {
138 | _mutex.ReleaseMutex();
139 | _mutex.Dispose();
140 | base.OnExit(e);
141 | }
142 |
143 | private static void DisconnectFromGame()
144 | {
145 | foreach (var cheatInstance in CachedInstances.Where(kv => typeof(ICheatsBase).IsAssignableFrom(kv.Key)))
146 | {
147 | ((ICheatsBase)cheatInstance.Value).Cleanup();
148 | }
149 | _ = Imports.CloseHandle(Forza_Mods_AIO.Resources.Memory.GetInstance().MProc.Handle);
150 | }
151 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.InteropServices;
2 | using System.Windows;
3 | using System.Windows.Markup;
4 |
5 | [assembly: ComVisible(false)]
6 | [assembly: ThemeInfo(ResourceDictionaryLocation.None,ResourceDictionaryLocation.SourceAssembly)]
7 |
8 | #if !RELEASE
9 | [assembly: XmlnsDefinition("debug-mode", "Namespace")]
10 | #endif
11 |
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Cheats/CheatsUtilities.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using Forza_Mods_AIO.Models;
3 | using MahApps.Metro.Controls;
4 | using Memory;
5 | using static Forza_Mods_AIO.Resources.Memory;
6 |
7 | namespace Forza_Mods_AIO.Cheats;
8 |
9 | public class CheatsUtilities
10 | {
11 | protected static async Task SmartAobScan(string search, UIntPtr? start = null, UIntPtr? end = null)
12 | {
13 | Imps.GetSystemInfo(out var info);
14 |
15 | var handle = GetInstance().MProc.Handle;
16 | var minRange = (long)GetInstance().MProc.Process.MainModule!.BaseAddress;
17 | var maxRange = minRange + GetInstance().MProc.Process.MainModule!.ModuleMemorySize;
18 |
19 | if (start != null)
20 | {
21 | minRange = (long)start;
22 | }
23 |
24 | if (end != null)
25 | {
26 | maxRange = (long)end;
27 | }
28 |
29 | var scanStartAddr = minRange;
30 | var address = (UIntPtr)minRange;
31 |
32 | try
33 | {
34 | while (address < (ulong)maxRange)
35 | {
36 | Imps.Native_VirtualQueryEx(handle, address, out Imps.MemoryBasicInformation64 memInfo, info.PageSize);
37 | if (address == memInfo.BaseAddress + memInfo.RegionSize)
38 | {
39 | break;
40 | }
41 |
42 | var scanEndAddr = (long)memInfo.BaseAddress + (long)memInfo.RegionSize;
43 |
44 | nuint retAddress;
45 | if (scanEndAddr - scanStartAddr > 500000000)
46 | {
47 | retAddress = await ScanRange(search, scanStartAddr, scanEndAddr);
48 | }
49 | else
50 | {
51 | retAddress = (await GetInstance().AoBScan(scanStartAddr, scanEndAddr, search)).FirstOrDefault();
52 | }
53 |
54 | if (retAddress != 0)
55 | {
56 | return retAddress;
57 | }
58 |
59 | scanStartAddr = scanEndAddr;
60 | address = memInfo.BaseAddress + checked((UIntPtr)memInfo.RegionSize);
61 | }
62 | }
63 | catch
64 | {
65 | // ignored
66 | }
67 |
68 | return 0;
69 | }
70 |
71 | private static async Task ScanRange(string search, long startAddr, long endAddr)
72 | {
73 | var end = startAddr + (endAddr - startAddr) / 2;
74 | var retAddress = (await GetInstance().AoBScan(startAddr, end, search)).FirstOrDefault();
75 | return retAddress;
76 | }
77 |
78 | protected static void ShowError(string feature, string sig)
79 | {
80 | MessageBox.Show(
81 | $"Address for this feature wasn't found!\nPlease try to activate the cheat again or try to restart the game and the tool.\n\nIf this error still occurs, please (Press Ctrl+C) to copy, and make an issue on the github repository or post the copied text on the aio mega-thread in our discord server (discord.gg/forzamods).\n\nFeature: {feature}\nSignature: {sig}\n\nTool Version: {System.Reflection.Assembly.GetExecutingAssembly().GetName().Version}\nGame: {GameVerPlat.GetInstance().Name}\nGame Version: {GameVerPlat.GetInstance().Update}\nPlatform: {GameVerPlat.GetInstance().Platform}",
82 | $"{App.GetRequiredService().Title} - Error", 0, MessageBoxImage.Error);
83 | }
84 |
85 | protected static void Free(UIntPtr address)
86 | {
87 | if (address == 0) return;
88 | var handle = GetInstance().MProc.Handle;
89 | Imps.VirtualFreeEx(handle, address,0, Imps.MemRelease);
90 | }
91 |
92 | protected static byte[] CalculateDetour(nuint address, nuint target, int replaceCount)
93 | {
94 | var detourBytes = new byte[replaceCount];
95 | detourBytes[0] = 0xE9;
96 | BitConverter.GetBytes((int)((long)target - (long)address - 5)).CopyTo(detourBytes, 1);
97 |
98 | for (var i = 5; i < detourBytes.Length; i++)
99 | {
100 | detourBytes[i] = 0x90;
101 | }
102 |
103 | return detourBytes;
104 | }
105 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Cheats/ForzaHorizon4/Bypass.cs:
--------------------------------------------------------------------------------
1 | using static Forza_Mods_AIO.Resources.Imports;
2 | using static Forza_Mods_AIO.Resources.Memory;
3 |
4 | namespace Forza_Mods_AIO.Cheats.ForzaHorizon4;
5 |
6 | // ReSharper disable once ClassNeverInstantiated.Global
7 | public class Bypass : ICheatsBase
8 | {
9 | private static readonly byte[] RtlUserThreadStartPatch = [0x48, 0x83, 0xEC, 0x78, 0x4C, 0x8B, 0xC2];
10 | private static readonly byte[] NtCreateThreadExPatch = [0x4C, 0x8B, 0xD1, 0xB8, 0xC7, 0x00, 0x00, 0x00];
11 |
12 | private byte[] _rtlUserThreadStartOrig = null!;
13 | private byte[] _ntCreateThreadExOrig = null!;
14 |
15 | public void DisableCreateRemoteThreadChecks()
16 | {
17 | var mem = GetInstance();
18 | var ntDll = GetModuleHandle("ntdll.dll");
19 | var rtlUserThreadStart = GetProcAddress(ntDll, "RtlUserThreadStart");
20 | var ntCreateThreadEx = GetProcAddress(ntDll, "NtCreateThreadEx");
21 | _rtlUserThreadStartOrig = mem.ReadArrayMemory(rtlUserThreadStart, 7);
22 | _ntCreateThreadExOrig = mem.ReadArrayMemory(ntCreateThreadEx, 8);
23 | mem.WriteArrayMemory(rtlUserThreadStart, RtlUserThreadStartPatch);
24 | mem.WriteArrayMemory(ntCreateThreadEx, NtCreateThreadExPatch);
25 | }
26 |
27 | public void Cleanup()
28 | {
29 | var ntDll = GetModuleHandle("ntdll.dll");
30 | var mem = GetInstance();
31 |
32 | if (_rtlUserThreadStartOrig != null!)
33 | {
34 | var rtlUserThreadStart = GetProcAddress(ntDll, "RtlUserThreadStart");
35 | mem.WriteArrayMemory(rtlUserThreadStart, _rtlUserThreadStartOrig);
36 | }
37 |
38 | if (_ntCreateThreadExOrig == null!) return;
39 | var ntCreateThreadEx = GetProcAddress(ntDll, "NtCreateThreadEx");
40 | mem.WriteArrayMemory(ntCreateThreadEx, _ntCreateThreadExOrig);
41 | }
42 |
43 | public void Reset()
44 | {
45 | _rtlUserThreadStartOrig = null!;
46 | _ntCreateThreadExOrig = null!;
47 | }
48 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Cheats/ForzaHorizon4/CameraCheats.cs:
--------------------------------------------------------------------------------
1 | using static Forza_Mods_AIO.Resources.Memory;
2 |
3 | namespace Forza_Mods_AIO.Cheats.ForzaHorizon4;
4 |
5 | public class CameraCheats : CheatsUtilities, ICheatsBase
6 | {
7 | public UIntPtr ChaseAddress;
8 | public UIntPtr ChaseFarAddress;
9 | public UIntPtr DriverAddress;
10 | public UIntPtr HoodAddress;
11 | public UIntPtr BumperAddress;
12 | public bool WereLimitersScanned;
13 |
14 | public async Task CheatLimiters()
15 | {
16 | WereLimitersScanned = false;
17 | ChaseAddress = 0;
18 | ChaseFarAddress = 0;
19 | DriverAddress = 0;
20 | HoodAddress = 0;
21 | BumperAddress = 0;
22 |
23 | var processMainModule = GetInstance().MProc.Process.MainModule;
24 | if (processMainModule == null)
25 | {
26 | return;
27 | }
28 |
29 | var successCount = 0;
30 | var minRange = processMainModule.BaseAddress;
31 | var maxRange = minRange + processMainModule.ModuleMemorySize;
32 |
33 | const string chaseSig = "90 40 CD CC 8C 40 1F 85 2B 3F 00 00 00 40";
34 | var chaseList = await GetInstance().AoBScan(minRange, maxRange, chaseSig, true);
35 | var chaseEnumerable = chaseList as UIntPtr[] ?? chaseList.ToArray();
36 | if (chaseEnumerable.Length != 2)
37 | {
38 | ShowError("Chase Camera Limiters", chaseSig);
39 | goto skipScans;
40 | }
41 |
42 | ChaseAddress = chaseEnumerable.FirstOrDefault() - 10;
43 | ChaseFarAddress = chaseEnumerable.LastOrDefault() - 10;
44 | ++successCount;
45 |
46 | var newScanStart = (long)(ChaseAddress - 0x1000);
47 | var newScanEnd = (long)(ChaseAddress + 0x1000);
48 |
49 | const string driverHoodSig = "CD CC 4C 3E 00 50 43 47 00 00 34 42 00 00 20";
50 | var driverHoodList = await GetInstance().AoBScan(newScanStart, newScanEnd, driverHoodSig, true);
51 | var driverHoodEnumerable = driverHoodList as UIntPtr[] ?? driverHoodList.ToArray();
52 | if (driverHoodEnumerable.Length != 2)
53 | {
54 | ShowError("Bumper/Hood Camera Limiters", driverHoodSig);
55 | goto skipScans;
56 | }
57 |
58 | HoodAddress = driverHoodEnumerable.FirstOrDefault() - 0x24;
59 | DriverAddress = driverHoodEnumerable.LastOrDefault() - 0x24;
60 | ++successCount;
61 |
62 | const string bumperSig = "00 CD CC 4C 3E ? ? ? 47 00 ? 54";
63 | var bumperList = await GetInstance().AoBScan(newScanStart, newScanEnd, bumperSig, true);
64 | var bumperEnumerable = bumperList as UIntPtr[] ?? bumperList.ToArray();
65 | if (bumperEnumerable.Length == 0)
66 | {
67 | ShowError("Bumper Camera Limiter", bumperSig);
68 | goto skipScans;
69 | }
70 |
71 | BumperAddress = bumperEnumerable.FirstOrDefault() - 0x23;
72 | ++successCount;
73 |
74 | skipScans:
75 | WereLimitersScanned = successCount == 3;
76 | }
77 |
78 | public void Cleanup()
79 | {
80 | }
81 |
82 | public void Reset()
83 | {
84 | var fields = typeof(CameraCheats).GetFields().Where(f => f.FieldType == typeof(UIntPtr));
85 | foreach (var field in fields)
86 | {
87 | field.SetValue(this, UIntPtr.Zero);
88 | }
89 | }
90 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Cheats/ForzaHorizon4/CustomizationCheats.cs:
--------------------------------------------------------------------------------
1 | namespace Forza_Mods_AIO.Cheats.ForzaHorizon4;
2 |
3 | public class CustomizationCheats : CheatsUtilities, ICheatsBase
4 | {
5 | private UIntPtr _paintAddress;
6 | public UIntPtr PaintDetourAddress;
7 | private UIntPtr _cleanlinessAddress;
8 | public UIntPtr CleanlinessDetourAddress;
9 |
10 | public async Task CheatGlowingPaint()
11 | {
12 | _paintAddress = 0;
13 | PaintDetourAddress = 0;
14 |
15 | const string sig = "41 0F ? ? ? 41 C6 02";
16 | _paintAddress = await SmartAobScan(sig);
17 |
18 | if (_paintAddress > 0)
19 | {
20 | var asm = new byte[]
21 | {
22 | 0x80, 0x3D, 0x2D, 0x00, 0x00, 0x00, 0x01, 0x75, 0x21, 0x48, 0x83, 0xEC, 0x10, 0xF3, 0x0F, 0x7F, 0x14,
23 | 0x24, 0xF3, 0x0F, 0x10, 0x15, 0x1B, 0x00, 0x00, 0x00, 0x0F, 0xC6, 0xD2, 0x00, 0x0F, 0x59, 0xCA, 0xF3,
24 | 0x0F, 0x6F, 0x14, 0x24, 0x48, 0x83, 0xC4, 0x10, 0x41, 0x0F, 0x11, 0x4A, 0x10
25 | };
26 |
27 | PaintDetourAddress = Resources.Memory.GetInstance().CreateDetour(_paintAddress, asm, 5);
28 | return;
29 | }
30 |
31 | ShowError("Glowing paint", sig);
32 | }
33 |
34 | public async Task CheatCleanliness()
35 | {
36 | _cleanlinessAddress = 0;
37 | CleanlinessDetourAddress = 0;
38 |
39 | const string sig = "F3 0F ? ? ? ? ? ? F3 0F ? ? ? ? B9 ? ? ? ? E8";
40 | _cleanlinessAddress = await SmartAobScan(sig);
41 |
42 | if (_cleanlinessAddress > 0)
43 | {
44 | var asm = new byte[]
45 | {
46 | 0x80, 0x3D, 0x30, 0x00, 0x00, 0x00, 0x01, 0x75, 0x0C, 0x8B, 0x0D, 0x29, 0x00, 0x00, 0x00, 0x89, 0x88,
47 | 0x7C, 0x8C, 0x00, 0x00, 0x80, 0x3D, 0x20, 0x00, 0x00, 0x00, 0x01, 0x75, 0x0C, 0x8B, 0x0D, 0x19, 0x00,
48 | 0x00, 0x00, 0x89, 0x88, 0x80, 0x8C, 0x00, 0x00, 0xF3, 0x0F, 0x10, 0x88, 0x84, 0x8C, 0x00, 0x00
49 | };
50 |
51 | CleanlinessDetourAddress = Resources.Memory.GetInstance().CreateDetour(_cleanlinessAddress, asm, 8);
52 | return;
53 | }
54 |
55 | ShowError("Cleanliness", sig);
56 | }
57 |
58 | public void Cleanup()
59 | {
60 | var mem = Resources.Memory.GetInstance();
61 |
62 | if (_paintAddress > 0)
63 | {
64 | mem.WriteArrayMemory(_paintAddress, new byte[] { 0x41, 0x0F, 0x11, 0x4A, 0x10 });
65 | Free(PaintDetourAddress);
66 | }
67 |
68 | if (_cleanlinessAddress <= 0) return;
69 | mem.WriteArrayMemory(_cleanlinessAddress, new byte[] { 0xF3, 0x0F, 0x10, 0x88, 0x84, 0x8C, 0x00, 0x00 });
70 | Free(CleanlinessDetourAddress);
71 | }
72 |
73 | public void Reset()
74 | {
75 | var fields = typeof(CustomizationCheats).GetFields().Where(f => f.FieldType == typeof(UIntPtr));
76 | foreach (var field in fields)
77 | {
78 | field.SetValue(this, UIntPtr.Zero);
79 | }
80 | }
81 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Cheats/ForzaHorizon4/EnvironmentCheats.cs:
--------------------------------------------------------------------------------
1 | using static Forza_Mods_AIO.Resources.Memory;
2 |
3 | namespace Forza_Mods_AIO.Cheats.ForzaHorizon4;
4 |
5 | public class EnvironmentCheats : CheatsUtilities, ICheatsBase
6 | {
7 | private UIntPtr _sunRgbAddress;
8 | public UIntPtr SunRgbDetourAddress;
9 | private UIntPtr _timeAddress;
10 | public UIntPtr TimeDetourAddress;
11 |
12 | public async Task CheatSunRgb()
13 | {
14 | _sunRgbAddress = 0;
15 | SunRgbDetourAddress = 0;
16 |
17 | const string sig = "41 0F ? ? 48 83 C4 ? 41 ? C3 48 8D";
18 | _sunRgbAddress = await SmartAobScan(sig);
19 |
20 | if (_sunRgbAddress > 0)
21 | {
22 | var asm = new byte[]
23 | {
24 | 0x80, 0x3D, 0x2B, 0x00, 0x00, 0x00, 0x01, 0x75, 0x1C, 0x48, 0x83, 0xEC, 0x10, 0xF3, 0x0F, 0x7F, 0x14,
25 | 0x24, 0x0F, 0x10, 0x15, 0x1A, 0x00, 0x00, 0x00, 0x0F, 0x59, 0xDA, 0xF3, 0x0F, 0x6F, 0x14, 0x24, 0x48,
26 | 0x83, 0xC4, 0x10, 0x41, 0x0F, 0x11, 0x1E, 0x48, 0x83, 0xC4, 0x20
27 | };
28 |
29 | SunRgbDetourAddress = GetInstance().CreateDetour(_sunRgbAddress, asm, 8);
30 | return;
31 | }
32 |
33 | ShowError("Sun rgb", sig);
34 | }
35 |
36 | public async Task CheatTime()
37 | {
38 | _timeAddress = 0;
39 | TimeDetourAddress = 0;
40 |
41 | const string sig = "44 0F ? ? ? ? F2 0F ? ? ? 48 83 C4";
42 | _timeAddress = await SmartAobScan(sig) + 6;
43 |
44 | if (_timeAddress > 6)
45 | {
46 | var asm = new byte[]
47 | {
48 | 0xF2, 0x0F, 0x11, 0x05, 0x24, 0x00, 0x00, 0x00, 0x80, 0x3D, 0x14, 0x00, 0x00, 0x00, 0x01, 0x75, 0x08,
49 | 0xF2, 0x0F, 0x10, 0x05, 0x0B, 0x00, 0x00, 0x00, 0xF2, 0x0F, 0x11, 0x43, 0x08
50 | };
51 |
52 | TimeDetourAddress = GetInstance().CreateDetour(_timeAddress, asm, 5);
53 | return;
54 | }
55 |
56 | ShowError("Manual time", sig);
57 | }
58 |
59 | public void Cleanup()
60 | {
61 | var mem = GetInstance();
62 |
63 | if (_sunRgbAddress > 0)
64 | {
65 | mem.WriteArrayMemory(_sunRgbAddress, new byte[] { 0x41, 0x0F, 0x11, 0x1E, 0x48, 0x83, 0xC4, 0x20 });
66 | Free(SunRgbDetourAddress);
67 | }
68 |
69 | if (_timeAddress <= 6) return;
70 | mem.WriteArrayMemory(_timeAddress, new byte[] { 0xF2, 0x0F, 0x11, 0x43, 0x08 });
71 | Free(TimeDetourAddress);
72 | }
73 |
74 | public void Reset()
75 | {
76 | var fields = typeof(EnvironmentCheats).GetFields().Where(f => f.FieldType == typeof(UIntPtr));
77 | foreach (var field in fields)
78 | {
79 | field.SetValue(this, UIntPtr.Zero);
80 | }
81 | }
82 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Cheats/ForzaHorizon4/PhotomodeCheats.cs:
--------------------------------------------------------------------------------
1 | using static Forza_Mods_AIO.Resources.Memory;
2 |
3 | namespace Forza_Mods_AIO.Cheats.ForzaHorizon4;
4 |
5 | public class PhotomodeCheats : CheatsUtilities, ICheatsBase
6 | {
7 | private UIntPtr _noClipAddress;
8 | public UIntPtr NoClipDetourAddress;
9 | private UIntPtr _noHeightLimitAddress;
10 | public UIntPtr NoHeightLimitDetourAddress;
11 | private UIntPtr _increasedZoomAddress;
12 | public UIntPtr IncreasedZoomDetourAddress;
13 | public UIntPtr MainModifiersAddress;
14 | public UIntPtr SpeedAddress;
15 | public bool WasModifiersScanSuccessful;
16 |
17 | public async Task CheatNoClip()
18 | {
19 | _noClipAddress = 0;
20 | NoClipDetourAddress = 0;
21 |
22 | const string sig = "88 44 ? ? 48 8D ? ? ? 48 89 ? ? 48 C7 45 90";
23 | _noClipAddress = await SmartAobScan(sig);
24 |
25 | if (_noClipAddress > 0)
26 | {
27 | _noClipAddress -= 84;
28 | var asm = new byte[]
29 | {
30 | 0x80, 0x3D, 0x14, 0x00, 0x00, 0x00, 0x01, 0x75, 0x08, 0xC7, 0x44, 0x24, 0x30, 0x00, 0x00, 0x00, 0x00,
31 | 0x0F, 0x11, 0x44, 0x24, 0x34
32 | };
33 |
34 | NoClipDetourAddress = GetInstance().CreateDetour(_noClipAddress, asm, 5);
35 | return;
36 | }
37 |
38 | ShowError("Photo mode no clip", sig);
39 | }
40 |
41 | public async Task CheatNoHeightLimits()
42 | {
43 | _noHeightLimitAddress = 0;
44 | NoHeightLimitDetourAddress = 0;
45 |
46 | const string sig = "F2 0F ? ? ? ? ? ? 66 0F ? ? 0F 2F ? 76";
47 | _noHeightLimitAddress = await SmartAobScan(sig);
48 |
49 | if (_noHeightLimitAddress > 0)
50 | {
51 | var asm = new byte[]
52 | {
53 | 0x80, 0x3D, 0x1D, 0x00, 0x00, 0x00, 0x01, 0x75, 0x0E, 0x68, 0xF9, 0x02, 0x15, 0x50, 0xF3, 0x0F, 0x10,
54 | 0x14, 0x24, 0x48, 0x83, 0xC4, 0x08, 0xF2, 0x0F, 0x10, 0x9E, 0xE0, 0x02, 0x00, 0x00
55 | };
56 | NoHeightLimitDetourAddress = GetInstance().CreateDetour(_noHeightLimitAddress, asm, 8);
57 | return;
58 | }
59 |
60 | ShowError("Photo mode no height limits", sig);
61 | }
62 |
63 | public async Task CheatIncreasedZoom()
64 | {
65 | _increasedZoomAddress = 0;
66 | IncreasedZoomDetourAddress = 0;
67 |
68 | const string sig = "FF 90 ? ? ? ? F3 0F ? ? ? ? ? ? 0F 28 ? F3 0F ? ? F3 0F ? ? ? ? ? ? F3 0F ? ? F3 0F ? ? F3 0F ? ? ? ? ? ? E8";
69 | _increasedZoomAddress = await SmartAobScan(sig);
70 |
71 | if (_increasedZoomAddress > 0)
72 | {
73 | var asm = new byte[]
74 | {
75 | 0xFF, 0x90, 0x30, 0x03, 0x00, 0x00, 0x80, 0x3D, 0x0A, 0x00, 0x00, 0x00, 0x01, 0x75, 0x03, 0x0F, 0x57,
76 | 0xC0
77 | };
78 |
79 | IncreasedZoomDetourAddress = GetInstance().CreateDetour(_increasedZoomAddress, asm, 6);
80 | return;
81 | }
82 |
83 | ShowError("Photo mode increased zoom", sig);
84 | }
85 |
86 | public async Task CheatModifiers()
87 | {
88 | MainModifiersAddress = 0;
89 | SpeedAddress = 0;
90 |
91 | var successCount = 0;
92 |
93 | const string mainModifiersSig = "3B 1D ? ? ? ? 0F 4E";
94 | MainModifiersAddress = await SmartAobScan(mainModifiersSig);
95 | if (MainModifiersAddress <= 0)
96 | {
97 | ShowError("Photo mode main modifiers", mainModifiersSig);
98 | goto skipScans;
99 | }
100 |
101 | var mainRelative = GetInstance().ReadMemory(MainModifiersAddress + 2);
102 | MainModifiersAddress = (nuint)((nint)MainModifiersAddress + mainRelative + 6);
103 | ++successCount;
104 |
105 | const string speedSig = "F3 0F ? ? ? ? ? ? F3 0F ? ? ? ? ? ? 44 0F ? ? ? ? ? ? 44 0F ? ? ? ? ? ? 0F C6 C9";
106 | SpeedAddress = await SmartAobScan(speedSig);
107 | if (SpeedAddress <= 0)
108 | {
109 | ShowError("Photo mode speed modifiers", speedSig);
110 | goto skipScans;
111 | }
112 |
113 | var speedRelative = GetInstance().ReadMemory(SpeedAddress + 4);
114 | SpeedAddress = (nuint)((nint)SpeedAddress + speedRelative + 8);
115 | ++successCount;
116 |
117 | skipScans:
118 | WasModifiersScanSuccessful = successCount == 2;
119 | }
120 |
121 | public void Cleanup()
122 | {
123 | var mem = GetInstance();
124 |
125 | if (_noHeightLimitAddress > 0)
126 | {
127 | mem.WriteArrayMemory(_noHeightLimitAddress, new byte[] { 0xF2, 0x0F, 0x10, 0x9E, 0xE0, 0x02, 0x00, 0x00 });
128 | Free(NoHeightLimitDetourAddress);
129 | }
130 |
131 | if (_noClipAddress > 0)
132 | {
133 | mem.WriteArrayMemory(_noClipAddress, new byte[] { 0x0F, 0x11, 0x44, 0x24, 0x34 });
134 | Free(NoClipDetourAddress);
135 | }
136 |
137 | if (_increasedZoomAddress > 0)
138 | {
139 | mem.WriteArrayMemory(_increasedZoomAddress, new byte[] { 0xFF, 0x90, 0x30, 0x03, 0x00, 0x00 });
140 | Free(IncreasedZoomDetourAddress);
141 | }
142 | }
143 |
144 | public void Reset()
145 | {
146 | WasModifiersScanSuccessful = false;
147 | var fields = typeof(PhotomodeCheats).GetFields().Where(f => f.FieldType == typeof(UIntPtr));
148 | foreach (var field in fields)
149 | {
150 | field.SetValue(this, UIntPtr.Zero);
151 | }
152 | }
153 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Cheats/ForzaHorizon4/Sql.cs:
--------------------------------------------------------------------------------
1 | using Forza_Mods_AIO.Resources;
2 | using Memory;
3 | using static Forza_Mods_AIO.Resources.Cheats;
4 | using static Forza_Mods_AIO.Resources.Memory;
5 |
6 | namespace Forza_Mods_AIO.Cheats.ForzaHorizon4;
7 |
8 | public class Sql : CheatsUtilities, ICheatsBase
9 | {
10 | private UIntPtr _cDatabaseAddress, _ptr;
11 | public bool WereScansSuccessful;
12 |
13 | public async Task SqlExecAobScan()
14 | {
15 | WereScansSuccessful = false;
16 | _cDatabaseAddress = 0;
17 | _ptr = 0;
18 |
19 | const string sig = "0F 84 ? ? ? ? 48 8B ? ? ? ? ? 48 8D ? ? ? ? ? 66 0F";
20 | _cDatabaseAddress = await SmartAobScan(sig);
21 |
22 | if (_cDatabaseAddress > 0)
23 | {
24 | var relativeAddress = _cDatabaseAddress + 0x6 + 0x3;
25 | var relative = GetInstance().ReadMemory(relativeAddress);
26 | var pCDataBaseAddress = _cDatabaseAddress + (nuint)relative + 0x6 + 0x7;
27 | _ptr = GetInstance().ReadMemory(pCDataBaseAddress);
28 | WereScansSuccessful = true;
29 | return;
30 | }
31 |
32 | ShowError("Sql", sig);
33 | }
34 |
35 | private static nuint GetVirtualFunctionPtr(nuint ptr, int index)
36 | {
37 | var mem = GetInstance();
38 | var pVTable = mem.ReadMemory(ptr);
39 | var lpBaseAddress = pVTable + (nuint)nuint.Size * (nuint)index;
40 | var result = mem.ReadMemory(lpBaseAddress);
41 | return result;
42 | }
43 |
44 | public Task Query(string command)
45 | {
46 | var memory = GetInstance();
47 | var procHandle = memory.MProc.Handle;
48 |
49 | var rcx = _ptr;
50 | const int virtualFunctionIndex = 9;
51 | var callFunction = GetVirtualFunctionPtr(_ptr, virtualFunctionIndex);
52 | var shellCodeAddress = Imps.VirtualAllocEx(procHandle, 0, 0x1000, 0x3000, 0x40);
53 | var rdx = Imps.VirtualAllocEx(procHandle, 0, 0x1000, 0x3000, 0x40);
54 | var r8 = Imps.VirtualAllocEx(procHandle, 0, 0x1000, 0x3000, 0x40);
55 | var rdxBytes = BitConverter.GetBytes(rdx);
56 | var r8Bytes = BitConverter.GetBytes(r8);
57 | var callBytes = BitConverter.GetBytes(callFunction);
58 |
59 | byte[] shellCode =
60 | [
61 | 0x48, 0xBA, rdxBytes[0], rdxBytes[1], rdxBytes[2], rdxBytes[3], rdxBytes[4], rdxBytes[5], rdxBytes[6],
62 | rdxBytes[7], 0x49, 0xB8, r8Bytes[0], r8Bytes[1], r8Bytes[2], r8Bytes[3], r8Bytes[4], r8Bytes[5], r8Bytes[6],
63 | r8Bytes[7], 0xFF, 0x25, 0x00, 0x00, 0x00, 0x00, callBytes[0], callBytes[1], callBytes[2], callBytes[3],
64 | callBytes[4], callBytes[5], callBytes[6], callBytes[7]
65 | ];
66 |
67 | memory.WriteStringMemory(r8, command + "\0");
68 | memory.WriteArrayMemory(shellCodeAddress, shellCode);
69 |
70 | GetClass().DisableCreateRemoteThreadChecks();
71 | var thread = Imports.CreateRemoteThread(procHandle, 0, 0, shellCodeAddress, rcx, 0, out _);
72 | _ = Imports.WaitForSingleObject(thread, int.MaxValue);
73 | Imports.CloseHandle(thread);
74 | GetClass().Cleanup();
75 | Free(shellCodeAddress);
76 | Free(r8);
77 | Free(rdx);
78 | return Task.CompletedTask;
79 | }
80 |
81 | public void Cleanup()
82 | {
83 | }
84 |
85 | public void Reset()
86 | {
87 | WereScansSuccessful = false;
88 | var fields = typeof(Sql).GetFields().Where(f => f.FieldType == typeof(UIntPtr));
89 | foreach (var field in fields)
90 | {
91 | field.SetValue(this, UIntPtr.Zero);
92 | }
93 | }
94 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Cheats/ForzaHorizon4/UnlocksCheats.cs:
--------------------------------------------------------------------------------
1 | using static Forza_Mods_AIO.Resources.Memory;
2 |
3 | namespace Forza_Mods_AIO.Cheats.ForzaHorizon4;
4 |
5 | public class UnlocksCheats : CheatsUtilities, ICheatsBase
6 | {
7 | private UIntPtr _creditsAddress;
8 | public UIntPtr CreditsDetourAddress;
9 | private UIntPtr _xpPointsAddress;
10 | public UIntPtr XpPointsDetourAddress;
11 | private UIntPtr _xpAddress;
12 | public UIntPtr XpDetourAddress;
13 | private UIntPtr _spinsAddress;
14 | public UIntPtr SpinsDetourAddress;
15 | private UIntPtr _skillPointsAddress;
16 | public UIntPtr SkillPointsDetourAddress;
17 |
18 | public async Task CheatCredits()
19 | {
20 | _creditsAddress = 0;
21 | CreditsDetourAddress = 0;
22 |
23 | const string sig = "89 84 ? ? ? ? ? 4C 8D ? ? ? ? ? 48 8B ? 48 8D";
24 | _creditsAddress = await SmartAobScan(sig);
25 |
26 | if (_creditsAddress > 0)
27 | {
28 | var asm = new byte[]
29 | {
30 | 0x80, 0x3D, 0x1D, 0x00, 0x00, 0x00, 0x01, 0x75, 0x0F, 0x81, 0x7F, 0xB4, 0x43, 0x72, 0x65, 0x64, 0x75,
31 | 0x06, 0x8B, 0x05, 0x0D, 0x00, 0x00, 0x00, 0x89, 0x84, 0x24, 0x80, 0x00, 0x00, 0x00
32 | };
33 |
34 | CreditsDetourAddress = GetInstance().CreateDetour(_creditsAddress, asm, 7);
35 | return;
36 | }
37 |
38 | ShowError("Credits", sig);
39 | }
40 |
41 | public async Task CheatXp()
42 | {
43 | _xpPointsAddress = 0;
44 | XpPointsDetourAddress = 0;
45 | _xpAddress = 0;
46 | XpDetourAddress = 0;
47 |
48 | const string sig = "44 89 ? ? 8B 89 ? ? ? ? 85 C9";
49 | _xpPointsAddress = await SmartAobScan(sig) + 4;
50 | if (_xpPointsAddress > 4)
51 | {
52 | _xpAddress = _xpPointsAddress + 14;
53 | var pointsAsm = new byte[]
54 | {
55 | 0x80, 0x3D, 0x14, 0x00, 0x00, 0x00, 0x01, 0x75, 0x07, 0xC6, 0x81, 0xC0, 0x00, 0x00, 0x00, 0x01, 0x8B,
56 | 0x89, 0xC0, 0x00, 0x00, 0x00
57 | };
58 |
59 | var asm = new byte[]
60 | {
61 | 0x41, 0x8B, 0x85, 0xE8, 0x00, 0x00, 0x00, 0x80, 0x3D, 0x0D, 0x00, 0x00, 0x00, 0x01, 0x75, 0x06, 0x8B,
62 | 0x05, 0x06, 0x00, 0x00, 0x00
63 | };
64 |
65 | XpPointsDetourAddress = GetInstance().CreateDetour(_xpPointsAddress, pointsAsm, 6);
66 | XpDetourAddress = GetInstance().CreateDetour(_xpAddress, asm, 7);
67 | return;
68 | }
69 |
70 | ShowError("Xp", sig);
71 | }
72 |
73 | public async Task CheatSpins()
74 | {
75 | _spinsAddress = 0;
76 | SpinsDetourAddress = 0;
77 |
78 | const string sig = "85 C0 89 44 ? ? 48 8D ? ? ? 48 8D ? ? ? 48 0F ? ? 83 FB";
79 | _spinsAddress = await SmartAobScan(sig);
80 |
81 | if (_spinsAddress > 0)
82 | {
83 | var asm = new byte[]
84 | {
85 | 0x80, 0x3D, 0x13, 0x00, 0x00, 0x00, 0x01, 0x75, 0x06, 0x8B, 0x05, 0x0C, 0x00, 0x00, 0x00, 0x85, 0xC0,
86 | 0x89, 0x44, 0x24, 0x38
87 | };
88 |
89 | SpinsDetourAddress = GetInstance().CreateDetour(_spinsAddress, asm, 6);
90 | return;
91 | }
92 |
93 | ShowError("Spins", sig);
94 | }
95 |
96 | public async Task CheatSkillPoints()
97 | {
98 | _skillPointsAddress = 0;
99 | SkillPointsDetourAddress = 0;
100 |
101 | const string sig = "85 D2 78 ? 89 54 ? ? 48 83 EC ? 48 83 E9";
102 | _skillPointsAddress = await SmartAobScan(sig) + 4;
103 |
104 | if (_skillPointsAddress > 4)
105 | {
106 | var asm = new byte[]
107 | {
108 | 0x80, 0x3D, 0x15, 0x00, 0x00, 0x00, 0x01, 0x75, 0x06, 0x8B, 0x15, 0x0E, 0x00, 0x00, 0x00, 0x89, 0x54,
109 | 0x24, 0x10, 0x48, 0x83, 0xEC, 0x28
110 | };
111 |
112 | SkillPointsDetourAddress = GetInstance().CreateDetour(_skillPointsAddress, asm, 8);
113 | return;
114 | }
115 |
116 | ShowError("Skill points", sig);
117 | }
118 |
119 | public void Cleanup()
120 | {
121 | var mem = GetInstance();
122 |
123 | if (_creditsAddress > 0)
124 | {
125 | mem.WriteArrayMemory(_creditsAddress, new byte[] { 0x89, 0x84, 0x24, 0x80, 0x00, 0x00, 0x00 });
126 | Free(CreditsDetourAddress);
127 | }
128 |
129 | if (_xpPointsAddress > 4)
130 | {
131 | mem.WriteArrayMemory(_xpPointsAddress, new byte[] { 0x8B, 0x89, 0xC0, 0x00, 0x00, 0x00 });
132 | Free(XpPointsDetourAddress);
133 | }
134 |
135 | if (_xpAddress > 0)
136 | {
137 | mem.WriteArrayMemory(_xpAddress, new byte[] { 0x41, 0x8B, 0x85, 0xE8, 0x00, 0x00, 0x00 });
138 | Free(XpDetourAddress);
139 | }
140 |
141 | if (_spinsAddress > 0)
142 | {
143 | mem.WriteArrayMemory(_spinsAddress, new byte[] { 0x85, 0xC0, 0x89, 0x44, 0x24, 0x38 });
144 | Free(SpinsDetourAddress);
145 | }
146 |
147 | if (_skillPointsAddress <= 4) return;
148 | mem.WriteArrayMemory(_skillPointsAddress, new byte[] { 0x89, 0x54, 0x24, 0x10, 0x48, 0x83, 0xEC, 0x28 });
149 | Free(SkillPointsDetourAddress);
150 | }
151 |
152 | public void Reset()
153 | {
154 | var fields = typeof(CameraCheats).GetFields().Where(f => f.FieldType == typeof(UIntPtr));
155 | foreach (var field in fields)
156 | {
157 | field.SetValue(this, UIntPtr.Zero);
158 | }
159 | }
160 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Cheats/ForzaHorizon5/Bypass.cs:
--------------------------------------------------------------------------------
1 | using Forza_Mods_AIO.Models;
2 | using static Forza_Mods_AIO.Resources.Cheats;
3 | using static Forza_Mods_AIO.Resources.Memory;
4 | using Timer = System.Timers.Timer;
5 |
6 | namespace Forza_Mods_AIO.Cheats.ForzaHorizon5;
7 |
8 | public class Bypass : CheatsUtilities, ICheatsBase
9 | {
10 | public readonly DebugSession BypassDebug = new("Bypass", []);
11 |
12 | public UIntPtr CallAddress;
13 | public UIntPtr XxhCheck;
14 | public UIntPtr OrigXxhCheck;
15 | public UIntPtr Ret;
16 | private bool _scanning;
17 | private Timer _antiCheatTimer = null!;
18 |
19 | public async Task DisableCrcChecks()
20 | {
21 | var wasScanning = _scanning;
22 | while (_scanning)
23 | {
24 | await Task.Delay(1);
25 | }
26 |
27 | if (wasScanning)
28 | {
29 | return;
30 | }
31 |
32 | _scanning = true;
33 | CallAddress = 0;
34 |
35 | Ret = await SmartAobScan("C3");
36 | if (Ret == 0)
37 | {
38 | ShowError("Bypass", "C3");
39 | return;
40 | }
41 |
42 | const string sig = "48 8B D9 48 8D 05 ? ? ? ? 48 89 01 E8 ? ? ? ? 48 8B CB 48 83 C4 20 5B E9";
43 | CallAddress = await SmartAobScan(sig);
44 |
45 | if (CallAddress > 3)
46 | {
47 | UIntPtr pXxhCheckPfns = CallAddress + 0x3;
48 | int pPfnRelative = GetInstance().ReadMemory(pXxhCheckPfns + 0x3);
49 | UIntPtr xxhCheckPfns = (UIntPtr)(pPfnRelative + (IntPtr)pXxhCheckPfns + 0x7);
50 | XxhCheck = xxhCheckPfns + 0x30;
51 | OrigXxhCheck = GetInstance().ReadMemory(XxhCheck);
52 |
53 |
54 | _antiCheatTimer = new Timer();
55 | _antiCheatTimer.Interval = 10_000;
56 | _antiCheatTimer.Elapsed += async (_, _) =>
57 | {
58 | var mem = GetInstance();
59 | foreach (var pair in CachedInstances.Where(kv => typeof(IRevertBase).IsAssignableFrom(kv.Key)))
60 | {
61 | ((IRevertBase)pair.Value).Revert();
62 | }
63 | mem.WriteMemory(XxhCheck, OrigXxhCheck);
64 | await Task.Delay(1_000);
65 | mem.WriteMemory(XxhCheck, Ret);
66 | foreach (var pair in CachedInstances.Where(kv => typeof(IRevertBase).IsAssignableFrom(kv.Key)))
67 | {
68 | ((IRevertBase)pair.Value).Continue();
69 | }
70 | };
71 |
72 | GetInstance().WriteMemory(XxhCheck, Ret);
73 | _antiCheatTimer.Start();
74 | _scanning = false;
75 | return;
76 | }
77 |
78 | _scanning = false;
79 | ShowError("Bypass", sig);
80 | }
81 |
82 | public void Cleanup()
83 | {
84 | var mem = GetInstance();
85 | if (XxhCheck <= 3) return;
86 | _antiCheatTimer.Stop();
87 | mem.WriteMemory(XxhCheck, OrigXxhCheck);
88 | }
89 |
90 | public void Reset()
91 | {
92 | _scanning = false;
93 | if (_antiCheatTimer != null!)
94 | {
95 | _antiCheatTimer.Stop();
96 | _antiCheatTimer = null!;
97 | }
98 | var fields = typeof(Bypass).GetFields().Where(f => f.FieldType == typeof(UIntPtr));
99 | foreach (var field in fields)
100 | {
101 | field.SetValue(this, UIntPtr.Zero);
102 | }
103 | }
104 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Cheats/ForzaHorizon5/CameraCheats.cs:
--------------------------------------------------------------------------------
1 | using static Forza_Mods_AIO.Resources.Cheats;
2 | using static Forza_Mods_AIO.Resources.Memory;
3 |
4 | namespace Forza_Mods_AIO.Cheats.ForzaHorizon5;
5 |
6 | public class CameraCheats : CheatsUtilities, ICheatsBase, IRevertBase
7 | {
8 | private UIntPtr _cameraAddress;
9 | public UIntPtr CameraDetourAddress;
10 |
11 | public UIntPtr ChaseAddress;
12 | public UIntPtr ChaseFarAddress;
13 | public UIntPtr DriverAddress;
14 | public UIntPtr HoodAddress;
15 | public UIntPtr BumperAddress;
16 | public bool WereLimitersScanned;
17 |
18 | public async Task CheatLimiters()
19 | {
20 | WereLimitersScanned = false;
21 | ChaseAddress = 0;
22 | ChaseFarAddress = 0;
23 | DriverAddress = 0;
24 | HoodAddress = 0;
25 | BumperAddress = 0;
26 |
27 | var processMainModule = GetInstance().MProc.Process.MainModule;
28 | if (processMainModule == null)
29 | {
30 | return;
31 | }
32 |
33 | var successCount = 0;
34 | var minRange = processMainModule.BaseAddress;
35 | var maxRange = minRange + processMainModule.ModuleMemorySize;
36 |
37 | const string chaseSig = "90 40 CD CC 8C 40 1F 85 2B 3F 00 00 00 40";
38 | var chaseList = await GetInstance().AoBScan(minRange, maxRange, chaseSig, true);
39 | var chaseEnumerable = chaseList as UIntPtr[] ?? chaseList.ToArray();
40 | if (chaseEnumerable.Length != 2)
41 | {
42 | ShowError("Chase Camera Limiters", chaseSig);
43 | goto skipScans;
44 | }
45 |
46 | ChaseAddress = chaseEnumerable.FirstOrDefault() - 10;
47 | ChaseFarAddress = chaseEnumerable.LastOrDefault() - 10;
48 | ++successCount;
49 |
50 | var newScanStart = (long)(ChaseAddress - 0x1000);
51 | var newScanEnd = (long)(ChaseAddress + 0x1000);
52 |
53 | const string driverHoodSig = "CD CC 4C 3E 00 50 43 47 00 00 34 42 00 00 20";
54 | var driverHoodList = await GetInstance().AoBScan(newScanStart, newScanEnd, driverHoodSig, true);
55 | var driverHoodEnumerable = driverHoodList as UIntPtr[] ?? driverHoodList.ToArray();
56 | if (driverHoodEnumerable.Length != 2)
57 | {
58 | ShowError("Bumper/Hood Camera Limiters", driverHoodSig);
59 | goto skipScans;
60 | }
61 |
62 | HoodAddress = driverHoodEnumerable.FirstOrDefault() - 0x24;
63 | DriverAddress = driverHoodEnumerable.LastOrDefault() - 0x24;
64 | ++successCount;
65 |
66 | const string bumperSig = "00 CD CC 4C 3E ? ? ? 47 00 ? 54";
67 | var bumperList = await GetInstance().AoBScan(newScanStart, newScanEnd, bumperSig, true);
68 | var bumperEnumerable = bumperList as UIntPtr[] ?? bumperList.ToArray();
69 | if (bumperEnumerable.Length == 0)
70 | {
71 | ShowError("Bumper Camera Limiter", bumperSig);
72 | goto skipScans;
73 | }
74 |
75 | BumperAddress = bumperEnumerable.FirstOrDefault() - 0x23;
76 | ++successCount;
77 |
78 | skipScans:
79 | WereLimitersScanned = successCount == 3;
80 | }
81 |
82 | public async Task CheatCamera()
83 | {
84 | _cameraAddress = 0;
85 | CameraDetourAddress = 0;
86 |
87 | const string sig = "0F 10 ? B0 ? 0F 28 ? ? ? F3 0F";
88 | _cameraAddress = await SmartAobScan(sig);
89 |
90 | if (_cameraAddress > 0)
91 | {
92 | if (GetClass().CallAddress <= 3)
93 | {
94 | await GetClass().DisableCrcChecks();
95 | }
96 |
97 | if (GetClass().CallAddress <= 3) return;
98 |
99 | var asm = new byte[]
100 | {
101 | 0x0F, 0x10, 0x01, 0xB0, 0x01, 0x80, 0x3D, 0x4D, 0x00, 0x00, 0x00, 0x01, 0x75, 0x16, 0x81, 0x79, 0x26,
102 | 0xEC, 0x41, 0x00, 0x00, 0x75, 0x02, 0xEB, 0x2A, 0x81, 0x79, 0x26, 0x16, 0x43, 0x00, 0x00, 0x75, 0x02,
103 | 0xEB, 0x1F, 0x80, 0x3D, 0x33, 0x00, 0x00, 0x00, 0x01, 0x75, 0x27, 0x81, 0x79, 0x26, 0x96, 0x42, 0x67,
104 | 0x7B, 0x75, 0x02, 0xEB, 0x15, 0x81, 0x79, 0x26, 0x54, 0x44, 0x4D, 0xA1, 0x75, 0x13, 0xEB, 0x0A, 0xF3,
105 | 0x0F, 0x10, 0x05, 0x0F, 0x00, 0x00, 0x00, 0xEB, 0x07, 0x0F, 0x10, 0x05, 0x0B, 0x00, 0x00, 0x00
106 | };
107 |
108 | CameraDetourAddress = GetInstance().CreateDetour(_cameraAddress, asm, 5);
109 | return;
110 | }
111 |
112 | ShowError("Fov and Camera Offset", sig);
113 | }
114 |
115 | public void Cleanup()
116 | {
117 | var mem = GetInstance();
118 |
119 | if (_cameraAddress > 0)
120 | {
121 | mem.WriteArrayMemory(_cameraAddress, new byte[] { 0x0F, 0x10, 0x01, 0xB0, 0x01 });
122 | Free(CameraDetourAddress);
123 | }
124 | }
125 |
126 | public void Reset()
127 | {
128 | WereLimitersScanned = false;
129 | var fields = typeof(CameraCheats).GetFields().Where(f => f.FieldType == typeof(UIntPtr));
130 | foreach (var field in fields)
131 | {
132 | field.SetValue(this, UIntPtr.Zero);
133 | }
134 | }
135 |
136 | public void Revert()
137 | {
138 | var mem = GetInstance();
139 |
140 | if (_cameraAddress > 0)
141 | {
142 | mem.WriteArrayMemory(_cameraAddress, new byte[] { 0x0F, 0x10, 0x01, 0xB0, 0x01 });
143 | }
144 | }
145 |
146 | public void Continue()
147 | {
148 | var mem = GetInstance();
149 |
150 | if (_cameraAddress > 0)
151 | {
152 | mem.WriteArrayMemory(_cameraAddress, CalculateDetour(_cameraAddress, CameraDetourAddress, 5));
153 | }
154 | }
155 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Cheats/ForzaHorizon5/EnvironmentCheats.cs:
--------------------------------------------------------------------------------
1 | using static Forza_Mods_AIO.Resources.Cheats;
2 | using static Forza_Mods_AIO.Resources.Memory;
3 |
4 | namespace Forza_Mods_AIO.Cheats.ForzaHorizon5;
5 |
6 | public class EnvironmentCheats : CheatsUtilities, ICheatsBase, IRevertBase
7 | {
8 | private UIntPtr _sunRgbAddress;
9 | public UIntPtr SunRgbDetourAddress;
10 | private UIntPtr _timeAddress;
11 | public UIntPtr TimeDetourAddress;
12 |
13 | public async Task CheatSunRgb()
14 | {
15 | _sunRgbAddress = 0;
16 | SunRgbDetourAddress = 0;
17 |
18 | const string sig = "41 0F ? ? 48 83 C4 ? 41 ? C3 48 8D";
19 | _sunRgbAddress = await SmartAobScan(sig);
20 |
21 | if (_sunRgbAddress > 0)
22 | {
23 | if (GetClass().CallAddress <= 3)
24 | {
25 | await GetClass().DisableCrcChecks();
26 | }
27 |
28 | if (GetClass().CallAddress <= 3) return;
29 |
30 | var asm = new byte[]
31 | {
32 | 0x80, 0x3D, 0x2B, 0x00, 0x00, 0x00, 0x01, 0x75, 0x1C, 0x48, 0x83, 0xEC, 0x10, 0xF3, 0x0F, 0x7F, 0x14,
33 | 0x24, 0x0F, 0x10, 0x15, 0x1A, 0x00, 0x00, 0x00, 0x0F, 0x59, 0xDA, 0xF3, 0x0F, 0x6F, 0x14, 0x24, 0x48,
34 | 0x83, 0xC4, 0x10, 0x41, 0x0F, 0x11, 0x1E, 0x48, 0x83, 0xC4, 0x20
35 | };
36 |
37 | SunRgbDetourAddress = GetInstance().CreateDetour(_sunRgbAddress, asm, 8);
38 | return;
39 | }
40 |
41 | ShowError("Sun rgb", sig);
42 | }
43 |
44 | public async Task CheatTime()
45 | {
46 | _timeAddress = 0;
47 | TimeDetourAddress = 0;
48 |
49 | const string sig = "44 0F ? ? ? ? F2 0F ? ? ? 48 83 C4";
50 | _timeAddress = await SmartAobScan(sig) + 6;
51 |
52 | if (_timeAddress > 6)
53 | {
54 | if (GetClass().CallAddress <= 3)
55 | {
56 | await GetClass().DisableCrcChecks();
57 | }
58 |
59 | if (GetClass().CallAddress <= 3) return;
60 |
61 | var asm = new byte[]
62 | {
63 | 0xF2, 0x0F, 0x11, 0x05, 0x24, 0x00, 0x00, 0x00, 0x80, 0x3D, 0x14, 0x00, 0x00, 0x00, 0x01, 0x75, 0x08,
64 | 0xF2, 0x0F, 0x10, 0x05, 0x0B, 0x00, 0x00, 0x00, 0xF2, 0x0F, 0x11, 0x43, 0x08
65 | };
66 |
67 | TimeDetourAddress = GetInstance().CreateDetour(_timeAddress, asm, 5);
68 | return;
69 | }
70 |
71 | ShowError("Manual time", sig);
72 | }
73 |
74 | public void Cleanup()
75 | {
76 | var mem = GetInstance();
77 |
78 | if (_sunRgbAddress > 0)
79 | {
80 | mem.WriteArrayMemory(_sunRgbAddress, new byte[] { 0x41, 0x0F, 0x11, 0x1E, 0x48, 0x83, 0xC4, 0x20 });
81 | Free(SunRgbDetourAddress);
82 | }
83 |
84 | if (_timeAddress <= 6) return;
85 | mem.WriteArrayMemory(_timeAddress, new byte[] { 0xF2, 0x0F, 0x11, 0x43, 0x08 });
86 | Free(TimeDetourAddress);
87 | }
88 |
89 | public void Reset()
90 | {
91 | var fields = typeof(EnvironmentCheats).GetFields().Where(f => f.FieldType == typeof(UIntPtr));
92 | foreach (var field in fields)
93 | {
94 | field.SetValue(this, UIntPtr.Zero);
95 | }
96 | }
97 |
98 | public void Revert()
99 | {
100 | var mem = GetInstance();
101 |
102 | if (_sunRgbAddress > 0)
103 | {
104 | mem.WriteArrayMemory(_sunRgbAddress, new byte[] { 0x41, 0x0F, 0x11, 0x1E, 0x48, 0x83, 0xC4, 0x20 });
105 | }
106 |
107 | if (_timeAddress <= 6) return;
108 | mem.WriteArrayMemory(_timeAddress, new byte[] { 0xF2, 0x0F, 0x11, 0x43, 0x08 });
109 | }
110 |
111 | public void Continue()
112 | {
113 | var mem = GetInstance();
114 |
115 | if (_sunRgbAddress > 0)
116 | {
117 | mem.WriteArrayMemory(_sunRgbAddress, CalculateDetour(_sunRgbAddress, SunRgbDetourAddress, 8));
118 | }
119 |
120 | if (_timeAddress <= 6) return;
121 | mem.WriteArrayMemory(_timeAddress, CalculateDetour(_timeAddress, TimeDetourAddress, 5));
122 | }
123 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Cheats/ForzaHorizon5/Sql.cs:
--------------------------------------------------------------------------------
1 | using Forza_Mods_AIO.Resources;
2 | using Memory;
3 | using static Forza_Mods_AIO.Resources.Memory;
4 |
5 | namespace Forza_Mods_AIO.Cheats.ForzaHorizon5;
6 |
7 | public class Sql : CheatsUtilities, ICheatsBase
8 | {
9 | private UIntPtr _cDatabaseAddress, _ptr;
10 | public bool WereScansSuccessful;
11 |
12 | public async Task SqlExecAobScan()
13 | {
14 | WereScansSuccessful = false;
15 | _cDatabaseAddress = 0;
16 | _ptr = 0;
17 |
18 | const string sig = "0F 84 ? ? ? ? 48 8B 35 ? ? ? ? 48 85 F6 74";
19 | _cDatabaseAddress = await SmartAobScan(sig);
20 |
21 | if (_cDatabaseAddress > 0)
22 | {
23 | var relativeAddress = _cDatabaseAddress + 0x6 + 0x3;
24 | var relative = GetInstance().ReadMemory(relativeAddress);
25 | var pCDataBaseAddress = _cDatabaseAddress + (nuint)relative + 0x6 + 0x7;
26 | _ptr = GetInstance().ReadMemory(pCDataBaseAddress);
27 | WereScansSuccessful = true;
28 | return;
29 | }
30 |
31 | ShowError("Sql", sig);
32 | }
33 |
34 | private static nuint GetVirtualFunctionPtr(nuint ptr, int index)
35 | {
36 | var mem = GetInstance();
37 | var pVTable = mem.ReadMemory(ptr);
38 | var lpBaseAddress = pVTable + (nuint)nuint.Size * (nuint)index;
39 | var result = mem.ReadMemory(lpBaseAddress);
40 | return result;
41 | }
42 |
43 | public async Task Query(string command)
44 | {
45 | var memory = GetInstance();
46 | var procHandle = memory.MProc.Handle;
47 |
48 | var rcx = _ptr;
49 | const int virtualFunctionIndex = 9;
50 | var callFunction = GetVirtualFunctionPtr(_ptr, virtualFunctionIndex);
51 | if (callFunction <= 0)
52 | {
53 | return;
54 | }
55 |
56 | var shellCodeAddress = Imps.VirtualAllocEx(procHandle, 0, 0x1000, 0x3000, 0x40);
57 | var rdx = Imps.VirtualAllocEx(procHandle, 0, 0x1000, 0x3000, 0x40);
58 | var r8 = Imps.VirtualAllocEx(procHandle, 0, 0x1000, 0x3000, 0x40);
59 | var rdxBytes = BitConverter.GetBytes(rdx.ToUInt64());
60 | var r8Bytes = BitConverter.GetBytes(r8.ToUInt64());
61 | var callBytes = BitConverter.GetBytes(callFunction.ToUInt64());
62 |
63 | byte[] shellCode =
64 | [
65 | 0x48, 0xBA, rdxBytes[0], rdxBytes[1], rdxBytes[2], rdxBytes[3], rdxBytes[4], rdxBytes[5], rdxBytes[6],
66 | rdxBytes[7], 0x49, 0xB8, r8Bytes[0], r8Bytes[1], r8Bytes[2], r8Bytes[3], r8Bytes[4], r8Bytes[5], r8Bytes[6],
67 | r8Bytes[7], 0xFF, 0x25, 0x00, 0x00, 0x00, 0x00, callBytes[0], callBytes[1], callBytes[2], callBytes[3],
68 | callBytes[4], callBytes[5], callBytes[6], callBytes[7]
69 | ];
70 |
71 | memory.WriteStringMemory(r8, command + "\0");
72 | memory.WriteArrayMemory(shellCodeAddress, shellCode);
73 | memory.WriteArrayMemory(callFunction + 41, new byte[] { 0xE9, 0xB6, 0x00, 0x00, 0x00, 0x90 });
74 | var thread = Imports.CreateRemoteThread(procHandle, 0, 0, shellCodeAddress, rcx, 0, out _);
75 | await Task.Delay(5);
76 | memory.WriteArrayMemory(callFunction + 41, new byte[] { 0x0F, 0x85, 0xB5, 0x00, 0x00, 0x00 });
77 | _ = Imports.WaitForSingleObject(thread, int.MaxValue);
78 | Imports.CloseHandle(thread);
79 | Free(shellCodeAddress);
80 | Free(r8);
81 | Free(rdx);
82 | }
83 |
84 | public void Cleanup()
85 | {
86 | }
87 |
88 | public void Reset()
89 | {
90 | WereScansSuccessful = false;
91 | var fields = typeof(Sql).GetFields().Where(f => f.FieldType == typeof(UIntPtr));
92 | foreach (var field in fields)
93 | {
94 | field.SetValue(this, UIntPtr.Zero);
95 | }
96 | }
97 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Cheats/ForzaHorizon5/ValueEncryption.cs:
--------------------------------------------------------------------------------
1 | using static Forza_Mods_AIO.Resources.Cheats;
2 | using static Forza_Mods_AIO.Resources.Memory;
3 |
4 | namespace Forza_Mods_AIO.Cheats.ForzaHorizon5;
5 |
6 | public class ValueEncryption : CheatsUtilities, ICheatsBase, IRevertBase
7 | {
8 | private UIntPtr _encryptAddress;
9 |
10 | public async Task CheatDisableValueEncryption()
11 | {
12 | _encryptAddress = 0;
13 |
14 | const string sig = "48 8B ? 48 89 ? ? 48 89 ? ? 48 89 ? ? 55 41 ? 41 ? 48 8D ? ? 48 81 EC ? ? ? ? 48 8B ? ? ? ? ? 48 33 ? 48 89 ? ? 4C 8B ? 48 89";
15 | _encryptAddress = await SmartAobScan(sig);
16 |
17 | if (_encryptAddress > 0)
18 | {
19 | if (GetClass().CallAddress <= 3)
20 | {
21 | await GetClass().DisableCrcChecks();
22 | }
23 |
24 | if (GetClass().CallAddress <= 3) return;
25 |
26 | GetInstance().WriteArrayMemory(_encryptAddress, new byte[] { 0xC3, 0x90, 0x90 });
27 | return;
28 | }
29 |
30 | ShowError("Value Encryption", sig);
31 | }
32 |
33 | public void Cleanup()
34 | {
35 | if (_encryptAddress > 0)
36 | {
37 | GetInstance().WriteArrayMemory(_encryptAddress, new byte[] { 0x48, 0x8B, 0xC4 });
38 | }
39 | }
40 |
41 | public void Reset()
42 | {
43 | var fields = typeof(ValueEncryption).GetFields().Where(f => f.FieldType == typeof(UIntPtr));
44 | foreach (var field in fields)
45 | {
46 | field.SetValue(this, UIntPtr.Zero);
47 | }
48 | }
49 |
50 | public void Revert()
51 | {
52 | if (_encryptAddress > 0)
53 | {
54 | GetInstance().WriteArrayMemory(_encryptAddress, new byte[] { 0x48, 0x8B, 0xC4 });
55 | }
56 | }
57 |
58 | public void Continue()
59 | {
60 | if (_encryptAddress > 0)
61 | {
62 | GetInstance().WriteArrayMemory(_encryptAddress, new byte[] { 0xC3, 0x90, 0x90 });
63 | }
64 | }
65 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Cheats/ICheatsBase.cs:
--------------------------------------------------------------------------------
1 | namespace Forza_Mods_AIO.Cheats;
2 |
3 | public interface ICheatsBase
4 | {
5 | public void Cleanup();
6 | public void Reset();
7 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Cheats/IRevertBase.cs:
--------------------------------------------------------------------------------
1 | namespace Forza_Mods_AIO.Cheats;
2 |
3 | public interface IRevertBase
4 | {
5 | void Revert();
6 | void Continue();
7 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Controls/StatusComboboxItem/StatusComboboxItem.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.ComponentModel;
3 | using System.Windows.Controls;
4 |
5 | namespace Forza_Mods_AIO.Controls.StatusComboboxItem;
6 |
7 | public class StatusComboboxItem : ComboBoxItem
8 | {
9 | public static readonly DependencyProperty IsOnProperty
10 | = DependencyProperty.Register(nameof(IsOn),
11 | typeof(bool),
12 | typeof(StatusComboboxItem),
13 | new PropertyMetadata(default(bool)));
14 |
15 | [Bindable(true)]
16 | [Category("Forza-Mods-AIO")]
17 | public bool IsOn
18 | {
19 | get => (bool)GetValue(IsOnProperty);
20 | set => SetValue(IsOnProperty, value);
21 | }
22 |
23 | static StatusComboboxItem()
24 | {
25 | DefaultStyleKeyProperty.OverrideMetadata(typeof(StatusComboboxItem), new FrameworkPropertyMetadata(typeof(StatusComboboxItem)));
26 | }
27 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Controls/StatusComboboxItem/StatusComboboxItem.xaml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
17 |
18 |
49 |
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Controls/TranslationComboboxItem/TranslationComboboxItem.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 | using System.Windows;
3 | using System.Windows.Controls;
4 |
5 | namespace Forza_Mods_AIO.Controls.TranslationComboboxItem;
6 |
7 | public class TranslationComboboxItem : ComboBoxItem
8 | {
9 | public static readonly DependencyProperty TranslatorsProperty
10 | = DependencyProperty.Register(nameof(Translators),
11 | typeof(string),
12 | typeof(TranslationComboboxItem),
13 | new PropertyMetadata(default(string)));
14 |
15 | public static readonly DependencyProperty LanguageCodeProperty
16 | = DependencyProperty.Register(nameof(LanguageCode),
17 | typeof(string),
18 | typeof(TranslationComboboxItem),
19 | new PropertyMetadata(default(string)));
20 |
21 | [Bindable(true)]
22 | [Category("Forza-Mods-AIO")]
23 | public string Translators
24 | {
25 | get => (string)GetValue(TranslatorsProperty);
26 | set => SetValue(TranslatorsProperty, value);
27 | }
28 |
29 | [Bindable(true)]
30 | [Category("Forza-Mods-AIO")]
31 | public string LanguageCode
32 | {
33 | get => (string)GetValue(LanguageCodeProperty);
34 | set => SetValue(LanguageCodeProperty, value);
35 | }
36 |
37 | static TranslationComboboxItem()
38 | {
39 | DefaultStyleKeyProperty.OverrideMetadata(typeof(TranslationComboboxItem), new FrameworkPropertyMetadata(typeof(TranslationComboboxItem)));
40 | }
41 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Controls/TranslationComboboxItem/TranslationComboboxItem.xaml:
--------------------------------------------------------------------------------
1 |
4 |
52 |
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Converters/BoolParamConverter.cs:
--------------------------------------------------------------------------------
1 | using System.Globalization;
2 | using System.Windows.Data;
3 |
4 | namespace Forza_Mods_AIO.Converters;
5 |
6 | public class BoolParamConverter : IMultiValueConverter
7 | {
8 | public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
9 | {
10 | var isToggled = values.OfType().Any(b => b);
11 | var strings = values.OfType().ToList();
12 | if (strings.Count != 2)
13 | {
14 | return new object();
15 | }
16 |
17 | return isToggled ? strings[0] : strings[1];
18 | }
19 |
20 | public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
21 | {
22 | throw new NotImplementedException();
23 | }
24 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Converters/InstanceEqualsConverter.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Data;
2 | using Forza_Mods_AIO.Resources;
3 |
4 | namespace Forza_Mods_AIO.Converters;
5 |
6 | public class InstanceEqualsConverter : IValueConverter
7 | {
8 | public object Convert(object? value, Type targetType, object? parameter, System.Globalization.CultureInfo culture)
9 | {
10 | return ((Type)parameter!).IsInstanceOfType(value);
11 | }
12 |
13 | public object? ConvertBack(object? value, Type targetType, object? parameter, System.Globalization.CultureInfo culture)
14 | {
15 | if (!(bool)value!)
16 | {
17 | return Binding.DoNothing;
18 | }
19 |
20 | var targetTypeAsType = (Type)parameter!;
21 | return Pages.GetPage(targetTypeAsType);
22 | }
23 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Converters/IntParamConverter.cs:
--------------------------------------------------------------------------------
1 | using System.Globalization;
2 | using System.Windows.Data;
3 |
4 | namespace Forza_Mods_AIO.Converters;
5 |
6 | public class IntParamConverter : IMultiValueConverter
7 | {
8 | public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
9 | {
10 | var index = (int)values[0];
11 | return index + 1 <= values.Length - 1 ? values[index + 1] : new object();
12 | }
13 |
14 | public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
15 | {
16 | throw new NotImplementedException();
17 | }
18 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Converters/MultiplyConverter.cs:
--------------------------------------------------------------------------------
1 | using System.Globalization;
2 | using System.Windows.Data;
3 |
4 | namespace Forza_Mods_AIO.Converters;
5 |
6 | public class MultiplyConverter : IValueConverter
7 | {
8 | public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
9 | {
10 | return System.Convert.ToDouble(value) * System.Convert.ToDouble(parameter);
11 | }
12 |
13 | public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
14 | {
15 | throw new NotImplementedException();
16 | }
17 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Converters/TypeToInstanceConverter.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Data;
2 | using System.Globalization;
3 | using Forza_Mods_AIO.Resources;
4 |
5 | namespace Forza_Mods_AIO.Converters;
6 |
7 | public class TypeToInstanceConverter : IValueConverter
8 | {
9 | public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
10 | {
11 | return Pages.GetPage((Type)parameter!);
12 | }
13 |
14 | public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
15 | {
16 | throw new NotImplementedException();
17 | }
18 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Forza-Mods-AIO.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net8.0-windows
6 | Forza_Mods_AIO
7 | enable
8 | enable
9 | true
10 | false
11 | 2.5.0.0
12 | 2.5.0.0
13 | true
14 | AIO.snk
15 | true
16 | true
17 | true
18 | true
19 | portable
20 | yeahgosuckmydickwiththisblacklistshit
21 | x64
22 | app.manifest
23 | yeahgosuckmydickwiththisblacklistshit
24 | yeahgosuckmydickwiththisblacklistshit
25 | en-US
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 | Resources\External\Memory.dll
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Helpers/Settings.cs:
--------------------------------------------------------------------------------
1 | using System.Configuration;
2 | using System.Windows.Media;
3 |
4 | namespace Forza_Mods_AIO.Helpers;
5 |
6 | public static class Settings
7 | {
8 | public static void SaveThemeColor(Color color)
9 | {
10 | var config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
11 |
12 | // Remove existing setting if it exists
13 | if (config.AppSettings.Settings["ThemeColor"] != null)
14 | {
15 | config.AppSettings.Settings.Remove("ThemeColor");
16 | }
17 |
18 | // Add the new setting
19 | config.AppSettings.Settings.Add("ThemeColor", color.ToString());
20 | config.Save(ConfigurationSaveMode.Modified);
21 | ConfigurationManager.RefreshSection("appSettings");
22 | }
23 |
24 | public static Color? LoadThemeColor()
25 | {
26 | var colorString = ConfigurationManager.AppSettings["ThemeColor"];
27 | if (string.IsNullOrEmpty(colorString))
28 | return null;
29 |
30 | try
31 | {
32 | return (Color)ColorConverter.ConvertFromString(colorString);
33 | }
34 | catch
35 | {
36 | return null;
37 | }
38 | }
39 |
40 | public static void SaveLanguage(string language)
41 | {
42 | var config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
43 |
44 | // Remove existing setting if it exists
45 | if (config.AppSettings.Settings["Language"] != null)
46 | {
47 | config.AppSettings.Settings.Remove("Language");
48 | }
49 |
50 | // Add the new setting
51 | config.AppSettings.Settings.Add("Language", language);
52 | config.Save(ConfigurationSaveMode.Modified);
53 | ConfigurationManager.RefreshSection("appSettings");
54 | }
55 |
56 | public static string LoadLanguage()
57 | {
58 | return ConfigurationManager.AppSettings["Language"] ?? "English";
59 | }
60 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Models/DebugInfoReport.cs:
--------------------------------------------------------------------------------
1 | using System.Globalization;
2 |
3 | namespace Forza_Mods_AIO.Models;
4 |
5 | public class DebugInfoReport(string info)
6 | {
7 | public string Info { get; } = info;
8 | public string ReportedAt { get; } = DateTime.Now.ToString(CultureInfo.InvariantCulture);
9 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Models/DebugSession.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.ObjectModel;
2 |
3 | namespace Forza_Mods_AIO.Models;
4 |
5 | public sealed class DebugSession
6 | {
7 | public DebugSession(string name, ObservableCollection debugInfoReports)
8 | {
9 | Name = name;
10 | DebugInfoReports = debugInfoReports;
11 | }
12 |
13 | public string Name { get; }
14 | public ObservableCollection DebugInfoReports { get; }
15 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Models/GameVerPlat.cs:
--------------------------------------------------------------------------------
1 | namespace Forza_Mods_AIO.Models;
2 |
3 | public class GameVerPlat(string name, string platform, string update,GameVerPlat.GameType type)
4 | {
5 | private static GameVerPlat _instance = null!;
6 | public static GameVerPlat GetInstance()
7 | {
8 | if (_instance != null!) return _instance;
9 | _instance = new GameVerPlat();
10 | return _instance;
11 | }
12 |
13 | public string Name { get; set; } = name;
14 | public string Platform { get; set; } = platform;
15 | public string Update { get; set; } = update;
16 | public GameType Type { get; set; } = type;
17 |
18 | private GameVerPlat() : this(string.Empty, string.Empty, string.Empty, GameType.None)
19 | {
20 | }
21 |
22 | public enum GameType : ushort
23 | {
24 | None = 0,
25 | Fh4,
26 | Fh5
27 | }
28 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Models/SearchResult.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Controls;
3 |
4 | namespace Forza_Mods_AIO.Models;
5 |
6 | public readonly struct SearchResult(
7 | string name,
8 | string category,
9 | string feature,
10 | string page,
11 | Type pageType,
12 | FrameworkElement frameworkElement = null!,
13 | Expander dropDownExpander = null!)
14 | {
15 | public string Name { get; } = name;
16 | public string Category { get; } = category;
17 | public string Feature { get; } = feature;
18 | public string Page { get; } = page;
19 | public Type PageType { get; } = pageType;
20 | public FrameworkElement FrameworkElement { get; } = frameworkElement;
21 | public Expander DropDownExpander { get; } = dropDownExpander;
22 |
23 | public bool Contains(string text)
24 | {
25 | var nameContains = Name.Contains(text, StringComparison.InvariantCultureIgnoreCase);
26 | var categoryContains = Category.Contains(text, StringComparison.InvariantCultureIgnoreCase);
27 | var featureContains = Feature.Contains(text, StringComparison.InvariantCultureIgnoreCase);
28 | var pageContains = Page.Contains(text, StringComparison.InvariantCultureIgnoreCase);
29 | return nameContains || categoryContains || featureContains || pageContains;
30 | }
31 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Resources/Cheats.cs:
--------------------------------------------------------------------------------
1 | namespace Forza_Mods_AIO.Resources;
2 |
3 | public static class Cheats
4 | {
5 | public static readonly Dictionary CachedInstances = [];
6 |
7 | public static T GetClass() where T : class
8 | {
9 | var classType = typeof(T);
10 | if (CachedInstances.TryGetValue(classType, out var cachedInstance))
11 | {
12 | return (T)cachedInstance;
13 | }
14 | var newInstance = Activator.CreateInstance(classType) as T;
15 | CachedInstances[classType] = newInstance!;
16 | return newInstance!;
17 | }
18 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Resources/DebugSessions.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.ObjectModel;
2 | using Forza_Mods_AIO.Cheats.ForzaHorizon5;
3 | using Forza_Mods_AIO.Models;
4 |
5 | namespace Forza_Mods_AIO.Resources;
6 |
7 | public class DebugSessions
8 | {
9 | private static DebugSessions _instance = null!;
10 | public static DebugSessions GetInstance()
11 | {
12 | if (_instance != null!) return _instance;
13 | _instance = new DebugSessions();
14 | return _instance;
15 | }
16 |
17 | public readonly ObservableCollection EveryDebugSession = [Cheats.GetClass().BypassDebug];
18 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Resources/External/Memory.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ForzaMods/Forza-Mods-AIO/447030847c136d0ef9fcc3c2d7ded2c0d13eb5bd/Forza-Mods-AIO/Forza-Mods-AIO/Resources/External/Memory.dll
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Resources/Imports.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.InteropServices;
2 |
3 | namespace Forza_Mods_AIO.Resources;
4 |
5 | public static partial class Imports
6 | {
7 | [LibraryImport("kernel32", SetLastError = true)]
8 | [return: MarshalAs(UnmanagedType.Bool)]
9 | public static partial bool CloseHandle(IntPtr handle);
10 |
11 | [LibraryImport("kernel32", SetLastError = true)]
12 | public static partial int WaitForSingleObject(IntPtr handle, int milliseconds);
13 |
14 | [LibraryImport("kernel32")]
15 | public static partial nint CreateRemoteThread(nint hProcess, nint lpThreadAttributes, uint dwStackSize, nuint lpStartAddress, nuint lpParameter, uint dwCreationFlags, out nint lpThreadId);
16 |
17 | [LibraryImport("kernel32.dll", EntryPoint = "GetModuleHandleW", StringMarshalling = StringMarshalling.Utf16)]
18 | public static partial nint GetModuleHandle(string lpModuleName);
19 |
20 | #pragma warning disable CA2101
21 | [DllImport("kernel32.dll")]
22 | #pragma warning restore CA2101
23 | #pragma warning disable CA1401
24 | #pragma warning disable SYSLIB1054
25 | public static extern nuint GetProcAddress(nint hModule, string procName);
26 | #pragma warning restore SYSLIB1054
27 | #pragma warning restore CA1401
28 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Resources/Keybinds/GlobalHotkey.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Input;
2 |
3 | namespace Forza_Mods_AIO.Resources.Keybinds;
4 |
5 | // https://github.com/AngryCarrot789/KeyDownTester/blob/master/KeyDownTester/Keys/GlobalHotkey.cs
6 | public class GlobalHotkey(ModifierKeys modifier, Key key, Action callbackMethod, int interval = 250, bool canExecute = false)
7 | {
8 | public ModifierKeys Modifier { get; set; } = modifier;
9 | public Key Key { get; set; } = key;
10 | public Action Callback { get; } = callbackMethod;
11 | public bool CanExecute { get; set; } = canExecute;
12 | public bool IsPressed { get; set; }
13 | public int Interval { get; set; } = interval;
14 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Resources/Keybinds/HotkeysManager.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics;
2 | using System.Runtime.InteropServices;
3 | using System.Windows;
4 | using System.Windows.Input;
5 |
6 | namespace Forza_Mods_AIO.Resources.Keybinds;
7 |
8 | // https://github.com/AngryCarrot789/KeyDownTester/blob/master/KeyDownTester/Keys/HotkeysManager.cs
9 | public static partial class HotkeysManager
10 | {
11 | private static List Hotkeys { get; }
12 | private static readonly LowLevelKeyboardProc LowLevelProc = HookCallback;
13 | private static IntPtr _hookId = IntPtr.Zero;
14 |
15 | static HotkeysManager()
16 | {
17 | Hotkeys = new List();
18 | }
19 |
20 | public static void SetupSystemHook()
21 | {
22 | _hookId = SetHook(LowLevelProc);
23 | if (_hookId > 0) return;
24 | MessageBox.Show("Couldn't setup the keybinding hook.","Information", MessageBoxButton.OK, MessageBoxImage.Error);
25 | }
26 |
27 | public static void ShutdownSystemHook()
28 | {
29 | if (_hookId <= 0) return;
30 | UnhookWindowsHookEx(_hookId);
31 | }
32 |
33 | public static void AddHotkey(GlobalHotkey hotkey)
34 | {
35 | Hotkeys.Add(hotkey);
36 | }
37 |
38 | public static void RemoveHotkey(GlobalHotkey hotkey)
39 | {
40 | Hotkeys.Remove(hotkey);
41 | }
42 |
43 | public static bool CheckIfTheSameHotkeyExists(Key key, ModifierKeys modifierKeys)
44 | {
45 | return Hotkeys.Any(globalHotkey => globalHotkey.Key == key && globalHotkey.Modifier == modifierKeys);
46 | }
47 |
48 | private static async void CheckHotkeys()
49 | {
50 | await Application.Current.Dispatcher.InvokeAsync(async () =>
51 | {
52 | foreach (var hotkey in Hotkeys
53 | .Where(hotkey => Keyboard.Modifiers == hotkey.Modifier && hotkey.Key != Key.None)
54 | .Where(hotkey => hotkey.CanExecute))
55 | {
56 | if (hotkey.IsPressed)
57 | {
58 | continue;
59 | }
60 |
61 | hotkey.IsPressed = true;
62 | while (Keyboard.IsKeyDown(hotkey.Key))
63 | {
64 | hotkey.Callback();
65 | await Task.Delay(hotkey.Interval);
66 | }
67 | hotkey.IsPressed = false;
68 | }
69 | });
70 | }
71 |
72 | private static IntPtr SetHook(LowLevelKeyboardProc proc)
73 | {
74 | using var curProcess = Process.GetCurrentProcess();
75 | using var curModule = curProcess.MainModule;
76 | return curModule == null ? 0 : SetWindowsHookEx(13, proc, Imports.GetModuleHandle(curModule.ModuleName), 0);
77 | }
78 |
79 | private static IntPtr HookCallback(int nCode, IntPtr wParam, IntPtr lParam)
80 | {
81 | if (nCode >= 0)
82 | {
83 | Task.Run(CheckHotkeys);
84 | }
85 | return CallNextHookEx(_hookId, nCode, wParam, lParam);
86 | }
87 |
88 | private delegate IntPtr LowLevelKeyboardProc(int nCode, IntPtr wParam, IntPtr lParam);
89 |
90 | #region Native Methods
91 |
92 | [LibraryImport("user32.dll", EntryPoint = "SetWindowsHookExA", SetLastError = true)]
93 | private static partial IntPtr SetWindowsHookEx(int idHook, LowLevelKeyboardProc lpfn, IntPtr hMod, uint dwThreadId);
94 |
95 | [LibraryImport("user32.dll", SetLastError = true)]
96 | [return: MarshalAs(UnmanagedType.Bool)]
97 | private static partial void UnhookWindowsHookEx(IntPtr hhk);
98 |
99 | [LibraryImport("user32.dll", SetLastError = true)]
100 | private static partial IntPtr CallNextHookEx(IntPtr hhk, int nCode, IntPtr wParam, IntPtr lParam);
101 |
102 | #endregion
103 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Resources/Memory.cs:
--------------------------------------------------------------------------------
1 | using Memory;
2 |
3 | namespace Forza_Mods_AIO.Resources;
4 |
5 | public static class Memory
6 | {
7 | private static Mem _instance = null!;
8 | public static Mem GetInstance()
9 | {
10 | if (_instance != null!) return _instance;
11 | _instance = new Mem();
12 | return _instance;
13 | }
14 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Resources/Pages.cs:
--------------------------------------------------------------------------------
1 | using Forza_Mods_AIO.Views.Pages;
2 |
3 | namespace Forza_Mods_AIO.Resources;
4 |
5 | public abstract class Pages
6 | {
7 | private static readonly Dictionary CachedInstances = new();
8 |
9 | public static void Clear()
10 | {
11 | foreach (var cachedInstance in CachedInstances.Where(c => c.Key != typeof(AioInfo)))
12 | {
13 | CachedInstances.Remove(cachedInstance.Key);
14 | }
15 | }
16 |
17 | public static object GetPage(Type pageType)
18 | {
19 | if (CachedInstances.TryGetValue(pageType, out var cachedInstance))
20 | {
21 | return cachedInstance;
22 | }
23 |
24 | var newInstance = Activator.CreateInstance(pageType);
25 | CachedInstances[pageType] = newInstance!;
26 | return newInstance!;
27 | }
28 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Resources/Search/SearchResults.cs:
--------------------------------------------------------------------------------
1 | using Forza_Mods_AIO.Models;
2 | using Forza_Mods_AIO.Views.Pages;
3 |
4 | namespace Forza_Mods_AIO.Resources.Search;
5 |
6 | public static class SearchResults
7 | {
8 | public static readonly List EverySearchResult =
9 | [
10 | new SearchResult("Aio Info", string.Empty, string.Empty, string.Empty, typeof(AioInfo)),
11 | new SearchResult("Autoshow/Garage", string.Empty, string.Empty, string.Empty, typeof(Autoshow)),
12 | new SearchResult("Self/Vehicle", string.Empty, string.Empty, string.Empty, typeof(SelfVehicle)),
13 | new SearchResult("Tuning", string.Empty, string.Empty, string.Empty, typeof(Tuning)),
14 | ];
15 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Resources/Square150x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ForzaMods/Forza-Mods-AIO/447030847c136d0ef9fcc3c2d7ded2c0d13eb5bd/Forza-Mods-AIO/Forza-Mods-AIO/Resources/Square150x150Logo.scale-200.png
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Resources/Theme/CommonBorderStyle.xaml:
--------------------------------------------------------------------------------
1 |
3 |
12 |
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Resources/Theme/ThemeConstants.xaml:
--------------------------------------------------------------------------------
1 |
4 | 2
5 | BottomRight
6 | 3
7 | 2
8 |
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Resources/Theme/Theming.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 | using System.Runtime.CompilerServices;
3 | using System.Windows;
4 | using System.Windows.Media;
5 | using ControlzEx.Theming;
6 | using static System.Windows.Media.ColorConverter;
7 | using Forza_Mods_AIO.Helpers;
8 |
9 | namespace Forza_Mods_AIO.Resources.Theme;
10 |
11 | public sealed class Theming : INotifyPropertyChanged
12 | {
13 | private static readonly Color DefaultThemeColor = (Color)ConvertFromString("#4C566A");
14 |
15 | private static Theming _instance = null!;
16 | public static Theming GetInstance()
17 | {
18 | if (_instance != null!) return _instance;
19 | _instance = new Theming();
20 | return _instance;
21 | }
22 |
23 | private Brush _mainColour = new SolidColorBrush((Color)ConvertFromString("#4C566A"));
24 | public Brush MainColour
25 | {
26 | get => _mainColour;
27 | private set => SetField(ref _mainColour, value);
28 | }
29 |
30 | private Brush _darkishColour = new SolidColorBrush((Color)ConvertFromString("#434C5E"));
31 | public Brush DarkishColour
32 | {
33 | get => _darkishColour;
34 | private set => SetField(ref _darkishColour, value);
35 | }
36 |
37 | private Brush _darkColour = new SolidColorBrush((Color)ConvertFromString("#3B4252"));
38 | public Brush DarkColour
39 | {
40 | get => _darkColour;
41 | private set => SetField(ref _darkColour, value);
42 | }
43 |
44 | private Brush _darkerColour = new SolidColorBrush((Color)ConvertFromString("#2E3440"));
45 | public Brush DarkerColour
46 | {
47 | get => _darkerColour;
48 | private set => SetField(ref _darkerColour, value);
49 | }
50 |
51 | public Color MainColourAsColour { get; private set; } = (Color)ConvertFromString("#2E3440");
52 |
53 | public void ChangeColor(Color color = default)
54 | {
55 | if (color == default)
56 | return;
57 |
58 | // Store the main color
59 | MainColourAsColour = color;
60 |
61 | // Save the color to settings
62 | Settings.SaveThemeColor(color);
63 |
64 | // Create a darker shade for each level
65 | var darkish = Color.FromRgb(
66 | (byte)(color.R * 0.9),
67 | (byte)(color.G * 0.9),
68 | (byte)(color.B * 0.9));
69 |
70 | var dark = Color.FromRgb(
71 | (byte)(color.R * 0.8),
72 | (byte)(color.G * 0.8),
73 | (byte)(color.B * 0.8));
74 |
75 | var darker = Color.FromRgb(
76 | (byte)(color.R * 0.7),
77 | (byte)(color.G * 0.7),
78 | (byte)(color.B * 0.7));
79 |
80 | // Update the brushes
81 | MainColour = new SolidColorBrush(color);
82 | DarkishColour = new SolidColorBrush(darkish);
83 | DarkColour = new SolidColorBrush(dark);
84 | DarkerColour = new SolidColorBrush(darker);
85 |
86 | // Create and apply the theme
87 | var themeName = $"CustomTheme_{color.ToString()}";
88 | ThemeManager.Current.AddTheme(new ControlzEx.Theming.Theme(themeName,
89 | themeName,
90 | "Dark",
91 | "Red",
92 | color,
93 | new SolidColorBrush(color),
94 | false,
95 | false));
96 | ThemeManager.Current.ChangeTheme(Application.Current, themeName);
97 | }
98 |
99 | // Add a method to initialize the theme
100 | public void InitializeTheme()
101 | {
102 | var savedColor = Settings.LoadThemeColor();
103 | if (savedColor.HasValue)
104 | {
105 | ChangeColor(savedColor.Value);
106 | }
107 | }
108 |
109 | public void ResetTheme()
110 | {
111 | ChangeColor(DefaultThemeColor);
112 | }
113 |
114 | public event PropertyChangedEventHandler? PropertyChanged;
115 | private void OnPropertyChanged([CallerMemberName] string? propertyName = null)
116 | {
117 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
118 | }
119 |
120 | private void SetField(ref T field, T value, [CallerMemberName] string? propertyName = null)
121 | {
122 | if (EqualityComparer.Default.Equals(field, value)) return;
123 | field = value;
124 | OnPropertyChanged(propertyName);
125 | }
126 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Services/ApplicationHostService.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Media;
3 | using ControlzEx.Theming;
4 | using Forza_Mods_AIO.Resources.Theme;
5 | using Forza_Mods_AIO.Views.Windows;
6 | using MahApps.Metro.Controls;
7 | using Microsoft.Extensions.Hosting;
8 |
9 | namespace Forza_Mods_AIO.Services;
10 |
11 | public class ApplicationHostService(IServiceProvider serviceProvider) : IHostedService
12 | {
13 | private MetroWindow? _navigationWindow;
14 |
15 | public async Task StartAsync(CancellationToken cancellationToken)
16 | {
17 | await HandleActivationAsync();
18 | }
19 |
20 | public async Task StopAsync(CancellationToken cancellationToken)
21 | {
22 | await Task.CompletedTask;
23 | }
24 |
25 | private async Task HandleActivationAsync()
26 | {
27 | await Task.CompletedTask;
28 |
29 | if (!Application.Current.Windows.OfType().Any())
30 | {
31 | InitTheme();
32 | _navigationWindow = (serviceProvider.GetService(typeof(MetroWindow)) as MetroWindow)!;
33 | _navigationWindow.Show();
34 | }
35 |
36 | await Task.CompletedTask;
37 | }
38 |
39 | private static void InitTheme()
40 | {
41 | var converted = (Color)ColorConverter.ConvertFromString(Theming.GetInstance().DarkerColour.ToString());
42 | const string name = "AccentCol";
43 | ThemeManager.Current.ClearThemes();
44 | ThemeManager.Current.AddTheme(new Theme(name, name, "Dark", "Red", converted, new SolidColorBrush(converted), true, false));
45 | ThemeManager.Current.ChangeTheme(Application.Current, name);
46 | }
47 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Services/WindowsProviderService.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | namespace Forza_Mods_AIO.Services;
4 |
5 | public static class WindowsProviderService
6 | {
7 | public static void Show() where T : class
8 | {
9 | if (!typeof(Window).IsAssignableFrom(typeof(T)))
10 | {
11 | throw new InvalidOperationException($"The window class should be derived from {typeof(Window)}.");
12 | }
13 |
14 | if (App.GetRequiredService() is not Window windowInstance)
15 | {
16 | throw new InvalidOperationException("Window is not registered as service.");
17 | }
18 |
19 | windowInstance.Owner = Application.Current.MainWindow;
20 | windowInstance.Show();
21 | }
22 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/ViewModels/Pages/AboutViewModel.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics;
2 | using System.Reflection;
3 | using CommunityToolkit.Mvvm.ComponentModel;
4 | using CommunityToolkit.Mvvm.Input;
5 |
6 | namespace Forza_Mods_AIO.ViewModels.Pages;
7 |
8 | public partial class AboutViewModel : ObservableObject
9 | {
10 | [ObservableProperty]
11 | private string _version = $"Version: {Assembly.GetExecutingAssembly().GetName().Version!.ToString()}";
12 |
13 | [RelayCommand]
14 | private static void LaunchUrl(string param) => Process.Start("explorer.exe",$"\"{param}\"");
15 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/ViewModels/Pages/AioInfoViewModel.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics;
2 | using CommunityToolkit.Mvvm.ComponentModel;
3 | using CommunityToolkit.Mvvm.Input;
4 | using Forza_Mods_AIO.Resources.Theme;
5 | using Forza_Mods_AIO.Services;
6 | using Forza_Mods_AIO.Views.Windows;
7 |
8 | namespace Forza_Mods_AIO.ViewModels.Pages;
9 |
10 | public partial class AioInfoViewModel : ObservableObject
11 | {
12 | [RelayCommand]
13 | private static void LaunchUrl(string param) => Process.Start("explorer.exe",$"\"{param}\"");
14 |
15 | [RelayCommand]
16 | private static void ChangeMonet() => Theming.GetInstance().ChangeColor();
17 |
18 | [RelayCommand]
19 | private static void ShowDebugWindow() => WindowsProviderService.Show();
20 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/ViewModels/Pages/AutoshowViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 | using CommunityToolkit.Mvvm.Input;
3 | using Forza_Mods_AIO.Models;
4 | using static Forza_Mods_AIO.Resources.Cheats;
5 |
6 | namespace Forza_Mods_AIO.ViewModels.Pages;
7 |
8 | public partial class AutoshowViewModel : ObservableObject
9 | {
10 | [ObservableProperty]
11 | private bool _uiElementsEnabled = true;
12 |
13 | private static Cheats.ForzaHorizon5.Sql SqlFh5 => GetClass();
14 | private static Cheats.ForzaHorizon4.Sql SqlFh4 => GetClass();
15 |
16 | [RelayCommand]
17 | private async Task ExecuteSql(object parameter)
18 | {
19 | if (parameter is not string sParam)
20 | {
21 | return;
22 | }
23 |
24 | UiElementsEnabled = false;
25 | await Query(sParam);
26 | UiElementsEnabled = true;
27 | }
28 |
29 | private static async Task Query(string command)
30 | {
31 | switch (GameVerPlat.GetInstance().Type)
32 | {
33 | case GameVerPlat.GameType.Fh4:
34 | {
35 | if (!SqlFh4.WereScansSuccessful)
36 | {
37 | await SqlFh4.SqlExecAobScan();
38 | }
39 |
40 | if (!SqlFh4.WereScansSuccessful)
41 | {
42 | goto SkipQuerying;
43 | }
44 |
45 | await Task.Run(() => SqlFh4.Query(command));
46 | SkipQuerying:
47 | break;
48 | }
49 | case GameVerPlat.GameType.Fh5:
50 | {
51 | if (!SqlFh5.WereScansSuccessful)
52 | {
53 | await SqlFh5.SqlExecAobScan();
54 | }
55 |
56 | if (!SqlFh5.WereScansSuccessful)
57 | {
58 | goto SkipQuerying;
59 | }
60 |
61 | await Task.Run(() => SqlFh5.Query(command));
62 | SkipQuerying:
63 | break;
64 | }
65 | case GameVerPlat.GameType.None:
66 | default:
67 | {
68 | throw new IndexOutOfRangeException();
69 | }
70 | }
71 | }
72 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/ViewModels/Pages/SearchViewModel.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.ObjectModel;
2 | using CommunityToolkit.Mvvm.ComponentModel;
3 | using Forza_Mods_AIO.Models;
4 | using Forza_Mods_AIO.Views.Pages;
5 |
6 | namespace Forza_Mods_AIO.ViewModels.Pages;
7 |
8 | public partial class SearchViewModel : ObservableObject
9 | {
10 | [ObservableProperty]
11 | private ObservableCollection _searchResults = [];
12 |
13 | public void Search(string text)
14 | {
15 | SearchResults.Clear();
16 | if (text == string.Empty)
17 | {
18 | return;
19 | }
20 |
21 | var search = Resources.Search.SearchResults.EverySearchResult.Where(i => i.Contains(text));
22 | var searchResults = search as SearchResult[] ?? search.ToArray();
23 |
24 | foreach (var element in searchResults)
25 | {
26 | if (GameVerPlat.GetInstance().Type == GameVerPlat.GameType.None && element.PageType != typeof(AioInfo))
27 | {
28 | continue;
29 | }
30 |
31 | SearchResults.Add(element);
32 | }
33 | }
34 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/ViewModels/Pages/SettingsViewModel.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Media;
2 | using CommunityToolkit.Mvvm.ComponentModel;
3 | using CommunityToolkit.Mvvm.Input;
4 | using Forza_Mods_AIO.Resources.Theme;
5 |
6 | namespace Forza_Mods_AIO.ViewModels.Pages;
7 |
8 | public partial class SettingsViewModel : ObservableObject
9 | {
10 | private readonly Theming _theming;
11 |
12 | public SettingsViewModel()
13 | {
14 | _theming = Theming.GetInstance();
15 | _themeColor = _theming.MainColourAsColour;
16 | }
17 |
18 | [ObservableProperty]
19 | private Color _themeColor;
20 |
21 | [RelayCommand]
22 | private void ChangeTheme()
23 | {
24 | _theming.ChangeColor(ThemeColor);
25 | }
26 |
27 | [RelayCommand]
28 | private void MonetTheme()
29 | {
30 | ThemeColor = (Color)ColorConverter.ConvertFromString("#0078D4");
31 | _theming.ChangeColor(ThemeColor);
32 | }
33 |
34 | [RelayCommand]
35 | private void ResetTheme()
36 | {
37 | _theming.ResetTheme();
38 | }
39 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/ViewModels/Pages/TuningViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 | using CommunityToolkit.Mvvm.Input;
3 | using Forza_Mods_AIO.Cheats.ForzaHorizon5;
4 |
5 | namespace Forza_Mods_AIO.ViewModels.Pages;
6 |
7 | public partial class TuningViewModel : ObservableObject
8 | {
9 | [ObservableProperty]
10 | private bool _areUiElementsEnabled;
11 |
12 | [ObservableProperty]
13 | private bool _areScanPromptUiElementsEnabled = true;
14 |
15 | [ObservableProperty]
16 | private bool _areScanningUiElementsVisible;
17 |
18 | private static TuningCheats TuningCheatsFh5 => Resources.Cheats.GetClass();
19 |
20 | [RelayCommand]
21 | private async Task Scan()
22 | {
23 | AreScanPromptUiElementsEnabled = false;
24 | AreScanningUiElementsVisible = true;
25 |
26 | if (!TuningCheatsFh5.WasScanSuccessful)
27 | {
28 | await TuningCheatsFh5.Scan();
29 | }
30 |
31 | if (!TuningCheatsFh5.WasScanSuccessful)
32 | {
33 | AreScanPromptUiElementsEnabled = true;
34 | AreScanningUiElementsVisible = false;
35 | return;
36 | }
37 |
38 | AreScanningUiElementsVisible = false;
39 | AreUiElementsEnabled = true;
40 | }
41 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/ViewModels/SubPages/SelfVehicle/CameraViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 | using Forza_Mods_AIO.Models;
3 |
4 | namespace Forza_Mods_AIO.ViewModels.SubPages.SelfVehicle;
5 |
6 | public partial class CameraViewModel : ObservableObject
7 | {
8 | public bool IsFh5 => GameVerPlat.GetInstance().Type == GameVerPlat.GameType.Fh5;
9 |
10 | [ObservableProperty]
11 | private bool _areScanPromptLimiterUiElementsVisible = true;
12 |
13 | [ObservableProperty]
14 | private bool _areScanningLimiterUiElementsVisible;
15 |
16 | [ObservableProperty]
17 | private bool _areLimiterUiElementsVisible;
18 |
19 | [ObservableProperty]
20 | private bool _areCameraHookUiElementsEnabled = true;
21 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/ViewModels/SubPages/SelfVehicle/CustomizationViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 | using Forza_Mods_AIO.Models;
3 |
4 | namespace Forza_Mods_AIO.ViewModels.SubPages.SelfVehicle;
5 |
6 | public partial class CustomizationViewModel : ObservableObject
7 | {
8 | public bool IsFh5 => GameVerPlat.GetInstance().Type == GameVerPlat.GameType.Fh5;
9 |
10 | [ObservableProperty]
11 | private bool _areMainUiElementsEnabled = true;
12 |
13 | [ObservableProperty]
14 | private bool _areHeadlightUiElementsEnabled = true;
15 |
16 | [ObservableProperty]
17 | private bool _areBackfireUiElementsEnabled = true;
18 |
19 | [ObservableProperty]
20 | private bool _dirtEnabled;
21 |
22 | [ObservableProperty]
23 | private float _dirtValue;
24 |
25 | [ObservableProperty]
26 | private bool _mudEnabled;
27 |
28 | [ObservableProperty]
29 | private float _mudValue;
30 |
31 | [ObservableProperty]
32 | private bool _glowingPaintEnabled;
33 |
34 | [ObservableProperty]
35 | private float _glowingPaintValue;
36 |
37 | [ObservableProperty]
38 | private bool _forceLodEnabled;
39 |
40 | [ObservableProperty]
41 | private int _forceLodValue;
42 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/ViewModels/SubPages/SelfVehicle/EnvironmentViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 |
3 | namespace Forza_Mods_AIO.ViewModels.SubPages.SelfVehicle;
4 |
5 | public partial class EnvironmentViewModel : ObservableObject
6 | {
7 | [ObservableProperty]
8 | private bool _areSunRgbUiElementsEnabled = true;
9 |
10 | [ObservableProperty]
11 | private bool _areManualTimeUiElementsEnabled = true;
12 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/ViewModels/SubPages/SelfVehicle/HandlingViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 | using Forza_Mods_AIO.Models;
3 |
4 | namespace Forza_Mods_AIO.ViewModels.SubPages.SelfVehicle;
5 |
6 | public partial class HandlingViewModel : ObservableObject
7 | {
8 | [ObservableProperty]
9 | private bool _areUiElementsEnabled = true;
10 |
11 | [ObservableProperty]
12 | private double _accelValue;
13 |
14 | [ObservableProperty]
15 | private double _gravityValue;
16 |
17 | [ObservableProperty]
18 | private bool _isAccelEnabled;
19 |
20 | [ObservableProperty]
21 | private bool _isGravityEnabled;
22 |
23 | public bool IsFh4 => GameVerPlat.GetInstance().Type == GameVerPlat.GameType.Fh4;
24 | public bool IsHorizon => GameVerPlat.GetInstance().Type is GameVerPlat.GameType.Fh4 or GameVerPlat.GameType.Fh5;
25 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/ViewModels/SubPages/SelfVehicle/MiscViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 | using Forza_Mods_AIO.Models;
3 |
4 | namespace Forza_Mods_AIO.ViewModels.SubPages.SelfVehicle;
5 |
6 | public partial class MiscViewModel : ObservableObject
7 | {
8 | public bool IsFh5 => GameVerPlat.GetInstance().Type == GameVerPlat.GameType.Fh5;
9 |
10 | [ObservableProperty]
11 | private bool _spooferUiElementsEnabled = true;
12 |
13 | [ObservableProperty]
14 | private bool _mainUiElementsEnabled = true;
15 |
16 | [ObservableProperty]
17 | private bool _spinPrizeScaleEnabled;
18 |
19 | [ObservableProperty]
20 | private bool _spinSellFactorEnabled;
21 |
22 | [ObservableProperty]
23 | private bool _skillScoreMultiplierEnabled;
24 |
25 | [ObservableProperty]
26 | private bool _driftScoreMultiplierEnabled;
27 |
28 | [ObservableProperty]
29 | private bool _skillTreeWideEditEnabled;
30 |
31 | [ObservableProperty]
32 | private bool _skillTreeCostEnabled;
33 |
34 | [ObservableProperty]
35 | private bool _missionTimeScaleEnabled;
36 |
37 | [ObservableProperty]
38 | private bool _trailblazerTimeScaleEnabled;
39 |
40 | [ObservableProperty]
41 | private bool _speedZoneMultiplierEnabled;
42 |
43 | [ObservableProperty]
44 | private float _spinPrizeScaleValue;
45 |
46 | [ObservableProperty]
47 | private bool _raceTimeScaleEnabled;
48 |
49 | [ObservableProperty]
50 | private bool _dangerSignMultiplierEnabled;
51 |
52 | [ObservableProperty]
53 | private bool _speedTrapMultiplierEnabled;
54 |
55 | [ObservableProperty]
56 | private bool _droneModeHeightEnabled;
57 |
58 | [ObservableProperty]
59 | private int _spinSellFactorValue = 999;
60 |
61 | [ObservableProperty]
62 | private int _skillScoreMultiplierValue = 10;
63 |
64 | [ObservableProperty]
65 | private float _driftScoreMultiplierValue = 5;
66 |
67 | [ObservableProperty]
68 | private float _skillTreeWideEditValue = 10000;
69 |
70 | [ObservableProperty]
71 | private int _skillTreeCostValue;
72 |
73 | [ObservableProperty]
74 | private float _missionTimeScaleValue = 0.5f;
75 |
76 | [ObservableProperty]
77 | private float _trailblazerTimeScaleValue = 0.5f;
78 |
79 | [ObservableProperty]
80 | private float _speedZoneMultiplierValue = 5;
81 |
82 | [ObservableProperty]
83 | private float _raceTimeScaleValue = 0.5f;
84 |
85 | [ObservableProperty]
86 | private float _dangerSignMultiplierValue = 5f;
87 |
88 | [ObservableProperty]
89 | private float _speedTrapMultiplierValue = 5f;
90 |
91 | [ObservableProperty]
92 | private float _droneModeHeightValue = 5f;
93 | }
94 |
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/ViewModels/SubPages/SelfVehicle/PhotoModeViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 |
3 | namespace Forza_Mods_AIO.ViewModels.SubPages.SelfVehicle;
4 |
5 | public partial class PhotoModeViewModel : ObservableObject
6 | {
7 | [ObservableProperty]
8 | private bool _areScanPromptLimiterUiElementsVisible = true;
9 |
10 | [ObservableProperty]
11 | private bool _areScanningLimiterUiElementsVisible;
12 |
13 | [ObservableProperty]
14 | private bool _areModifierUiElementsVisible;
15 |
16 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/ViewModels/SubPages/SelfVehicle/UnlocksViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 | using Forza_Mods_AIO.Models;
3 |
4 | namespace Forza_Mods_AIO.ViewModels.SubPages.SelfVehicle;
5 |
6 | public partial class UnlocksViewModel : ObservableObject
7 | {
8 | [ObservableProperty]
9 | private bool _areUiElementsEnabled = true;
10 |
11 | [ObservableProperty]
12 | private bool _wasComboBoxLoaded;
13 |
14 | [ObservableProperty]
15 | private bool _isXpEnabled;
16 |
17 | [ObservableProperty]
18 | private bool _isCreditsEnabled;
19 |
20 | [ObservableProperty]
21 | private bool _isSkillPointsEnabled;
22 |
23 | [ObservableProperty]
24 | private bool _isWheelspinsEnabled;
25 |
26 | [ObservableProperty]
27 | private bool _isAccoladesEnabled;
28 |
29 | [ObservableProperty]
30 | private bool _isKudosEnabled;
31 |
32 | [ObservableProperty]
33 | private bool _isForzathonEnabled;
34 |
35 | [ObservableProperty]
36 | private bool _isSeriesEnabled;
37 |
38 | [ObservableProperty]
39 | private bool _isSeasonalEnabled;
40 |
41 | [ObservableProperty]
42 | private int _xpValue;
43 |
44 | [ObservableProperty]
45 | private int _creditsValue;
46 |
47 | [ObservableProperty]
48 | private int _skillPointsValue;
49 |
50 | [ObservableProperty]
51 | private int _wheelspinsValue;
52 |
53 | [ObservableProperty]
54 | private int _accoladesValue;
55 |
56 | [ObservableProperty]
57 | private int _kudosValue;
58 |
59 | [ObservableProperty]
60 | private int _forzathonValue;
61 |
62 | [ObservableProperty]
63 | private int _seriesValue;
64 |
65 | [ObservableProperty]
66 | private int _seasonalValue;
67 |
68 | public bool IsFh5 => GameVerPlat.GetInstance().Type == GameVerPlat.GameType.Fh5;
69 |
70 | public bool IsHorizon => GameVerPlat.GetInstance().Type is GameVerPlat.GameType.Fh4 or GameVerPlat.GameType.Fh5;
71 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/ViewModels/Windows/DebugWindowViewModel.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.ObjectModel;
2 | using CommunityToolkit.Mvvm.ComponentModel;
3 | using CommunityToolkit.Mvvm.Input;
4 | using Forza_Mods_AIO.Cheats.ForzaHorizon4;
5 | using Forza_Mods_AIO.Models;
6 | using MahApps.Metro.Controls;
7 | using static Forza_Mods_AIO.Resources.Cheats;
8 |
9 | namespace Forza_Mods_AIO.ViewModels.Windows;
10 |
11 | public partial class DebugWindowViewModel : ObservableObject
12 | {
13 | private bool _isInitialized;
14 |
15 | public ObservableCollection DebugSessions => Resources.DebugSessions.GetInstance().EveryDebugSession;
16 |
17 | [ObservableProperty]
18 | private DebugSession _currentDebugSession = null!;
19 |
20 | [ObservableProperty]
21 | private bool _areAnyBreakpointsAvailable;
22 |
23 | [ObservableProperty]
24 | private string _windowTitle = string.Empty;
25 |
26 | public bool IsFh4 => GameVerPlat.GetInstance().Type == GameVerPlat.GameType.Fh4;
27 | public bool IsFh5 => GameVerPlat.GetInstance().Type == GameVerPlat.GameType.Fh5;
28 |
29 | [RelayCommand]
30 | private static void DisableCrt()
31 | {
32 | GetClass().DisableCreateRemoteThreadChecks();
33 | }
34 |
35 | [RelayCommand]
36 | private static async Task DisableCrc()
37 | {
38 | await GetClass().DisableCrcChecks();
39 | }
40 |
41 | [RelayCommand]
42 | private static async Task DisableEncryption()
43 | {
44 | await GetClass().CheatDisableValueEncryption();
45 | }
46 |
47 | public DebugWindowViewModel()
48 | {
49 | if (_isInitialized) return;
50 | InitializeViewModel();
51 | }
52 |
53 | private void InitializeViewModel()
54 | {
55 | WindowTitle = $"{App.GetRequiredService().Title} - Debug Window";
56 | _isInitialized = true;
57 | }
58 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Views/Pages/About.xaml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
17 |
18 |
19 |
20 |
21 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Views/Pages/About.xaml.cs:
--------------------------------------------------------------------------------
1 | using Forza_Mods_AIO.ViewModels.Pages;
2 |
3 | namespace Forza_Mods_AIO.Views.Pages;
4 |
5 | public partial class About
6 | {
7 | public About()
8 | {
9 | ViewModel = new AboutViewModel();
10 | DataContext = this;
11 |
12 | InitializeComponent();
13 | }
14 |
15 | public AboutViewModel ViewModel { get; }
16 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Views/Pages/AioInfo.xaml.cs:
--------------------------------------------------------------------------------
1 | using Forza_Mods_AIO.Resources.Theme;
2 | using Forza_Mods_AIO.ViewModels.Pages;
3 |
4 | namespace Forza_Mods_AIO.Views.Pages;
5 |
6 | public partial class AioInfo
7 | {
8 | public AioInfo()
9 | {
10 | ViewModel = new AioInfoViewModel();
11 | DataContext = this;
12 |
13 | InitializeComponent();
14 | }
15 |
16 | public AioInfoViewModel ViewModel { get; }
17 | public Theming Theming => Theming.GetInstance();
18 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Views/Pages/Autoshow.xaml.cs:
--------------------------------------------------------------------------------
1 | using Forza_Mods_AIO.Resources.Theme;
2 | using Forza_Mods_AIO.ViewModels.Pages;
3 |
4 | namespace Forza_Mods_AIO.Views.Pages;
5 |
6 | public partial class Autoshow
7 | {
8 | public Autoshow()
9 | {
10 | ViewModel = new AutoshowViewModel();
11 | DataContext = this;
12 |
13 | InitializeComponent();
14 | }
15 |
16 | public AutoshowViewModel ViewModel { get; }
17 | public Theming Theming => Theming.GetInstance();
18 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Views/Pages/Search.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Controls;
2 | using System.Windows.Input;
3 | using Forza_Mods_AIO.Models;
4 | using Forza_Mods_AIO.Resources.Theme;
5 | using Forza_Mods_AIO.ViewModels.Pages;
6 | using Forza_Mods_AIO.ViewModels.Windows;
7 |
8 | namespace Forza_Mods_AIO.Views.Pages;
9 |
10 | public partial class Search
11 | {
12 | public Search()
13 | {
14 | ViewModel = new SearchViewModel();
15 | DataContext = this;
16 |
17 | InitializeComponent();
18 | }
19 |
20 | public Theming Theming => Theming.GetInstance();
21 | public SearchViewModel ViewModel { get; }
22 | private MainWindowViewModel MainWindowViewModel => App.GetRequiredService();
23 |
24 | private void SearchBox_OnTextChanged(object sender, TextChangedEventArgs e)
25 | {
26 | ViewModel.Search(((TextBox)sender).Text);
27 | }
28 |
29 | private void ListViewItem_OnDoubleClick(object sender, MouseButtonEventArgs e)
30 | {
31 | if (sender is not ListViewItem { Content: SearchResult searchResult }) return;
32 |
33 | GoToAndFocusElement(searchResult);
34 | }
35 |
36 | private void ListViewItem_OnKeyDown(object sender, KeyEventArgs e)
37 | {
38 | if (e.Key is not Key.Enter) return;
39 |
40 | if (sender is not ListViewItem { Content: SearchResult searchResult }) return;
41 |
42 | GoToAndFocusElement(searchResult);
43 | }
44 |
45 | private void GoToAndFocusElement(SearchResult searchResult)
46 | {
47 | NavigateTo(searchResult.PageType);
48 | if (searchResult.DropDownExpander != null!)
49 | {
50 | searchResult.DropDownExpander.IsExpanded = true;
51 | searchResult.DropDownExpander.Focus();
52 | }
53 |
54 | if (searchResult.FrameworkElement != null! && !searchResult.FrameworkElement.Focus())
55 | {
56 | searchResult.FrameworkElement.Focus();
57 | }
58 |
59 | MainWindowViewModel.CloseSearchCommand.Execute(null);
60 | return;
61 |
62 | void NavigateTo(Type pageType)
63 | {
64 | var page = Forza_Mods_AIO.Resources.Pages.GetPage(pageType);
65 | MainWindowViewModel.CurrentView = page;
66 | }
67 | }
68 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Views/Pages/SelfVehicle.xaml.cs:
--------------------------------------------------------------------------------
1 | using Forza_Mods_AIO.Models;
2 | using Forza_Mods_AIO.Resources.Search;
3 | using Forza_Mods_AIO.Resources.Theme;
4 |
5 | namespace Forza_Mods_AIO.Views.Pages;
6 |
7 | public sealed partial class SelfVehicle
8 | {
9 | public SelfVehicle()
10 | {
11 | DataContext = this;
12 |
13 | Loaded += (_, _) => AddSearchResults();
14 |
15 | InitializeComponent();
16 | }
17 |
18 | public Theming Theming => Theming.GetInstance();
19 |
20 | private void AddSearchResults()
21 | {
22 | SearchResults.EverySearchResult.Add(new SearchResult("Handling", string.Empty, string.Empty, "Self/Vehicle",
23 | typeof(SelfVehicle), null!, HandlingExpander));
24 | SearchResults.EverySearchResult.Add(new SearchResult("Unlocks", string.Empty, string.Empty, "Self/Vehicle",
25 | typeof(SelfVehicle), null!, UnlocksExpander));
26 | SearchResults.EverySearchResult.Add(new SearchResult("Photo Mode", string.Empty, string.Empty, "Self/Vehicle",
27 | typeof(SelfVehicle), null!, PhotoModeExpander));
28 | SearchResults.EverySearchResult.Add(new SearchResult("Environment", string.Empty, string.Empty, "Self/Vehicle",
29 | typeof(SelfVehicle), null!, EnvironmentExpander));
30 | SearchResults.EverySearchResult.Add(new SearchResult("Customization", string.Empty, string.Empty,
31 | "Self/Vehicle", typeof(SelfVehicle), null!, CustomizationExpander));
32 | SearchResults.EverySearchResult.Add(new SearchResult("Miscellaneous", string.Empty, string.Empty,
33 | "Self/Vehicle", typeof(SelfVehicle), null!, MiscExpander));
34 | SearchResults.EverySearchResult.Add(new SearchResult("Camera", string.Empty, string.Empty, "Self/Vehicle",
35 | typeof(SelfVehicle), null!, CameraExpander));
36 | }
37 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Views/Pages/Settings.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Controls;
3 | using Forza_Mods_AIO.Resources.Theme;
4 | using Forza_Mods_AIO.ViewModels.Pages;
5 | using Forza_Mods_AIO.Controls.TranslationComboboxItem;
6 | using Forza_Mods_AIO.Helpers;
7 |
8 |
9 | namespace Forza_Mods_AIO.Views.Pages;
10 |
11 | public partial class Settings
12 | {
13 | private bool _isInitializing = true;
14 |
15 | public Settings()
16 | {
17 | ViewModel = new SettingsViewModel();
18 | DataContext = this;
19 |
20 | InitializeComponent();
21 |
22 | // Debug: Print out all items and their enabled states
23 | foreach (TranslationComboboxItem item in LanguageBox.Items)
24 | {
25 | System.Diagnostics.Debug.WriteLine($"Language: {item.Content}, IsEnabled: {item.IsEnabled}, LanguageCode: {item.LanguageCode}");
26 | }
27 |
28 | // Filter out disabled items
29 | var enabledItems = LanguageBox.Items.Cast()
30 | .Where(x => x.IsEnabled)
31 | .ToList();
32 |
33 | LanguageBox.Items.Clear();
34 | foreach (var item in enabledItems)
35 | {
36 | LanguageBox.Items.Add(item);
37 | }
38 |
39 | LoadSavedLanguage();
40 | }
41 |
42 | public SettingsViewModel ViewModel { get; }
43 | public Theming Theming => Theming.GetInstance();
44 |
45 | private void LoadSavedLanguage()
46 | {
47 | string savedLanguage = Helpers.Settings.LoadLanguage();
48 |
49 | // Find and select the saved language in the ComboBox after initialization
50 | Dispatcher.BeginInvoke(new Action(() =>
51 | {
52 | var comboBox = this.FindName("LanguageBox") as ComboBox;
53 | if (comboBox != null)
54 | {
55 | var item = comboBox.Items.Cast()
56 | .FirstOrDefault(x => x.LanguageCode == savedLanguage && x.IsEnabled);
57 |
58 | if (item != null)
59 | {
60 | comboBox.SelectedItem = item;
61 | ApplyLanguage(savedLanguage);
62 | }
63 | }
64 | _isInitializing = false;
65 | }));
66 | }
67 |
68 | private void ApplyLanguage(string languageCode)
69 | {
70 | try
71 | {
72 | // Create the resource dictionary URI for the selected language
73 | var uri = new Uri($"/Resources/Translations/{languageCode}.xaml", UriKind.Relative);
74 |
75 | // Create the new ResourceDictionary
76 | ResourceDictionary langDict = new ResourceDictionary();
77 |
78 | try
79 | {
80 | langDict.Source = uri;
81 | }
82 | catch (Exception)
83 | {
84 | MessageBox.Show($"Failed to load language file for {languageCode}.", "Language Error", MessageBoxButton.OK, MessageBoxImage.Error);
85 | return;
86 | }
87 |
88 | // Get the app's current resource dictionaries
89 | var resources = Application.Current.Resources.MergedDictionaries;
90 |
91 | // Find and remove the current language dictionary if it exists
92 | var langDictToRemove = resources.FirstOrDefault(dict =>
93 | dict.Source?.OriginalString.Contains("/Resources/Translations/") == true);
94 |
95 | if (langDictToRemove != null)
96 | {
97 | resources.Remove(langDictToRemove);
98 | }
99 |
100 | // Add the new language dictionary
101 | resources.Add(langDict);
102 | }
103 | catch (Exception ex)
104 | {
105 | MessageBox.Show($"Error switching language: {ex.Message}", "Language Error", MessageBoxButton.OK, MessageBoxImage.Error);
106 | }
107 | }
108 |
109 | private void LanguageBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
110 | {
111 | if (sender is not ComboBox comboBox || comboBox.SelectedItem is not TranslationComboboxItem selectedItem)
112 | {
113 | return;
114 | }
115 |
116 | string? languageCode = selectedItem.LanguageCode;
117 | if (string.IsNullOrEmpty(languageCode))
118 | {
119 | return;
120 | }
121 |
122 | // Don't save during initial loading
123 | if (!_isInitializing)
124 | {
125 | Helpers.Settings.SaveLanguage(languageCode);
126 | }
127 |
128 | ApplyLanguage(languageCode);
129 | }
130 |
131 | private void ResetLanguage_OnClick(object sender, RoutedEventArgs e)
132 | {
133 | var englishItem = LanguageBox.Items.Cast()
134 | .FirstOrDefault(x => x.LanguageCode == "English" && x.IsEnabled);
135 |
136 | if (englishItem != null)
137 | {
138 | LanguageBox.SelectedItem = englishItem;
139 | }
140 | }
141 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Views/Pages/Tuning.xaml.cs:
--------------------------------------------------------------------------------
1 | using Forza_Mods_AIO.Resources.Theme;
2 | using Forza_Mods_AIO.ViewModels.Pages;
3 |
4 | namespace Forza_Mods_AIO.Views.Pages;
5 |
6 | public partial class Tuning
7 | {
8 | public Tuning()
9 | {
10 | ViewModel = new TuningViewModel();
11 | DataContext = this;
12 |
13 | InitializeComponent();
14 | }
15 |
16 | public TuningViewModel ViewModel { get; }
17 | public Theming Theming => Theming.GetInstance();
18 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Views/SubPages/SelfVehicle/PhotoMode.xaml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
16 |
17 |
18 |
23 |
24 |
27 |
28 |
34 |
35 |
36 |
37 |
42 |
43 |
47 |
48 |
51 |
52 |
53 |
54 |
57 |
58 |
59 |
60 |
61 |
62 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
101 |
102 |
107 |
108 |
114 |
115 |
120 |
121 |
122 |
123 |
124 |
125 |
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Views/SubPages/Tuning/Aero.xaml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
49 |
50 |
57 |
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Views/SubPages/Tuning/Aero.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Controls;
3 | using Forza_Mods_AIO.Cheats.ForzaHorizon5;
4 | using static Forza_Mods_AIO.Resources.Memory;
5 |
6 | namespace Forza_Mods_AIO.Views.SubPages.Tuning;
7 |
8 | public partial class Aero
9 | {
10 | public Aero()
11 | {
12 | InitializeComponent();
13 | }
14 |
15 | private static TuningCheats TuningCheatsFh5 => Forza_Mods_AIO.Resources.Cheats.GetClass();
16 | private static readonly int[] Offsets = [0x330, 0x8, 0x1E0, 0x0];
17 | private static UIntPtr Ptr => GetInstance().FollowMultiLevelPointer(TuningCheatsFh5.Base2, Offsets);
18 |
19 | private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
20 | {
21 | if (ComboBox == null || ValueBox == null || !TuningCheatsFh5.WasScanSuccessful)
22 | {
23 | return;
24 | }
25 |
26 | ValueBox.Value = ComboBox.SelectedIndex switch
27 | {
28 | 0 => GetInstance().ReadMemory(Ptr + TuningOffsets.FrontAeroMinOffset),
29 | 1 => GetInstance().ReadMemory(Ptr + TuningOffsets.FrontAeroMaxOffset),
30 | 2 => GetInstance().ReadMemory(Ptr + TuningOffsets.RearAeroMinOffset),
31 | 3 => GetInstance().ReadMemory(Ptr + TuningOffsets.RearAeroMaxOffset),
32 | _ => ValueBox.Value
33 | };
34 | }
35 |
36 | private void ValueBox_OnValueChanged(object sender, RoutedPropertyChangedEventArgs e)
37 | {
38 | if (!TuningCheatsFh5.WasScanSuccessful)
39 | {
40 | return;
41 | }
42 |
43 | var newValue = Convert.ToSingle(e.NewValue.GetValueOrDefault());
44 | switch (ComboBox.SelectedIndex)
45 | {
46 | case 0:
47 | {
48 | GetInstance().WriteMemory(Ptr + TuningOffsets.FrontAeroMinOffset, newValue);
49 | break;
50 | }
51 | case 1:
52 | {
53 | GetInstance().WriteMemory(Ptr + TuningOffsets.FrontAeroMaxOffset, newValue);
54 | break;
55 | }
56 | case 2:
57 | {
58 | GetInstance().WriteMemory(Ptr + TuningOffsets.RearAeroMinOffset, newValue);
59 | break;
60 | }
61 | case 3:
62 | {
63 | GetInstance().WriteMemory(Ptr + TuningOffsets.RearAeroMaxOffset, newValue);
64 | break;
65 | }
66 | }
67 | }
68 |
69 | private void ComboBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
70 | {
71 | if (ValueBox == null || !TuningCheatsFh5.WasScanSuccessful)
72 | {
73 | return;
74 | }
75 |
76 | ValueBox.Value = ComboBox.SelectedIndex switch
77 | {
78 | 0 => GetInstance().ReadMemory(Ptr + TuningOffsets.FrontAeroMinOffset),
79 | 1 => GetInstance().ReadMemory(Ptr + TuningOffsets.FrontAeroMaxOffset),
80 | 2 => GetInstance().ReadMemory(Ptr + TuningOffsets.RearAeroMinOffset),
81 | 3 => GetInstance().ReadMemory(Ptr + TuningOffsets.RearAeroMaxOffset),
82 | _ => ValueBox.Value
83 | };
84 | }
85 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Views/SubPages/Tuning/Alignment.xaml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
49 |
50 |
57 |
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Views/SubPages/Tuning/Alignment.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Controls;
3 | using Forza_Mods_AIO.Cheats.ForzaHorizon5;
4 | using static Forza_Mods_AIO.Resources.Memory;
5 |
6 | namespace Forza_Mods_AIO.Views.SubPages.Tuning;
7 |
8 | public partial class Alignment
9 | {
10 | public Alignment()
11 | {
12 | InitializeComponent();
13 | }
14 |
15 | private static TuningCheats TuningCheatsFh5 => Forza_Mods_AIO.Resources.Cheats.GetClass();
16 | private static readonly int[] Offsets = [0x8B0, 0x0];
17 | private static UIntPtr Ptr => GetInstance().FollowMultiLevelPointer(TuningCheatsFh5.Base1, Offsets);
18 |
19 | private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
20 | {
21 | if (ComboBox == null || ValueBox == null || !TuningCheatsFh5.WasScanSuccessful)
22 | {
23 | return;
24 | }
25 |
26 | ValueBox.Value = ComboBox.SelectedIndex switch
27 | {
28 | 0 => GetInstance().ReadMemory(Ptr + TuningOffsets.CamberNegOffset),
29 | 1 => GetInstance().ReadMemory(Ptr + TuningOffsets.CamberPosOffset),
30 | 2 => GetInstance().ReadMemory(Ptr + TuningOffsets.ToeNegOffset),
31 | 3 => GetInstance().ReadMemory(Ptr + TuningOffsets.ToePosOffset),
32 | _ => ValueBox.Value
33 | };
34 | }
35 |
36 | private void ValueBox_OnValueChanged(object sender, RoutedPropertyChangedEventArgs e)
37 | {
38 | if (!TuningCheatsFh5.WasScanSuccessful)
39 | {
40 | return;
41 | }
42 |
43 | var newValue = Convert.ToSingle(e.NewValue.GetValueOrDefault());
44 | switch (ComboBox.SelectedIndex)
45 | {
46 | case 0:
47 | {
48 | GetInstance().WriteMemory(Ptr + TuningOffsets.CamberNegOffset, newValue);
49 | GetInstance().WriteMemory(TuningCheatsFh5.Base4, newValue);
50 | break;
51 | }
52 | case 1:
53 | {
54 | GetInstance().WriteMemory(Ptr + TuningOffsets.CamberPosOffset, newValue);
55 | GetInstance().WriteMemory(TuningCheatsFh5.Base4 + 0x4, newValue);
56 | break;
57 | }
58 | case 2:
59 | {
60 | GetInstance().WriteMemory(Ptr + TuningOffsets.ToeNegOffset, newValue);
61 | GetInstance().WriteMemory(TuningCheatsFh5.Base4 + 0x8, newValue);
62 | break;
63 | }
64 | case 3:
65 | {
66 | GetInstance().WriteMemory(Ptr + TuningOffsets.ToePosOffset, newValue);
67 | GetInstance().WriteMemory(TuningCheatsFh5.Base4 + 0xC, newValue);
68 | break;
69 | }
70 | }
71 | }
72 |
73 | private void ComboBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
74 | {
75 | if (ValueBox == null || !TuningCheatsFh5.WasScanSuccessful)
76 | {
77 | return;
78 | }
79 |
80 | ValueBox.Value = ComboBox.SelectedIndex switch
81 | {
82 | 0 => GetInstance().ReadMemory(Ptr + TuningOffsets.CamberNegOffset),
83 | 1 => GetInstance().ReadMemory(Ptr + TuningOffsets.CamberPosOffset),
84 | 2 => GetInstance().ReadMemory(Ptr + TuningOffsets.ToeNegOffset),
85 | 3 => GetInstance().ReadMemory(Ptr + TuningOffsets.ToePosOffset),
86 | _ => ValueBox.Value
87 | };
88 | }
89 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Views/SubPages/Tuning/Damping.xaml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
60 |
61 |
68 |
69 |
70 |
71 |
72 |
73 |
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Views/SubPages/Tuning/Damping.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Controls;
3 | using Forza_Mods_AIO.Cheats.ForzaHorizon5;
4 | using static Forza_Mods_AIO.Resources.Memory;
5 |
6 | namespace Forza_Mods_AIO.Views.SubPages.Tuning;
7 |
8 | public partial class Damping
9 | {
10 | public Damping()
11 | {
12 | InitializeComponent();
13 | }
14 |
15 | private static TuningCheats TuningCheatsFh5 => Forza_Mods_AIO.Resources.Cheats.GetClass();
16 | private static readonly int[] Offsets = [0x330, 0x8, 0x1E0, 0x0];
17 | private static UIntPtr Ptr => GetInstance().FollowMultiLevelPointer(TuningCheatsFh5.Base2, Offsets);
18 |
19 | private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
20 | {
21 | UpdateValue();
22 | }
23 |
24 | private void ValueBox_OnValueChanged(object sender, RoutedPropertyChangedEventArgs e)
25 | {
26 | if (!TuningCheatsFh5.WasScanSuccessful)
27 | {
28 | return;
29 | }
30 |
31 | var newValue = Convert.ToSingle(e.NewValue.GetValueOrDefault());
32 | switch (ComboBox.SelectedIndex)
33 | {
34 | case 0:
35 | {
36 | GetInstance().WriteMemory(Ptr + TuningOffsets.FrontAntiRollMinOffset, newValue);
37 | break;
38 | }
39 | case 1:
40 | {
41 | GetInstance().WriteMemory(Ptr + TuningOffsets.FrontAntiRollMaxOffset, newValue);
42 | break;
43 | }
44 | case 2:
45 | {
46 | GetInstance().WriteMemory(Ptr + TuningOffsets.RearAntiRollMinOffset, newValue);
47 | break;
48 | }
49 | case 3:
50 | {
51 | GetInstance().WriteMemory(Ptr + TuningOffsets.RearAntiRollMaxOffset, newValue);
52 | break;
53 | }
54 | case 4:
55 | {
56 | GetInstance().WriteMemory(Ptr + TuningOffsets.FrontReboundStiffnessMinOffset, newValue);
57 | break;
58 | }
59 | case 5:
60 | {
61 | GetInstance().WriteMemory(Ptr + TuningOffsets.FrontReboundStiffnessMaxOffset, newValue);
62 | break;
63 | }
64 | case 6:
65 | {
66 | GetInstance().WriteMemory(Ptr + TuningOffsets.RearReboundStiffnessMinOffset, newValue);
67 | break;
68 | }
69 | case 7:
70 | {
71 | GetInstance().WriteMemory(Ptr + TuningOffsets.RearReboundStiffnessMaxOffset, newValue);
72 | break;
73 | }
74 | case 8:
75 | {
76 | GetInstance().WriteMemory(Ptr + TuningOffsets.FrontBumpStiffnessMinOffset, newValue);
77 | break;
78 | }
79 | case 9:
80 | {
81 | GetInstance().WriteMemory(Ptr + TuningOffsets.FrontBumpStiffnessMaxOffset, newValue);
82 | break;
83 | }
84 | case 10:
85 | {
86 | GetInstance().WriteMemory(Ptr + TuningOffsets.RearBumpStiffnessMinOffset, newValue);
87 | break;
88 | }
89 | case 11:
90 | {
91 | GetInstance().WriteMemory(Ptr + TuningOffsets.RearBumpStiffnessMaxOffset, newValue);
92 | break;
93 | }
94 | }
95 | }
96 |
97 | private void ComboBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
98 | {
99 | UpdateValue();
100 | }
101 |
102 | private void UpdateValue()
103 | {
104 | if (ValueBox == null || !TuningCheatsFh5.WasScanSuccessful)
105 | {
106 | return;
107 | }
108 |
109 | ValueBox.Value = ComboBox.SelectedIndex switch
110 | {
111 | 0 => GetInstance().ReadMemory(Ptr + TuningOffsets.FrontAntiRollMinOffset),
112 | 1 => GetInstance().ReadMemory(Ptr + TuningOffsets.FrontAntiRollMaxOffset),
113 | 2 => GetInstance().ReadMemory(Ptr + TuningOffsets.RearAntiRollMinOffset),
114 | 3 => GetInstance().ReadMemory(Ptr + TuningOffsets.RearAntiRollMaxOffset),
115 | 4 => GetInstance().ReadMemory(Ptr + TuningOffsets.FrontReboundStiffnessMinOffset),
116 | 5 => GetInstance().ReadMemory(Ptr + TuningOffsets.FrontReboundStiffnessMaxOffset),
117 | 6 => GetInstance().ReadMemory(Ptr + TuningOffsets.RearReboundStiffnessMinOffset),
118 | 7 => GetInstance().ReadMemory(Ptr + TuningOffsets.RearReboundStiffnessMaxOffset),
119 | 8 => GetInstance().ReadMemory(Ptr + TuningOffsets.FrontBumpStiffnessMinOffset),
120 | 9 => GetInstance().ReadMemory(Ptr + TuningOffsets.FrontBumpStiffnessMaxOffset),
121 | 10 => GetInstance().ReadMemory(Ptr + TuningOffsets.RearBumpStiffnessMinOffset),
122 | 11 => GetInstance().ReadMemory(Ptr + TuningOffsets.RearBumpStiffnessMaxOffset),
123 | _ => ValueBox.Value
124 | };
125 | }
126 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Views/SubPages/Tuning/Gearing.xaml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
57 |
58 |
65 |
66 |
67 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Views/SubPages/Tuning/Gearing.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Controls;
3 | using Forza_Mods_AIO.Cheats.ForzaHorizon5;
4 | using static Forza_Mods_AIO.Resources.Memory;
5 |
6 | namespace Forza_Mods_AIO.Views.SubPages.Tuning;
7 |
8 | public partial class Gearing
9 | {
10 | public Gearing()
11 | {
12 | InitializeComponent();
13 | }
14 |
15 | private static TuningCheats TuningCheatsFh5 => Forza_Mods_AIO.Resources.Cheats.GetClass();
16 | private static CarCheats CarCheatsFh5 => Forza_Mods_AIO.Resources.Cheats.GetClass();
17 | private static UIntPtr Ptr => GetInstance()
18 | .ReadMemory(CarCheatsFh5.LocalPlayerHookDetourAddress + CarCheatsOffsets.LocalPlayer);
19 |
20 | private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
21 | {
22 | UpdateValue();
23 | }
24 |
25 | private void ValueBox_OnValueChanged(object sender, RoutedPropertyChangedEventArgs e)
26 | {
27 | if (!TuningCheatsFh5.WasScanSuccessful)
28 | {
29 | return;
30 | }
31 |
32 | var newValue = Convert.ToSingle(e.NewValue.GetValueOrDefault());
33 | switch (ComboBox.SelectedIndex)
34 | {
35 | case 0:
36 | {
37 | GetInstance().WriteMemory(Ptr + TuningOffsets.FinalDriveOffset, newValue);
38 | break;
39 | }
40 | case 1:
41 | {
42 | GetInstance().WriteMemory(Ptr + TuningOffsets.ReverseGearOffset, newValue);
43 | break;
44 | }
45 | case 2:
46 | {
47 | GetInstance().WriteMemory(Ptr + TuningOffsets.FifthGearOffset, newValue);
48 | break;
49 | }
50 | case 3:
51 | {
52 | GetInstance().WriteMemory(Ptr + TuningOffsets.SecondGearOffset, newValue);
53 | break;
54 | }
55 | case 4:
56 | {
57 | GetInstance().WriteMemory(Ptr + TuningOffsets.ThirdGearOffset, newValue);
58 | break;
59 | }
60 | case 5:
61 | {
62 | GetInstance().WriteMemory(Ptr + TuningOffsets.FourthGearOffset, newValue);
63 | break;
64 | }
65 | case 6:
66 | {
67 | GetInstance().WriteMemory(Ptr + TuningOffsets.FifthGearOffset, newValue);
68 | break;
69 | }
70 | case 7:
71 | {
72 | GetInstance().WriteMemory(Ptr + TuningOffsets.SixthGearOffset, newValue);
73 | break;
74 | }
75 | case 8:
76 | {
77 | GetInstance().WriteMemory(Ptr + TuningOffsets.SeventhGearOffset, newValue);
78 | break;
79 | }
80 | case 9:
81 | {
82 | GetInstance().WriteMemory(Ptr + TuningOffsets.EighthGearOffset, newValue);
83 | break;
84 | }
85 | case 10:
86 | {
87 | GetInstance().WriteMemory(Ptr + TuningOffsets.NinthGearOffset, newValue);
88 | break;
89 | }
90 | case 11:
91 | {
92 | GetInstance().WriteMemory(Ptr + TuningOffsets.TenthGearOffset, newValue);
93 | break;
94 | }
95 | }
96 | }
97 |
98 | private void ComboBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
99 | {
100 | UpdateValue();
101 | }
102 |
103 | private void UpdateValue()
104 | {
105 | if (ValueBox == null || !TuningCheatsFh5.WasScanSuccessful)
106 | {
107 | return;
108 | }
109 |
110 | ValueBox.Value = ComboBox.SelectedIndex switch
111 | {
112 | 0 => GetInstance().ReadMemory(Ptr + TuningOffsets.FinalDriveOffset),
113 | 1 => GetInstance().ReadMemory(Ptr + TuningOffsets.ReverseGearOffset),
114 | 2 => GetInstance().ReadMemory(Ptr + TuningOffsets.FirstGearOffset),
115 | 3 => GetInstance().ReadMemory(Ptr + TuningOffsets.SecondGearOffset),
116 | 4 => GetInstance().ReadMemory(Ptr + TuningOffsets.ThirdGearOffset),
117 | 5 => GetInstance().ReadMemory(Ptr + TuningOffsets.FourthGearOffset),
118 | 6 => GetInstance().ReadMemory(Ptr + TuningOffsets.FifthGearOffset),
119 | 7 => GetInstance().ReadMemory(Ptr + TuningOffsets.SixthGearOffset),
120 | 8 => GetInstance().ReadMemory(Ptr + TuningOffsets.SeventhGearOffset),
121 | 9 => GetInstance().ReadMemory(Ptr + TuningOffsets.EighthGearOffset),
122 | 10 => GetInstance().ReadMemory(Ptr + TuningOffsets.NinthGearOffset),
123 | 11 => GetInstance().ReadMemory(Ptr + TuningOffsets.TenthGearOffset),
124 | _ => ValueBox.Value
125 | };
126 | }
127 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Views/SubPages/Tuning/Others.xaml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
55 |
56 |
63 |
64 |
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Views/SubPages/Tuning/Others.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Controls;
3 | using Forza_Mods_AIO.Cheats.ForzaHorizon5;
4 | using static Forza_Mods_AIO.Resources.Memory;
5 |
6 | namespace Forza_Mods_AIO.Views.SubPages.Tuning;
7 |
8 | public partial class Others
9 | {
10 | public Others()
11 | {
12 | InitializeComponent();
13 | }
14 |
15 | private static TuningCheats TuningCheatsFh5 => Forza_Mods_AIO.Resources.Cheats.GetClass();
16 | private static readonly int[] Offsets1 = [0x330, 0x8, 0x1E0, 0x0];
17 | private static UIntPtr Ptr1 => GetInstance().FollowMultiLevelPointer(TuningCheatsFh5.Base2, Offsets1);
18 | private static readonly int[] Offsets2 = [0x150, 0x300, 0x0];
19 | private static UIntPtr Ptr2 => GetInstance().FollowMultiLevelPointer(TuningCheatsFh5.Base3, Offsets2);
20 |
21 | private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
22 | {
23 | UpdateValue();
24 | }
25 |
26 | private void ValueBox_OnValueChanged(object sender, RoutedPropertyChangedEventArgs e)
27 | {
28 | if (!TuningCheatsFh5.WasScanSuccessful)
29 | {
30 | return;
31 | }
32 |
33 | var newValue = Convert.ToSingle(e.NewValue.GetValueOrDefault());
34 | switch (ComboBox.SelectedIndex)
35 | {
36 | case 0:
37 | {
38 | GetInstance().WriteMemory(Ptr1 + TuningOffsets.WheelbaseOffset, newValue);
39 | break;
40 | }
41 | case 1:
42 | {
43 | GetInstance().WriteMemory(Ptr1 + TuningOffsets.FrontWidthOffset, newValue);
44 | break;
45 | }
46 | case 2:
47 | {
48 | GetInstance().WriteMemory(Ptr1 + TuningOffsets.FrontSpacerOffset, newValue);
49 | break;
50 | }
51 | case 3:
52 | {
53 | GetInstance().WriteMemory(Ptr1 + TuningOffsets.RearWidthOffset, newValue);
54 | break;
55 | }
56 | case 4:
57 | {
58 | GetInstance().WriteMemory(Ptr1 + TuningOffsets.RearSpacerOffset, newValue);
59 | break;
60 | }
61 | case 5:
62 | {
63 | GetInstance().WriteMemory(Ptr2 + TuningOffsets.RimSizeFrontOffset, newValue);
64 | break;
65 | }
66 | case 6:
67 | {
68 | GetInstance().WriteMemory(Ptr2 + TuningOffsets.RimRadiusFrontOffset, newValue);
69 | break;
70 | }
71 | case 7:
72 | {
73 | GetInstance().WriteMemory(Ptr2 + TuningOffsets.RimSizeRearOffset, newValue);
74 | break;
75 | }
76 | case 8:
77 | {
78 | GetInstance().WriteMemory(Ptr2 + TuningOffsets.RimRadiusRearOffset, newValue);
79 | break;
80 | }
81 | }
82 | }
83 |
84 | private void ComboBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
85 | {
86 | UpdateValue();
87 | }
88 |
89 | private void UpdateValue()
90 | {
91 | if (ValueBox == null || !TuningCheatsFh5.WasScanSuccessful)
92 | {
93 | return;
94 | }
95 |
96 |
97 | ValueBox.Value = ComboBox.SelectedIndex switch
98 | {
99 | 0 => GetInstance().ReadMemory(Ptr1 + TuningOffsets.WheelbaseOffset),
100 | 1 => GetInstance().ReadMemory(Ptr1 + TuningOffsets.FrontWidthOffset),
101 | 2 => GetInstance().ReadMemory(Ptr1 + TuningOffsets.FrontSpacerOffset),
102 | 3 => GetInstance().ReadMemory(Ptr1 + TuningOffsets.RearWidthOffset),
103 | 4 => GetInstance().ReadMemory(Ptr1 + TuningOffsets.RearSpacerOffset),
104 | 5 => GetInstance().ReadMemory(Ptr2 + TuningOffsets.RimSizeFrontOffset),
105 | 6 => GetInstance().ReadMemory(Ptr2 + TuningOffsets.RimRadiusFrontOffset),
106 | 7 => GetInstance().ReadMemory(Ptr2 + TuningOffsets.RimSizeRearOffset),
107 | 8 => GetInstance().ReadMemory(Ptr2 + TuningOffsets.RimRadiusRearOffset),
108 | _ => ValueBox.Value
109 | };
110 | }
111 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Views/SubPages/Tuning/Springs.xaml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
50 |
51 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
115 |
116 |
124 |
125 |
126 |
127 |
128 |
129 |
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Views/SubPages/Tuning/Steering.xaml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
53 |
54 |
61 |
62 |
63 |
64 |
65 |
66 |
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Views/SubPages/Tuning/Steering.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Controls;
3 | using Forza_Mods_AIO.Cheats.ForzaHorizon5;
4 | using static Forza_Mods_AIO.Resources.Memory;
5 |
6 | namespace Forza_Mods_AIO.Views.SubPages.Tuning;
7 |
8 | public partial class Steering : Page
9 | {
10 | public Steering()
11 | {
12 | InitializeComponent();
13 | }
14 |
15 | private static TuningCheats TuningCheatsFh5 => Forza_Mods_AIO.Resources.Cheats.GetClass();
16 | private static readonly int[] Offsets = [0x330, 0x8, 0x1E0, 0x0];
17 | private static UIntPtr Ptr => GetInstance().FollowMultiLevelPointer(TuningCheatsFh5.Base2, Offsets);
18 |
19 | private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
20 | {
21 | if (ComboBox == null || ValueBox == null || !TuningCheatsFh5.WasScanSuccessful)
22 | {
23 | return;
24 | }
25 |
26 | ValueBox.Value = ComboBox.SelectedIndex switch
27 | {
28 | 0 => GetInstance().ReadMemory(Ptr + TuningOffsets.AngleMaxOffset),
29 | 1 => GetInstance().ReadMemory(Ptr + TuningOffsets.AngleMax2Offset),
30 | 2 => GetInstance().ReadMemory(Ptr + TuningOffsets.VelocityStraightOffset),
31 | 3 => GetInstance().ReadMemory(Ptr + TuningOffsets.VelocityTurningOffset),
32 | 4 => GetInstance().ReadMemory(Ptr + TuningOffsets.VelocityCountersteerOffset),
33 | 5 => GetInstance().ReadMemory(Ptr + TuningOffsets.VelocityDynamicPeekOffset),
34 | 6 => GetInstance().ReadMemory(Ptr + TuningOffsets.TimeToMaxSteeringOffset),
35 | _ => ValueBox.Value
36 | };
37 | }
38 |
39 | private void ValueBox_OnValueChanged(object sender, RoutedPropertyChangedEventArgs e)
40 | {
41 | if (!TuningCheatsFh5.WasScanSuccessful)
42 | {
43 | return;
44 | }
45 |
46 | var newValue = Convert.ToSingle(e.NewValue.GetValueOrDefault());
47 | switch (ComboBox.SelectedIndex)
48 | {
49 | case 0:
50 | {
51 | GetInstance().WriteMemory(Ptr + TuningOffsets.AngleMaxOffset, newValue);
52 | break;
53 | }
54 | case 1:
55 | {
56 | GetInstance().WriteMemory(Ptr + TuningOffsets.AngleMax2Offset, newValue);
57 | break;
58 | }
59 | case 2:
60 | {
61 | GetInstance().WriteMemory(Ptr + TuningOffsets.VelocityStraightOffset, newValue);
62 | break;
63 | }
64 | case 3:
65 | {
66 | GetInstance().WriteMemory(Ptr + TuningOffsets.VelocityTurningOffset, newValue);
67 | break;
68 | }
69 | case 4:
70 | {
71 | GetInstance().WriteMemory(Ptr + TuningOffsets.VelocityCountersteerOffset, newValue);
72 | break;
73 | }
74 | case 5:
75 | {
76 | GetInstance().WriteMemory(Ptr + TuningOffsets.VelocityDynamicPeekOffset, newValue);
77 | break;
78 | }
79 | case 6:
80 | {
81 | GetInstance().WriteMemory(Ptr + TuningOffsets.TimeToMaxSteeringOffset, newValue);
82 | break;
83 | }
84 | }
85 | }
86 |
87 | private void ComboBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
88 | {
89 | if (ValueBox == null || !TuningCheatsFh5.WasScanSuccessful)
90 | {
91 | return;
92 | }
93 |
94 | ValueBox.Value = ComboBox.SelectedIndex switch
95 | {
96 | 0 => GetInstance().ReadMemory(Ptr + TuningOffsets.AngleMaxOffset),
97 | 1 => GetInstance().ReadMemory(Ptr + TuningOffsets.AngleMax2Offset),
98 | 2 => GetInstance().ReadMemory(Ptr + TuningOffsets.VelocityStraightOffset),
99 | 3 => GetInstance().ReadMemory(Ptr + TuningOffsets.VelocityTurningOffset),
100 | 4 => GetInstance().ReadMemory(Ptr + TuningOffsets.VelocityCountersteerOffset),
101 | 5 => GetInstance().ReadMemory(Ptr + TuningOffsets.VelocityDynamicPeekOffset),
102 | 6 => GetInstance().ReadMemory(Ptr + TuningOffsets.TimeToMaxSteeringOffset),
103 | _ => ValueBox.Value
104 | };
105 | }
106 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Views/SubPages/Tuning/Tires.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
64 |
65 |
73 |
74 |
75 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Views/SubPages/Tuning/Tires.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Controls;
3 | using Forza_Mods_AIO.Cheats.ForzaHorizon5;
4 | using static Forza_Mods_AIO.Resources.Memory;
5 |
6 | namespace Forza_Mods_AIO.Views.SubPages.Tuning;
7 |
8 | public partial class Tires
9 | {
10 | public Tires()
11 | {
12 | InitializeComponent();
13 | }
14 |
15 | private static TuningCheats TuningCheatsFh5 => Forza_Mods_AIO.Resources.Cheats.GetClass();
16 | private static CarCheats CarCheatsFh5 => Forza_Mods_AIO.Resources.Cheats.GetClass();
17 | private static UIntPtr Ptr => GetInstance()
18 | .ReadMemory(CarCheatsFh5.LocalPlayerHookDetourAddress + CarCheatsOffsets.LocalPlayer);
19 |
20 | private bool _codeChange;
21 |
22 | private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
23 | {
24 | UpdateValue();
25 | }
26 |
27 | private void ValueBox_OnValueChanged(object sender, RoutedPropertyChangedEventArgs e)
28 | {
29 | if (!TuningCheatsFh5.WasScanSuccessful || _codeChange)
30 | {
31 | return;
32 | }
33 |
34 | var divider = UnitBox.SelectedIndex == 0 ? 1f : 14.503773773f;
35 | var newValue = Convert.ToSingle(e.NewValue.GetValueOrDefault()) / divider;
36 | switch (ComboBox.SelectedIndex)
37 | {
38 | case 0:
39 | {
40 | GetInstance().WriteMemory(Ptr + TuningOffsets.FrontLeftTirePressureOffset, newValue);
41 | break;
42 | }
43 | case 1:
44 | {
45 | GetInstance().WriteMemory(Ptr + TuningOffsets.FrontRightTirePressureOffset, newValue);
46 | break;
47 | }
48 | case 2:
49 | {
50 | GetInstance().WriteMemory(Ptr + TuningOffsets.RearLeftTirePressureOffset, newValue);
51 | break;
52 | }
53 | case 3:
54 | {
55 | GetInstance().WriteMemory(Ptr + TuningOffsets.RearRightTirePressureOffset, newValue);
56 | break;
57 | }
58 | }
59 | }
60 |
61 | private void ComboBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
62 | {
63 | UpdateValue();
64 | }
65 |
66 | private void UnitBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
67 | {
68 | UpdateValue();
69 | }
70 |
71 | private void UpdateValue()
72 | {
73 | if (ValueBox == null || !TuningCheatsFh5.WasScanSuccessful)
74 | {
75 | return;
76 | }
77 |
78 | _codeChange = true;
79 | var divider = UnitBox.SelectedIndex == 0 ? 1f : 14.503773773f;
80 | ValueBox.Value = ComboBox.SelectedIndex switch
81 | {
82 | 0 => GetInstance().ReadMemory(Ptr + TuningOffsets.FrontLeftTirePressureOffset) / divider,
83 | 1 => GetInstance().ReadMemory(Ptr + TuningOffsets.FrontRightTirePressureOffset) / divider,
84 | 2 => GetInstance().ReadMemory(Ptr + TuningOffsets.RearLeftTirePressureOffset) / divider,
85 | 3 => GetInstance().ReadMemory(Ptr + TuningOffsets.RearRightTirePressureOffset) / divider,
86 | _ => ValueBox.Value
87 | };
88 | _codeChange = false;
89 | }
90 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Views/Windows/DebugWindow.xaml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
32 |
33 |
34 |
38 |
39 |
40 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
54 |
55 |
56 |
60 |
61 |
65 |
66 |
70 |
71 |
72 |
73 |
74 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
99 |
100 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Views/Windows/DebugWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 | using System.Windows.Controls;
3 | using Forza_Mods_AIO.ViewModels.Windows;
4 |
5 | namespace Forza_Mods_AIO.Views.Windows;
6 |
7 | public partial class DebugWindow
8 | {
9 | public DebugWindowViewModel ViewModel { get; }
10 |
11 | public DebugWindow(DebugWindowViewModel viewModel)
12 | {
13 | ViewModel = viewModel;
14 | DataContext = this;
15 |
16 | InitializeComponent();
17 | Closing += OnClosing;
18 | }
19 |
20 | private void OnClosing(object? sender, CancelEventArgs e)
21 | {
22 | e.Cancel = true;
23 | Hide();
24 | }
25 |
26 | private void DebugList_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
27 | {
28 | ViewModel.CurrentDebugSession = ViewModel.DebugSessions[DebugList.SelectedIndex];
29 | }
30 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Views/Windows/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Controls;
3 | using System.Windows.Input;
4 | using Forza_Mods_AIO.Resources.Theme;
5 | using Forza_Mods_AIO.ViewModels.Windows;
6 |
7 | namespace Forza_Mods_AIO.Views.Windows;
8 |
9 | public partial class MainWindow
10 | {
11 | public MainWindow(MainWindowViewModel viewModel)
12 | {
13 | ViewModel = viewModel;
14 | DataContext = this;
15 |
16 | InitializeComponent();
17 | }
18 |
19 | public MainWindowViewModel ViewModel { get; }
20 | public Theming Theming => Theming.GetInstance();
21 |
22 | private void MainWindow_OnMouseDown(object sender, MouseButtonEventArgs e)
23 | {
24 | if (WindowState != WindowState.Normal) return;
25 |
26 | var isLeftButton = e.ChangedButton == MouseButton.Left;
27 | if (!isLeftButton) return;
28 |
29 | var position = e.GetPosition(this);
30 | var isWithinTopArea = position.Y < 50;
31 | if (!isWithinTopArea) return;
32 |
33 | DragMove();
34 | }
35 |
36 | private void WindowStateAction_OnClick(object sender, RoutedEventArgs e)
37 | {
38 | if (sender is not Button button) return;
39 |
40 | switch (button.Tag)
41 | {
42 | case "1":
43 | {
44 | SystemCommands.MinimizeWindow(this);
45 | break;
46 | }
47 | case "2":
48 | {
49 | if (WindowState == WindowState.Maximized)
50 | {
51 | SystemCommands.RestoreWindow(this);
52 | }
53 | else
54 | {
55 | SystemCommands.MaximizeWindow(this);
56 | }
57 |
58 | ViewModel.HandleMaximizeMinimize(this);
59 | break;
60 | }
61 | case "3":
62 | {
63 | SystemCommands.CloseWindow(this);
64 | break;
65 | }
66 | }
67 | }
68 |
69 | private void SearchGrid_OnMouseDown(object sender, MouseButtonEventArgs e)
70 | {
71 | if (e.ChangedButton != MouseButton.Left) return;
72 |
73 | ViewModel.ToggleSearchCommand.Execute(null);
74 | }
75 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Views/Windows/OverlayWindow.xaml:
--------------------------------------------------------------------------------
1 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/Views/Windows/OverlayWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | namespace Forza_Mods_AIO.Views.Windows;
4 |
5 | public partial class OverlayWindow : Window
6 | {
7 | public OverlayWindow()
8 | {
9 | InitializeComponent();
10 | }
11 | }
--------------------------------------------------------------------------------
/Forza-Mods-AIO/Forza-Mods-AIO/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Forza Mods AIO
2 |
3 | Forza Mods AIO is a free FH4 and FH5 mod tool that aims to bring cool, new and unique features, all at NO cost!
4 |
5 | ## What does this project do?
6 |
7 | It improves the player experience by adding various time saving and quality of life features.
8 | These additions are designed to streamline gameplay, improve user satisfaction, and elevate the overall enjoyment of the gaming experience.
9 |
10 | ## Why is this project useful?
11 |
12 | The AIO significantly enhances your gaming experience in FH4 and 5. It provides time-saving and quality-of-life features, ensuring you have more fun while playing.
13 | Plus, it's completely free, making these enhancements accessible to everyone. However if you wish to support the developers, we are open to donations which you can find in the repository and in the tool itself.
14 |
15 | ## How It Works?
16 |
17 | This tool uses [merik's](https://github.com/szaaamerik) [memory.dll library](https://github.com/szaaamerik/memory.andy.dll) to perform signature scans for different functions and offsets.
18 | The result from the scans is then used to create detours to power the features within the tool.
19 |
20 | ## How do I get started?
21 |
22 | To get started with the AIO you have two ways.
23 | You either download the latest release or build the project yourself.
24 |
25 | ### Downloading the latest release:
26 |
27 | - Head over to the [releases tab](https://github.com/ForzaMods/Forza-Mods-AIO/releases),
28 | - Find the release which has the "latest" tag and open it,
29 | - Scroll down to the assets part, and download the executable.
30 |
31 | ### Building the project yourself:
32 |
33 | - Clone the repository,
34 | - Open it in your preferred dotnet IDE (the developers recommend [JetBrains Rider](https://www.jetbrains.com/rider/)),
35 | - Ensure all necessary dependencies are installed,
36 | - Press the start/run button to start the project.
37 |
38 | ## Where can I get more help, if I need it?
39 |
40 | For support, please visit our Discord server or open an issue on GitHub.
41 |
42 | Discord: [Discord Server Link](https://discord.gg/forzamods)
43 | GitHub Issues: [Github Issues Link](https://github.com/ForzaMods/Forza-Mods-AIO/issues/new/choose)
44 | Troubleshooting Site: [Troubleshooting Site Link](https://forzamods.dev/troubleshooting)
45 |
46 | ## Requirements
47 |
48 | - [.NET 8](https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-desktop-8.0.4-windows-x64-installer)
49 | - Latest version of the game you wish to use the AIO on.
50 |
51 | ## License
52 |
53 | This app is under the GPL-3.0 license. You can find a copy of it [here](LICENSE).
54 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 | # Security Policy
2 |
3 | ## Supported Versions
4 |
5 | Use this section to tell people about which versions of your project are
6 | currently being supported with security updates.
7 |
8 | | Version | Supported |
9 | | ---------- | ------------------ |
10 | | >= 2.0.7.x | :white_check_mark: |
11 | | < 2.0.4.x | :x: |
12 |
13 | ## Reporting a Vulnerability
14 |
15 | Use this section to tell people how to report a vulnerability.
16 |
17 | Tell them where to go, how often they can expect to get an update on a
18 | reported vulnerability, what to expect if the vulnerability is accepted or
19 | declined, etc.
20 |
--------------------------------------------------------------------------------