mirror of
https://github.com/sp-tarkov/assembly-tool.git
synced 2025-02-12 17:10:45 -05:00
Integrate deobfuscation into remap process
This commit is contained in:
parent
4e33f48be0
commit
65041c3e3b
@ -26,6 +26,10 @@
|
||||
<Output TaskParameter="OutputItems" ItemName="OutputPath" />
|
||||
</Target>
|
||||
|
||||
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
||||
<RemoveDir Directories="$(SolutionDir)Build\**\*.*" />
|
||||
</Target>
|
||||
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
<ItemGroup>
|
||||
<de4dot Include="$(SolutionDir)de4dot\$(Configuration)\net48\*.*" />
|
||||
@ -36,8 +40,6 @@
|
||||
<MSBuild Projects="$(AssemblyServerProj)" Properties="Configuration=$(Configuration)" />
|
||||
<MSBuild Projects="$(de4dot-x64Proj)" Properties="Configuration=$(Configuration)" />
|
||||
|
||||
<RemoveDir Directories="$(SolutionDir)Build" />
|
||||
|
||||
<Copy
|
||||
SourceFiles="@(Cli)"
|
||||
DestinationFolder="$(SolutionDir)Build\%(RecursiveDir)"
|
||||
|
@ -7,6 +7,7 @@ using ReCodeIt.Utils;
|
||||
using ReCodeItLib.Remapper.Search;
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
using ReCodeItLib.Remapper;
|
||||
|
||||
namespace ReCodeIt.ReMapper;
|
||||
|
||||
@ -59,11 +60,30 @@ public class ReCodeItRemapper
|
||||
|
||||
if (!types.Any(t => t.Name.Contains("GClass")))
|
||||
{
|
||||
Logger.Log("You must de-obfuscate the assembly before remapping it.\n", ConsoleColor.Red);
|
||||
return;
|
||||
Logger.Log("Assembly is obfuscated, running de-obfuscation...\n", ConsoleColor.Yellow);
|
||||
|
||||
Module.Dispose();
|
||||
Module = null;
|
||||
|
||||
Deobfuscator.Deobfuscate(assemblyPath);
|
||||
|
||||
var cleanedName = Path.GetFileNameWithoutExtension(assemblyPath);
|
||||
cleanedName = $"{cleanedName}-cleaned.dll";
|
||||
|
||||
var newPath = Path.GetDirectoryName(assemblyPath);
|
||||
newPath = Path.Combine(newPath, cleanedName);
|
||||
|
||||
Console.WriteLine($"Cleaning assembly: {newPath}");
|
||||
|
||||
Module = DataProvider.LoadModule(newPath);
|
||||
types = Module.GetTypes();
|
||||
|
||||
GenerateDynamicRemaps(newPath, types);
|
||||
}
|
||||
else
|
||||
{
|
||||
GenerateDynamicRemaps(assemblyPath, types);
|
||||
}
|
||||
|
||||
GenerateDynamicRemaps(assemblyPath, types);
|
||||
|
||||
var tasks = new List<Task>(remapModels.Count);
|
||||
foreach (var remap in remapModels)
|
||||
|
Loading…
x
Reference in New Issue
Block a user