|
6 | 6 | using System.Net.Http; |
7 | 7 | using System.Security.Cryptography; |
8 | 8 | using System.Text; |
| 9 | +using System.Text.RegularExpressions; |
9 | 10 | using AssemblyUnhollower; |
10 | 11 | using BepInEx.Configuration; |
11 | 12 | using BepInEx.Logging; |
@@ -64,6 +65,15 @@ internal static class ProxyAssemblyGenerator |
64 | 65 | .AppendLine("{ProcessName} - Name of the current process") |
65 | 66 | .ToString()); |
66 | 67 |
|
| 68 | + private static readonly ConfigEntry<string> ConfigUnhollowerDeobfuscationRegex = ConfigFile.CoreConfig.Bind( |
| 69 | + "IL2CPP", "UnhollowerDeobfuscationRegex", |
| 70 | + string.Empty, |
| 71 | + new StringBuilder() |
| 72 | + .AppendLine("The RegEx string to pass to Il2CppAssemblyUnhollower for renaming obfuscated names.") |
| 73 | + .AppendLine("All types and members matching this RegEx will get a name based on their signature,") |
| 74 | + .AppendLine("resulting in names that persist after game updates.") |
| 75 | + .ToString()); |
| 76 | + |
67 | 77 | private static ManualLogSource Il2cppDumperLogger; |
68 | 78 |
|
69 | 79 | private static string unhollowedBasePath; |
@@ -367,7 +377,8 @@ private void GenerateAssembliesInternal(AppDomainListener listener, |
367 | 377 | Source = sourceAssemblies, |
368 | 378 | OutputDir = Preloader.IL2CPPUnhollowedPath, |
369 | 379 | UnityBaseLibsDir = Directory.Exists(UnityBaseLibsDirectory) ? UnityBaseLibsDirectory : null, |
370 | | - NoCopyUnhollowerLibs = true |
| 380 | + NoCopyUnhollowerLibs = true, |
| 381 | + ObfuscatedNamesRegex = !string.IsNullOrEmpty(ConfigUnhollowerDeobfuscationRegex.Value) ? new Regex(ConfigUnhollowerDeobfuscationRegex.Value) : null |
371 | 382 | }; |
372 | 383 |
|
373 | 384 | var renameMapLocation = Path.Combine(Paths.BepInExRootPath, "DeobfuscationMap.csv.gz"); |
|
0 commit comments