mirror of
https://github.com/sp-tarkov/assembly-tool.git
synced 2025-02-13 02:50:45 -05:00
Use de4dot directly, remove now unused de4dot component
This commit is contained in:
parent
ccdd2099f9
commit
9939f5ad35
@ -10,7 +10,6 @@
|
|||||||
|
|
||||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||||
<Exec Command="xcopy "$(SolutionDir)/Assets/Templates" "$(TargetDir)Data" /E /I /Y" />
|
<Exec Command="xcopy "$(SolutionDir)/Assets/Templates" "$(TargetDir)Data" /E /I /Y" />
|
||||||
<Exec Command="xcopy "$(SolutionDir)/Assets/de4dot" "$(TargetDir)Data/de4dot" /E /I /Y" />
|
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
22
RecodeIt.sln
22
RecodeIt.sln
@ -11,8 +11,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReCodeItCLI", "ReCodeItCLI\
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DumpLib", "DumpLib\DumpLib.csproj", "{D0837899-F129-46DB-8BDB-7C9AFB72BD30}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DumpLib", "DumpLib\DumpLib.csproj", "{D0837899-F129-46DB-8BDB-7C9AFB72BD30}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "de4dot-x64", "de4dot\de4dot-x64\de4dot-x64.csproj", "{143623B9-F5AE-4DF6-95BB-12DAE42DC669}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "de4dot.mdecrypt", "de4dot\de4dot.mdecrypt\de4dot.mdecrypt.csproj", "{7C68B124-809B-4D4A-960B-467B2DAF2A0A}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "de4dot.mdecrypt", "de4dot\de4dot.mdecrypt\de4dot.mdecrypt.csproj", "{7C68B124-809B-4D4A-960B-467B2DAF2A0A}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "de4dot.cui", "de4dot\de4dot.cui\de4dot.cui.csproj", "{2BCD50E1-77D5-47E3-B317-04568BF051AB}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "de4dot.cui", "de4dot\de4dot.cui\de4dot.cui.csproj", "{2BCD50E1-77D5-47E3-B317-04568BF051AB}"
|
||||||
@ -119,26 +117,6 @@ Global
|
|||||||
{D0837899-F129-46DB-8BDB-7C9AFB72BD30}.Release|x64.Build.0 = Release|Any CPU
|
{D0837899-F129-46DB-8BDB-7C9AFB72BD30}.Release|x64.Build.0 = Release|Any CPU
|
||||||
{D0837899-F129-46DB-8BDB-7C9AFB72BD30}.Release|x86.ActiveCfg = Release|Any CPU
|
{D0837899-F129-46DB-8BDB-7C9AFB72BD30}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
{D0837899-F129-46DB-8BDB-7C9AFB72BD30}.Release|x86.Build.0 = Release|Any CPU
|
{D0837899-F129-46DB-8BDB-7C9AFB72BD30}.Release|x86.Build.0 = Release|Any CPU
|
||||||
{143623B9-F5AE-4DF6-95BB-12DAE42DC669}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{143623B9-F5AE-4DF6-95BB-12DAE42DC669}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{143623B9-F5AE-4DF6-95BB-12DAE42DC669}.Debug|ARM.ActiveCfg = Debug|Any CPU
|
|
||||||
{143623B9-F5AE-4DF6-95BB-12DAE42DC669}.Debug|ARM.Build.0 = Debug|Any CPU
|
|
||||||
{143623B9-F5AE-4DF6-95BB-12DAE42DC669}.Debug|ARM64.ActiveCfg = Debug|Any CPU
|
|
||||||
{143623B9-F5AE-4DF6-95BB-12DAE42DC669}.Debug|ARM64.Build.0 = Debug|Any CPU
|
|
||||||
{143623B9-F5AE-4DF6-95BB-12DAE42DC669}.Debug|x64.ActiveCfg = Debug|Any CPU
|
|
||||||
{143623B9-F5AE-4DF6-95BB-12DAE42DC669}.Debug|x64.Build.0 = Debug|Any CPU
|
|
||||||
{143623B9-F5AE-4DF6-95BB-12DAE42DC669}.Debug|x86.ActiveCfg = Debug|Any CPU
|
|
||||||
{143623B9-F5AE-4DF6-95BB-12DAE42DC669}.Debug|x86.Build.0 = Debug|Any CPU
|
|
||||||
{143623B9-F5AE-4DF6-95BB-12DAE42DC669}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{143623B9-F5AE-4DF6-95BB-12DAE42DC669}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{143623B9-F5AE-4DF6-95BB-12DAE42DC669}.Release|ARM.ActiveCfg = Release|Any CPU
|
|
||||||
{143623B9-F5AE-4DF6-95BB-12DAE42DC669}.Release|ARM.Build.0 = Release|Any CPU
|
|
||||||
{143623B9-F5AE-4DF6-95BB-12DAE42DC669}.Release|ARM64.ActiveCfg = Release|Any CPU
|
|
||||||
{143623B9-F5AE-4DF6-95BB-12DAE42DC669}.Release|ARM64.Build.0 = Release|Any CPU
|
|
||||||
{143623B9-F5AE-4DF6-95BB-12DAE42DC669}.Release|x64.ActiveCfg = Release|Any CPU
|
|
||||||
{143623B9-F5AE-4DF6-95BB-12DAE42DC669}.Release|x64.Build.0 = Release|Any CPU
|
|
||||||
{143623B9-F5AE-4DF6-95BB-12DAE42DC669}.Release|x86.ActiveCfg = Release|Any CPU
|
|
||||||
{143623B9-F5AE-4DF6-95BB-12DAE42DC669}.Release|x86.Build.0 = Release|Any CPU
|
|
||||||
{7C68B124-809B-4D4A-960B-467B2DAF2A0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{7C68B124-809B-4D4A-960B-467B2DAF2A0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{7C68B124-809B-4D4A-960B-467B2DAF2A0A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{7C68B124-809B-4D4A-960B-467B2DAF2A0A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{7C68B124-809B-4D4A-960B-467B2DAF2A0A}.Debug|ARM.ActiveCfg = Debug|Any CPU
|
{7C68B124-809B-4D4A-960B-467B2DAF2A0A}.Debug|ARM.ActiveCfg = Debug|Any CPU
|
||||||
|
@ -176,6 +176,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\de4dot\de4dot.cui\de4dot.cui.csproj" />
|
||||||
<ProjectReference Include="..\DumpLib\DumpLib.csproj" />
|
<ProjectReference Include="..\DumpLib\DumpLib.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -34,7 +34,8 @@ public static class Deobfuscator
|
|||||||
|
|
||||||
if (!method.Body.Instructions.Any(x =>
|
if (!method.Body.Instructions.Any(x =>
|
||||||
x.OpCode.Code == Code.Callvirt &&
|
x.OpCode.Code == Code.Callvirt &&
|
||||||
((IMethodDefOrRef)x.Operand).FullName == "System.Object System.AppDomain::GetData(System.String)"))
|
((IMethodDefOrRef)x.Operand).FullName ==
|
||||||
|
"System.Object System.AppDomain::GetData(System.String)"))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -45,7 +46,8 @@ public static class Deobfuscator
|
|||||||
|
|
||||||
if (potentialStringDelegates.Count != 1)
|
if (potentialStringDelegates.Count != 1)
|
||||||
{
|
{
|
||||||
Logger.Log($"Expected to find 1 potential string delegate method; found {potentialStringDelegates.Count}. Candidates: {string.Join("\r\n", potentialStringDelegates.Select(x => x.FullName))}");
|
Logger.Log(
|
||||||
|
$"Expected to find 1 potential string delegate method; found {potentialStringDelegates.Count}. Candidates: {string.Join("\r\n", potentialStringDelegates.Select(x => x.FullName))}");
|
||||||
}
|
}
|
||||||
|
|
||||||
var methodDef = potentialStringDelegates[0];
|
var methodDef = potentialStringDelegates[0];
|
||||||
@ -55,13 +57,25 @@ public static class Deobfuscator
|
|||||||
token = $"0x{(deobfRid.Raw | deobfRid.Rid):x4}";
|
token = $"0x{(deobfRid.Raw | deobfRid.Rid):x4}";
|
||||||
Console.WriteLine($"Deobfuscation token: {token}");
|
Console.WriteLine($"Deobfuscation token: {token}");
|
||||||
|
|
||||||
var cmd = isLauncher
|
string[] dllArgs = [
|
||||||
? $"--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",
|
||||||
: $"--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}\"";
|
"!^<>[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);
|
string[] launcherArgs = [
|
||||||
|
"--un-name",
|
||||||
|
"!^<>[a-z0-9]$&!^<>[a-z0-9]__.*$&![A-Z][A-Z]\\$<>.*$&^[a-zA-Z_<{{$][a-zA-Z_0-9<>{{}}$.`-]*",
|
||||||
|
assemblyPath,
|
||||||
|
"--strtok",
|
||||||
|
$"\"{token}\""
|
||||||
|
];
|
||||||
|
|
||||||
process.WaitForExit();
|
de4dot.cui.Program.Main(isLauncher ? launcherArgs : dllArgs);
|
||||||
|
|
||||||
var extName = isLauncher ? "-cleaned.exe" : "-cleaned.dll";
|
var extName = isLauncher ? "-cleaned.exe" : "-cleaned.dll";
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user