├── .gitignore ├── .gitmodules ├── LICENSE ├── README.md ├── T8CustomEE.sln └── T8CustomEE ├── Form1.Designer.cs ├── Form1.cs ├── Form1.resx ├── Library.cs ├── Program.cs └── T8CustomEE.csproj /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Ww][Ii][Nn]32/ 27 | [Aa][Rr][Mm]/ 28 | [Aa][Rr][Mm]64/ 29 | bld/ 30 | [Bb]in/ 31 | [Oo]bj/ 32 | [Ll]og/ 33 | [Ll]ogs/ 34 | 35 | # Visual Studio 2015/2017 cache/options directory 36 | .vs/ 37 | # Uncomment if you have tasks that create the project's static files in wwwroot 38 | #wwwroot/ 39 | 40 | # Visual Studio 2017 auto generated files 41 | Generated\ Files/ 42 | 43 | # MSTest test Results 44 | [Tt]est[Rr]esult*/ 45 | [Bb]uild[Ll]og.* 46 | 47 | # NUnit 48 | *.VisualState.xml 49 | TestResult.xml 50 | nunit-*.xml 51 | 52 | # Build Results of an ATL Project 53 | [Dd]ebugPS/ 54 | [Rr]eleasePS/ 55 | dlldata.c 56 | 57 | # Benchmark Results 58 | BenchmarkDotNet.Artifacts/ 59 | 60 | # .NET Core 61 | project.lock.json 62 | project.fragment.lock.json 63 | artifacts/ 64 | 65 | # ASP.NET Scaffolding 66 | ScaffoldingReadMe.txt 67 | 68 | # StyleCop 69 | StyleCopReport.xml 70 | 71 | # Files built by Visual Studio 72 | *_i.c 73 | *_p.c 74 | *_h.h 75 | *.ilk 76 | *.meta 77 | *.obj 78 | *.iobj 79 | *.pch 80 | *.pdb 81 | *.ipdb 82 | *.pgc 83 | *.pgd 84 | *.rsp 85 | *.sbr 86 | *.tlb 87 | *.tli 88 | *.tlh 89 | *.tmp 90 | *.tmp_proj 91 | *_wpftmp.csproj 92 | *.log 93 | *.tlog 94 | *.vspscc 95 | *.vssscc 96 | .builds 97 | *.pidb 98 | *.svclog 99 | *.scc 100 | 101 | # Chutzpah Test files 102 | _Chutzpah* 103 | 104 | # Visual C++ cache files 105 | ipch/ 106 | *.aps 107 | *.ncb 108 | *.opendb 109 | *.opensdf 110 | *.sdf 111 | *.cachefile 112 | *.VC.db 113 | *.VC.VC.opendb 114 | 115 | # Visual Studio profiler 116 | *.psess 117 | *.vsp 118 | *.vspx 119 | *.sap 120 | 121 | # Visual Studio Trace Files 122 | *.e2e 123 | 124 | # TFS 2012 Local Workspace 125 | $tf/ 126 | 127 | # Guidance Automation Toolkit 128 | *.gpState 129 | 130 | # ReSharper is a .NET coding add-in 131 | _ReSharper*/ 132 | *.[Rr]e[Ss]harper 133 | *.DotSettings.user 134 | 135 | # TeamCity is a build add-in 136 | _TeamCity* 137 | 138 | # DotCover is a Code Coverage Tool 139 | *.dotCover 140 | 141 | # AxoCover is a Code Coverage Tool 142 | .axoCover/* 143 | !.axoCover/settings.json 144 | 145 | # Coverlet is a free, cross platform Code Coverage Tool 146 | coverage*.json 147 | coverage*.xml 148 | coverage*.info 149 | 150 | # Visual Studio code coverage results 151 | *.coverage 152 | *.coveragexml 153 | 154 | # NCrunch 155 | _NCrunch_* 156 | .*crunch*.local.xml 157 | nCrunchTemp_* 158 | 159 | # MightyMoose 160 | *.mm.* 161 | AutoTest.Net/ 162 | 163 | # Web workbench (sass) 164 | .sass-cache/ 165 | 166 | # Installshield output folder 167 | [Ee]xpress/ 168 | 169 | # DocProject is a documentation generator add-in 170 | DocProject/buildhelp/ 171 | DocProject/Help/*.HxT 172 | DocProject/Help/*.HxC 173 | DocProject/Help/*.hhc 174 | DocProject/Help/*.hhk 175 | DocProject/Help/*.hhp 176 | DocProject/Help/Html2 177 | DocProject/Help/html 178 | 179 | # Click-Once directory 180 | publish/ 181 | 182 | # Publish Web Output 183 | *.[Pp]ublish.xml 184 | *.azurePubxml 185 | # Note: Comment the next line if you want to checkin your web deploy settings, 186 | # but database connection strings (with potential passwords) will be unencrypted 187 | *.pubxml 188 | *.publishproj 189 | 190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 191 | # checkin your Azure Web App publish settings, but sensitive information contained 192 | # in these scripts will be unencrypted 193 | PublishScripts/ 194 | 195 | # NuGet Packages 196 | *.nupkg 197 | # NuGet Symbol Packages 198 | *.snupkg 199 | # The packages folder can be ignored because of Package Restore 200 | **/[Pp]ackages/* 201 | # except build/, which is used as an MSBuild target. 202 | !**/[Pp]ackages/build/ 203 | # Uncomment if necessary however generally it will be regenerated when needed 204 | #!**/[Pp]ackages/repositories.config 205 | # NuGet v3's project.json files produces more ignorable files 206 | *.nuget.props 207 | *.nuget.targets 208 | 209 | # Microsoft Azure Build Output 210 | csx/ 211 | *.build.csdef 212 | 213 | # Microsoft Azure Emulator 214 | ecf/ 215 | rcf/ 216 | 217 | # Windows Store app package directories and files 218 | AppPackages/ 219 | BundleArtifacts/ 220 | Package.StoreAssociation.xml 221 | _pkginfo.txt 222 | *.appx 223 | *.appxbundle 224 | *.appxupload 225 | 226 | # Visual Studio cache files 227 | # files ending in .cache can be ignored 228 | *.[Cc]ache 229 | # but keep track of directories ending in .cache 230 | !?*.[Cc]ache/ 231 | 232 | # Others 233 | ClientBin/ 234 | ~$* 235 | *~ 236 | *.dbmdl 237 | *.dbproj.schemaview 238 | *.jfm 239 | *.pfx 240 | *.publishsettings 241 | orleans.codegen.cs 242 | 243 | # Including strong name files can present a security risk 244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 245 | #*.snk 246 | 247 | # Since there are multiple workflows, uncomment next line to ignore bower_components 248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 249 | #bower_components/ 250 | 251 | # RIA/Silverlight projects 252 | Generated_Code/ 253 | 254 | # Backup & report files from converting an old project file 255 | # to a newer Visual Studio version. Backup files are not needed, 256 | # because we have git ;-) 257 | _UpgradeReport_Files/ 258 | Backup*/ 259 | UpgradeLog*.XML 260 | UpgradeLog*.htm 261 | ServiceFabricBackup/ 262 | *.rptproj.bak 263 | 264 | # SQL Server files 265 | *.mdf 266 | *.ldf 267 | *.ndf 268 | 269 | # Business Intelligence projects 270 | *.rdl.data 271 | *.bim.layout 272 | *.bim_*.settings 273 | *.rptproj.rsuser 274 | *- [Bb]ackup.rdl 275 | *- [Bb]ackup ([0-9]).rdl 276 | *- [Bb]ackup ([0-9][0-9]).rdl 277 | 278 | # Microsoft Fakes 279 | FakesAssemblies/ 280 | 281 | # GhostDoc plugin setting file 282 | *.GhostDoc.xml 283 | 284 | # Node.js Tools for Visual Studio 285 | .ntvs_analysis.dat 286 | node_modules/ 287 | 288 | # Visual Studio 6 build log 289 | *.plg 290 | 291 | # Visual Studio 6 workspace options file 292 | *.opt 293 | 294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 295 | *.vbw 296 | 297 | # Visual Studio 6 auto-generated project file (contains which files were open etc.) 298 | *.vbp 299 | 300 | # Visual Studio 6 workspace and project file (working project files containing files to include in project) 301 | *.dsw 302 | *.dsp 303 | 304 | # Visual Studio 6 technical files 305 | *.ncb 306 | *.aps 307 | 308 | # Visual Studio LightSwitch build output 309 | **/*.HTMLClient/GeneratedArtifacts 310 | **/*.DesktopClient/GeneratedArtifacts 311 | **/*.DesktopClient/ModelManifest.xml 312 | **/*.Server/GeneratedArtifacts 313 | **/*.Server/ModelManifest.xml 314 | _Pvt_Extensions 315 | 316 | # Paket dependency manager 317 | .paket/paket.exe 318 | paket-files/ 319 | 320 | # FAKE - F# Make 321 | .fake/ 322 | 323 | # CodeRush personal settings 324 | .cr/personal 325 | 326 | # Python Tools for Visual Studio (PTVS) 327 | __pycache__/ 328 | *.pyc 329 | 330 | # Cake - Uncomment if you are using it 331 | # tools/** 332 | # !tools/packages.config 333 | 334 | # Tabs Studio 335 | *.tss 336 | 337 | # Telerik's JustMock configuration file 338 | *.jmconfig 339 | 340 | # BizTalk build output 341 | *.btp.cs 342 | *.btm.cs 343 | *.odx.cs 344 | *.xsd.cs 345 | 346 | # OpenCover UI analysis results 347 | OpenCover/ 348 | 349 | # Azure Stream Analytics local run output 350 | ASALocalRun/ 351 | 352 | # MSBuild Binary and Structured Log 353 | *.binlog 354 | 355 | # NVidia Nsight GPU debugger configuration file 356 | *.nvuser 357 | 358 | # MFractors (Xamarin productivity tool) working folder 359 | .mfractor/ 360 | 361 | # Local History for Visual Studio 362 | .localhistory/ 363 | 364 | # Visual Studio History (VSHistory) files 365 | .vshistory/ 366 | 367 | # BeatPulse healthcheck temp database 368 | healthchecksdb 369 | 370 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 371 | MigrationBackup/ 372 | 373 | # Ionide (cross platform F# VS Code tools) working folder 374 | .ionide/ 375 | 376 | # Fody - auto-generated XML schema 377 | FodyWeavers.xsd 378 | 379 | # VS Code files for those working on multiple tools 380 | .vscode/* 381 | !.vscode/settings.json 382 | !.vscode/tasks.json 383 | !.vscode/launch.json 384 | !.vscode/extensions.json 385 | *.code-workspace 386 | 387 | # Local History for Visual Studio Code 388 | .history/ 389 | 390 | # Windows Installer files from build outputs 391 | *.cab 392 | *.msi 393 | *.msix 394 | *.msm 395 | *.msp 396 | 397 | # JetBrains Rider 398 | *.sln.iml -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "deps/External"] 2 | path = deps/External 3 | url = https://github.com/shiversoftdev/External.git 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Antoine Willerval 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # t8-custom-ee 2 | A tool to allow EEs in local or custom mutation in Black Ops 4 ([Demo video](https://www.youtube.com/watch?v=zGUf-qEcHMU)) 3 | 4 | Load the zombies mode and press "Inject mod", you can remove the mod using "Reverse mod". (only in the menu otherwise you might crash) 5 | 6 | This mod is using the knowledge of the [t8-compiler by Serious](https://github.com/shiversoftdev/t7-compiler), it replaces the `function_e51dc2d8`'s bytecode to `return true` to enable step EEs even if you are in casual, local or custom mutation. 7 | 8 | This mod is a temp modification knowing the detour API isn't available for Black ops 4 in the t8-compiler. 9 | 10 | ## Known issues 11 | 12 | - leaving the zombies mode in the menu erase the mod, you need to reinject 13 | - the "wheel" of the main EE isn´t visible, for the same reason some UI elements might not be available 14 | -------------------------------------------------------------------------------- /T8CustomEE.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.5.33424.131 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "T8CustomEE", "T8CustomEE\T8CustomEE.csproj", "{7D9A7DA0-D78B-4361-9AB8-85652B712DD1}" 7 | ProjectSection(ProjectDependencies) = postProject 8 | {810BDF68-87BB-45A2-AC4F-87643045BF4C} = {810BDF68-87BB-45A2-AC4F-87643045BF4C} 9 | EndProjectSection 10 | EndProject 11 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "External", "deps\External\External\External.csproj", "{810BDF68-87BB-45A2-AC4F-87643045BF4C}" 12 | EndProject 13 | Global 14 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 15 | Debug|Any CPU = Debug|Any CPU 16 | Debug|x64 = Debug|x64 17 | Debug|x86 = Debug|x86 18 | Development|Any CPU = Development|Any CPU 19 | Development|x64 = Development|x64 20 | Development|x86 = Development|x86 21 | Release|Any CPU = Release|Any CPU 22 | Release|x64 = Release|x64 23 | Release|x86 = Release|x86 24 | EndGlobalSection 25 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 26 | {7D9A7DA0-D78B-4361-9AB8-85652B712DD1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {7D9A7DA0-D78B-4361-9AB8-85652B712DD1}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {7D9A7DA0-D78B-4361-9AB8-85652B712DD1}.Debug|x64.ActiveCfg = Debug|Any CPU 29 | {7D9A7DA0-D78B-4361-9AB8-85652B712DD1}.Debug|x64.Build.0 = Debug|Any CPU 30 | {7D9A7DA0-D78B-4361-9AB8-85652B712DD1}.Debug|x86.ActiveCfg = Debug|Any CPU 31 | {7D9A7DA0-D78B-4361-9AB8-85652B712DD1}.Debug|x86.Build.0 = Debug|Any CPU 32 | {7D9A7DA0-D78B-4361-9AB8-85652B712DD1}.Development|Any CPU.ActiveCfg = Debug|Any CPU 33 | {7D9A7DA0-D78B-4361-9AB8-85652B712DD1}.Development|Any CPU.Build.0 = Debug|Any CPU 34 | {7D9A7DA0-D78B-4361-9AB8-85652B712DD1}.Development|x64.ActiveCfg = Debug|Any CPU 35 | {7D9A7DA0-D78B-4361-9AB8-85652B712DD1}.Development|x64.Build.0 = Debug|Any CPU 36 | {7D9A7DA0-D78B-4361-9AB8-85652B712DD1}.Development|x86.ActiveCfg = Debug|Any CPU 37 | {7D9A7DA0-D78B-4361-9AB8-85652B712DD1}.Development|x86.Build.0 = Debug|Any CPU 38 | {7D9A7DA0-D78B-4361-9AB8-85652B712DD1}.Release|Any CPU.ActiveCfg = Release|Any CPU 39 | {7D9A7DA0-D78B-4361-9AB8-85652B712DD1}.Release|Any CPU.Build.0 = Release|Any CPU 40 | {7D9A7DA0-D78B-4361-9AB8-85652B712DD1}.Release|x64.ActiveCfg = Release|Any CPU 41 | {7D9A7DA0-D78B-4361-9AB8-85652B712DD1}.Release|x64.Build.0 = Release|Any CPU 42 | {7D9A7DA0-D78B-4361-9AB8-85652B712DD1}.Release|x86.ActiveCfg = Release|Any CPU 43 | {7D9A7DA0-D78B-4361-9AB8-85652B712DD1}.Release|x86.Build.0 = Release|Any CPU 44 | {810BDF68-87BB-45A2-AC4F-87643045BF4C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 45 | {810BDF68-87BB-45A2-AC4F-87643045BF4C}.Debug|Any CPU.Build.0 = Debug|Any CPU 46 | {810BDF68-87BB-45A2-AC4F-87643045BF4C}.Debug|x64.ActiveCfg = Debug|x64 47 | {810BDF68-87BB-45A2-AC4F-87643045BF4C}.Debug|x64.Build.0 = Debug|x64 48 | {810BDF68-87BB-45A2-AC4F-87643045BF4C}.Debug|x86.ActiveCfg = Debug|x86 49 | {810BDF68-87BB-45A2-AC4F-87643045BF4C}.Debug|x86.Build.0 = Debug|x86 50 | {810BDF68-87BB-45A2-AC4F-87643045BF4C}.Development|Any CPU.ActiveCfg = Development|Any CPU 51 | {810BDF68-87BB-45A2-AC4F-87643045BF4C}.Development|Any CPU.Build.0 = Development|Any CPU 52 | {810BDF68-87BB-45A2-AC4F-87643045BF4C}.Development|x64.ActiveCfg = Development|x64 53 | {810BDF68-87BB-45A2-AC4F-87643045BF4C}.Development|x64.Build.0 = Development|x64 54 | {810BDF68-87BB-45A2-AC4F-87643045BF4C}.Development|x86.ActiveCfg = Development|x86 55 | {810BDF68-87BB-45A2-AC4F-87643045BF4C}.Development|x86.Build.0 = Development|x86 56 | {810BDF68-87BB-45A2-AC4F-87643045BF4C}.Release|Any CPU.ActiveCfg = Release|Any CPU 57 | {810BDF68-87BB-45A2-AC4F-87643045BF4C}.Release|Any CPU.Build.0 = Release|Any CPU 58 | {810BDF68-87BB-45A2-AC4F-87643045BF4C}.Release|x64.ActiveCfg = Release|x64 59 | {810BDF68-87BB-45A2-AC4F-87643045BF4C}.Release|x64.Build.0 = Release|x64 60 | {810BDF68-87BB-45A2-AC4F-87643045BF4C}.Release|x86.ActiveCfg = Release|x86 61 | {810BDF68-87BB-45A2-AC4F-87643045BF4C}.Release|x86.Build.0 = Release|x86 62 | EndGlobalSection 63 | GlobalSection(SolutionProperties) = preSolution 64 | HideSolutionNode = FALSE 65 | EndGlobalSection 66 | GlobalSection(ExtensibilityGlobals) = postSolution 67 | SolutionGuid = {4196A2D3-B66D-48AE-A9E9-9295554C6EAA} 68 | EndGlobalSection 69 | EndGlobal 70 | -------------------------------------------------------------------------------- /T8CustomEE/Form1.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace T8CustomEE 2 | { 3 | partial class Form1 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | button1 = new Button(); 32 | textBox = new TextBox(); 33 | linkLabel1 = new LinkLabel(); 34 | SuspendLayout(); 35 | // 36 | // button1 37 | // 38 | button1.Location = new Point(12, 12); 39 | button1.Name = "button1"; 40 | button1.Size = new Size(168, 23); 41 | button1.TabIndex = 0; 42 | button1.Text = "Inject mod"; 43 | button1.UseVisualStyleBackColor = true; 44 | button1.Click += button1_Click; 45 | // 46 | // textBox 47 | // 48 | textBox.AcceptsReturn = true; 49 | textBox.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; 50 | textBox.Location = new Point(186, 12); 51 | textBox.Multiline = true; 52 | textBox.Name = "textBox"; 53 | textBox.Size = new Size(300, 174); 54 | textBox.TabIndex = 2; 55 | // 56 | // linkLabel1 57 | // 58 | linkLabel1.Anchor = AnchorStyles.Bottom | AnchorStyles.Left; 59 | linkLabel1.AutoSize = true; 60 | linkLabel1.Location = new Point(12, 207); 61 | linkLabel1.Name = "linkLabel1"; 62 | linkLabel1.Size = new Size(363, 15); 63 | linkLabel1.TabIndex = 3; 64 | linkLabel1.TabStop = true; 65 | linkLabel1.Text = "This work wouldn't have been possible without Serious' t8-compiler"; 66 | linkLabel1.LinkClicked += linkLabel1_LinkClicked; 67 | // 68 | // Form1 69 | // 70 | AutoScaleDimensions = new SizeF(7F, 15F); 71 | AutoScaleMode = AutoScaleMode.Font; 72 | ClientSize = new Size(498, 231); 73 | Controls.Add(linkLabel1); 74 | Controls.Add(textBox); 75 | Controls.Add(button1); 76 | FormBorderStyle = FormBorderStyle.FixedSingle; 77 | MaximizeBox = false; 78 | Name = "Form1"; 79 | Text = "T8CustomEE"; 80 | ResumeLayout(false); 81 | PerformLayout(); 82 | } 83 | 84 | #endregion 85 | 86 | private Button button1; 87 | private TextBox textBox; 88 | private LinkLabel linkLabel1; 89 | } 90 | } -------------------------------------------------------------------------------- /T8CustomEE/Form1.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | 3 | namespace T8CustomEE 4 | { 5 | public partial class Form1 : Form 6 | { 7 | public Form1() 8 | { 9 | InitializeComponent(); 10 | } 11 | 12 | private static bool Injected = false; 13 | private void button1_Click(object sender, EventArgs e) 14 | { 15 | string message = ""; 16 | if (Injected) 17 | { 18 | if (Library.Reverse(ref message)) 19 | { 20 | button1.Text = "Inject mod"; 21 | Injected = false; 22 | } 23 | } 24 | else 25 | { 26 | if (Library.Inject(ref message)) 27 | { 28 | button1.Text = "Reverse mod"; 29 | Injected = true; 30 | } 31 | } 32 | textBox.Lines = message.Split("\n"); 33 | } 34 | 35 | private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 36 | { 37 | var ps = new ProcessStartInfo("https://www.github.com/shiversoftdev/t7-compiler") 38 | { 39 | UseShellExecute = true, 40 | Verb = "open" 41 | }; 42 | Process.Start(ps); 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /T8CustomEE/Form1.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | text/microsoft-resx 50 | 51 | 52 | 2.0 53 | 54 | 55 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 56 | 57 | 58 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 59 | 60 | -------------------------------------------------------------------------------- /T8CustomEE/Library.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Globalization; 5 | using System.Linq; 6 | using System.Runtime.InteropServices; 7 | using System.Security.Policy; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | 11 | namespace T8CustomEE 12 | { 13 | internal class Library 14 | { 15 | internal class ReplaceData 16 | { 17 | internal ulong Script; 18 | internal uint Function; 19 | internal byte[] Data; 20 | internal bool Injected = false; 21 | internal byte[] PreviousInjection = Array.Empty(); 22 | 23 | public ReplaceData(ulong script, uint function, byte[] data) 24 | { 25 | Script = script; 26 | Function = function; 27 | Data = data; 28 | } 29 | } 30 | 31 | internal static int LastPID = 0; 32 | 33 | 34 | internal static ReplaceData[] ReplaceScripts = { 35 | new ReplaceData(T8s64Hash("scripts/zm_common/zm_utility.csc"), 0xe51dc2d8, new byte[]{ 0x0d, 0x00, 0x8a, 0x01, 0x01, 0x00, 0x3c, 0x00 }), 36 | new ReplaceData(T8s64Hash("scripts/zm_common/zm_utility.gsc"), 0xe51dc2d8, new byte[]{ 0x0d, 0x00, 0x8a, 0x01, 0x01, 0x00, 0x3c, 0x00 }) 37 | }; 38 | 39 | public static bool Reverse(ref string Message) 40 | { 41 | ProcessEx bo4 = "blackops4"; 42 | if (bo4 is null) 43 | { 44 | foreach (ReplaceData replacedData in ReplaceScripts) 45 | { 46 | replacedData.Injected = false; 47 | } 48 | Message = "No game process found for Black Ops 4."; 49 | LastPID = 0; 50 | return true; 51 | } 52 | 53 | if (LastPID != bo4.BaseProcess.Id) 54 | { 55 | foreach (ReplaceData replacedData in ReplaceScripts) 56 | { 57 | replacedData.Injected = false; 58 | } 59 | Message = "Not the same Black Ops 4 instance, ignoring."; 60 | return true; 61 | } 62 | 63 | bo4.OpenHandle(); 64 | 65 | try 66 | { 67 | Console.WriteLine($"s_assetPool:ScriptParseTree => {bo4[0x912ABB0]}"); 68 | var sptGlob = bo4.GetValue(bo4[0x912ABB0]); 69 | var sptCount = bo4.GetValue(bo4[0x912ABB0 + 0x14]); 70 | var SPTEntries = bo4.GetArray(sptGlob, sptCount); 71 | 72 | // the script to inject 73 | 74 | int reverted = 0; 75 | 76 | for (int i = 0; i < SPTEntries.Length; i++) 77 | { 78 | var spt = SPTEntries[i]; 79 | 80 | 81 | var vm = bo4.GetValue(spt.Buffer + 0x7); 82 | 83 | if (vm != 0x36) // latest version of BO4 is VM36 84 | { 85 | continue; 86 | } 87 | 88 | foreach (ReplaceData replacedData in ReplaceScripts) 89 | { 90 | if (!replacedData.Injected) 91 | { 92 | continue; // not injected 93 | } 94 | if (replacedData.Script != spt.ScriptName) 95 | { 96 | continue; 97 | } 98 | var exportCount = bo4.GetValue(spt.Buffer + 0x1E); 99 | var exportStart = bo4.GetValue(spt.Buffer + 0x30); 100 | var ExportEntries = bo4.GetArray(spt.Buffer + exportStart, (int)exportCount); 101 | 102 | for (int j = 0; j < ExportEntries.Length; j++) 103 | { 104 | var export = ExportEntries[j]; 105 | 106 | if (!(export.FunctionID == replacedData.Function)) 107 | { 108 | continue; // not our function 109 | } 110 | var ByteCodeAddress = spt.Buffer + export.ByteCodeAddress; 111 | 112 | // we know this thing can contain a return true; 113 | 114 | bo4.SetBytes(ByteCodeAddress, replacedData.PreviousInjection); 115 | replacedData.Injected = false; 116 | 117 | reverted++; 118 | } 119 | } 120 | } 121 | if (reverted == 0) 122 | { 123 | Message = "Nothing to revert"; 124 | return true; 125 | 126 | } 127 | Message = "Reverted " + reverted; 128 | return true; 129 | } 130 | finally 131 | { 132 | bo4.CloseHandle(); 133 | } 134 | } 135 | 136 | 137 | public static bool Inject(ref string Message) 138 | { 139 | ProcessEx bo4 = "blackops4"; 140 | if (bo4 is null) 141 | { 142 | Message = "No game process found for Black Ops 4."; 143 | return false; 144 | } 145 | 146 | foreach (ReplaceData replacedData in ReplaceScripts) 147 | { 148 | replacedData.Injected = false; 149 | } 150 | 151 | LastPID = bo4.BaseProcess.Id; 152 | 153 | bo4.OpenHandle(); 154 | bool closed = false; 155 | 156 | try 157 | { 158 | Console.WriteLine($"s_assetPool:ScriptParseTree => {bo4[0x912ABB0]}"); 159 | var sptGlob = bo4.GetValue(bo4[0x912ABB0]); 160 | var sptCount = bo4.GetValue(bo4[0x912ABB0 + 0x14]); 161 | var SPTEntries = bo4.GetArray(sptGlob, sptCount); 162 | 163 | // the script to inject 164 | 165 | int injected = 0; 166 | 167 | string s = ""; 168 | 169 | for (int i = 0; i < SPTEntries.Length; i++) 170 | { 171 | var spt = SPTEntries[i]; 172 | 173 | 174 | var vm = bo4.GetValue(spt.Buffer + 0x7); 175 | 176 | if (vm != 0x36) // latest version of BO4 is VM36 177 | { 178 | Message = $"found script with unknown VM {vm:x}"; 179 | string Message2 = ""; 180 | if (injected != 0) 181 | { 182 | closed = true; 183 | bo4.CloseHandle(); 184 | 185 | Message += "Reverse: "; 186 | Reverse(ref Message2); 187 | Message += Message2; 188 | } 189 | return false; 190 | } 191 | 192 | foreach (ReplaceData replacedData in ReplaceScripts) 193 | { 194 | if (replacedData.Script != spt.ScriptName) 195 | { 196 | continue; 197 | } 198 | var exportCount = bo4.GetValue(spt.Buffer + 0x1E); 199 | var exportStart = bo4.GetValue(spt.Buffer + 0x30); 200 | var ExportEntries = bo4.GetArray(spt.Buffer + exportStart, (int)exportCount); 201 | 202 | for (int j = 0; j < ExportEntries.Length; j++) 203 | { 204 | var export = ExportEntries[j]; 205 | 206 | if (!(export.FunctionID == replacedData.Function)) 207 | { 208 | continue; // not our function 209 | } 210 | var ByteCodeAddress = spt.Buffer + export.ByteCodeAddress; 211 | s += $"\nfunction_{export.FunctionID:x} Offset: 0x{export.ByteCodeAddress:x} "; 212 | replacedData.PreviousInjection = bo4.GetBytes(ByteCodeAddress, replacedData.Data.Length); 213 | foreach (byte b in replacedData.PreviousInjection) 214 | { 215 | s += $"{b:x2}"; 216 | } 217 | 218 | // we know this thing can contain a return true; 219 | 220 | bo4.SetBytes(ByteCodeAddress, replacedData.Data); 221 | replacedData.Injected = true; 222 | 223 | injected++; 224 | } 225 | } 226 | } 227 | if (injected == 0) 228 | { 229 | Message = "Can't find zm_utility script"; 230 | return false; 231 | 232 | } 233 | Message = "Injected " + injected + " " + s; 234 | return true; 235 | } 236 | finally 237 | { 238 | if (!closed) 239 | { 240 | bo4.CloseHandle(); 241 | } 242 | } 243 | 244 | } 245 | [StructLayout(LayoutKind.Sequential, Pack = 1)] 246 | private struct T8SPT 247 | { 248 | public PointerEx ScriptName; 249 | public long pad0; 250 | public PointerEx Buffer; 251 | public int Size; 252 | public int Unk0; 253 | }; 254 | [StructLayout(LayoutKind.Sequential, Pack = 1)] 255 | private struct T8Export 256 | { 257 | public uint crc32; 258 | public uint ByteCodeAddress; 259 | public uint FunctionID; 260 | public uint Namespace; 261 | public uint Namespace1; 262 | public byte NumParams; 263 | public byte Flags; 264 | public ushort pad; 265 | }; 266 | 267 | public static ulong HashFNV1a(byte[] bytes, ulong fnv64Offset = 14695981039346656037, ulong fnv64Prime = 0x100000001b3) 268 | { 269 | ulong hash = fnv64Offset; 270 | 271 | for (var i = 0; i < bytes.Length; i++) 272 | { 273 | hash = hash ^ bytes[i]; 274 | hash *= fnv64Prime; 275 | } 276 | 277 | return hash; 278 | } 279 | public static ulong T8s64Hash(string input) 280 | { 281 | return 0x7FFFFFFFFFFFFFFF & HashFNV1a(Encoding.ASCII.GetBytes(input.ToLower())); 282 | } 283 | } 284 | } 285 | -------------------------------------------------------------------------------- /T8CustomEE/Program.cs: -------------------------------------------------------------------------------- 1 | namespace T8CustomEE 2 | { 3 | internal static class Program 4 | { 5 | /// 6 | /// The main entry point for the application. 7 | /// 8 | [STAThread] 9 | static void Main() 10 | { 11 | // To customize application configuration such as set high DPI settings or default font, 12 | // see https://aka.ms/applicationconfiguration. 13 | ApplicationConfiguration.Initialize(); 14 | Application.Run(new Form1()); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /T8CustomEE/T8CustomEE.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | WinExe 5 | net6.0-windows 6 | enable 7 | true 8 | enable 9 | 10 | 11 | 12 | 13 | 14 | 15 | --------------------------------------------------------------------------------