From c1a36ee8e3256ac1bc542444ef5adf7b0a8c6e62 Mon Sep 17 00:00:00 2001 From: Cj <161484149+CJ-SPT@users.noreply.github.com> Date: Sat, 2 Nov 2024 21:30:02 -0400 Subject: [PATCH] Publicize and unseal launcher --- RecodeItLib/Remapper/DeObfuscator.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/RecodeItLib/Remapper/DeObfuscator.cs b/RecodeItLib/Remapper/DeObfuscator.cs index 88e7933..085c66b 100644 --- a/RecodeItLib/Remapper/DeObfuscator.cs +++ b/RecodeItLib/Remapper/DeObfuscator.cs @@ -2,6 +2,7 @@ using dnlib.DotNet.Emit; using ReCodeIt.Utils; using System.Diagnostics; +using ReCodeIt.ReMapper; namespace ReCodeItLib.Remapper; @@ -55,7 +56,7 @@ public static class Deobfuscator Console.WriteLine($"Deobfuscation token: {token}"); var cmd = isLauncher - ? $"--un-name \"!^<>[a-z0-9]$&!^<>[a-z0-9]__.*$&![A-Z][A-Z]\\$<>.*$&^[a-zA-Z_<{{$][a-zA-Z_0-9<>{{}}$.`-]*$\" \"{assemblyPath}\"" + ? $"--un-name \"!^<>[a-z0-9]$&!^<>[a-z0-9]__.*$&![A-Z][A-Z]\\$<>.*$&^[a-zA-Z_<{{$][a-zA-Z_0-9<>{{}}$.`-]*$\" \"{assemblyPath}\" --strtok \"{token}\"" : $"--un-name \"!^<>[a-z0-9]$&!^<>[a-z0-9]__.*$&![A-Z][A-Z]\\$<>.*$&^[a-zA-Z_<{{$][a-zA-Z_0-9<>{{}}$.`-]*$\" \"{assemblyPath}\" --strtyp delegate --strtok \"{token}\""; var process = Process.Start(executablePath, cmd); @@ -72,6 +73,11 @@ public static class Deobfuscator using (var memoryStream = new MemoryStream(File.ReadAllBytes(cleanedDllPath))) { assemblyRewrite = ModuleDefMD.Load(memoryStream, modCtx); + + if (isLauncher) + { + SPTPublicizer.PublicizeClasses(assemblyRewrite); + } } assemblyRewrite.Write(cleanedDllPath);