From 6c03bf1dbbf60184f69a56832dd3103025270c11 Mon Sep 17 00:00:00 2001 From: Bepis <36346617+bbepis@users.noreply.github.com> Date: Thu, 23 Dec 2021 06:24:59 +1100 Subject: [PATCH] Fix deobfuscation string method tokens --- SPT-AssemblyTool/Deobfuscator.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/SPT-AssemblyTool/Deobfuscator.cs b/SPT-AssemblyTool/Deobfuscator.cs index 8e20c20..14cff04 100644 --- a/SPT-AssemblyTool/Deobfuscator.cs +++ b/SPT-AssemblyTool/Deobfuscator.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; @@ -51,7 +52,11 @@ namespace SPT_AssemblyTool Program.WriteError($"Expected to find 1 potential string delegate method; found {potentialStringDelegates.Count}. Candidates: {string.Join("\r\n", potentialStringDelegates.Select(x => x.FullName))}"); } - token = potentialStringDelegates[0].MetadataToken.ToString(); + var deobfRid = potentialStringDelegates[0].MetadataToken; + + token = $"0x{((uint)deobfRid.TokenType | deobfRid.RID):x4}"; + + Console.WriteLine($"Deobfuscation token: {token}"); } var process = Process.Start(de4dotLocation,