mirror of
https://github.com/sp-tarkov/assembly-tool.git
synced 2025-02-13 03: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" />
|
<Output TaskParameter="OutputItems" ItemName="OutputPath" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
|
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
||||||
|
<RemoveDir Directories="$(SolutionDir)Build\**\*.*" />
|
||||||
|
</Target>
|
||||||
|
|
||||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<de4dot Include="$(SolutionDir)de4dot\$(Configuration)\net48\*.*" />
|
<de4dot Include="$(SolutionDir)de4dot\$(Configuration)\net48\*.*" />
|
||||||
@ -36,8 +40,6 @@
|
|||||||
<MSBuild Projects="$(AssemblyServerProj)" Properties="Configuration=$(Configuration)" />
|
<MSBuild Projects="$(AssemblyServerProj)" Properties="Configuration=$(Configuration)" />
|
||||||
<MSBuild Projects="$(de4dot-x64Proj)" Properties="Configuration=$(Configuration)" />
|
<MSBuild Projects="$(de4dot-x64Proj)" Properties="Configuration=$(Configuration)" />
|
||||||
|
|
||||||
<RemoveDir Directories="$(SolutionDir)Build" />
|
|
||||||
|
|
||||||
<Copy
|
<Copy
|
||||||
SourceFiles="@(Cli)"
|
SourceFiles="@(Cli)"
|
||||||
DestinationFolder="$(SolutionDir)Build\%(RecursiveDir)"
|
DestinationFolder="$(SolutionDir)Build\%(RecursiveDir)"
|
||||||
|
@ -7,6 +7,7 @@ using ReCodeIt.Utils;
|
|||||||
using ReCodeItLib.Remapper.Search;
|
using ReCodeItLib.Remapper.Search;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using ReCodeItLib.Remapper;
|
||||||
|
|
||||||
namespace ReCodeIt.ReMapper;
|
namespace ReCodeIt.ReMapper;
|
||||||
|
|
||||||
@ -59,11 +60,30 @@ public class ReCodeItRemapper
|
|||||||
|
|
||||||
if (!types.Any(t => t.Name.Contains("GClass")))
|
if (!types.Any(t => t.Name.Contains("GClass")))
|
||||||
{
|
{
|
||||||
Logger.Log("You must de-obfuscate the assembly before remapping it.\n", ConsoleColor.Red);
|
Logger.Log("Assembly is obfuscated, running de-obfuscation...\n", ConsoleColor.Yellow);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
GenerateDynamicRemaps(assemblyPath, types);
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
var tasks = new List<Task>(remapModels.Count);
|
var tasks = new List<Task>(remapModels.Count);
|
||||||
foreach (var remap in remapModels)
|
foreach (var remap in remapModels)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user