Remove residual code from unused component

This commit is contained in:
Cj 2024-08-10 07:31:12 -04:00
parent 4bab2015f0
commit cf064e041b

View File

@ -28,10 +28,6 @@ public class ReCodeItRemapper
private string OutPath { get; set; } = string.Empty; private string OutPath { get; set; } = string.Empty;
private bool CrossMapMode { get; set; } = false;
private string AssemblyPath { get; set; }
private List<RemapModel> _remaps = []; private List<RemapModel> _remaps = [];
private List<string> _alreadyGivenNames = []; private List<string> _alreadyGivenNames = [];
@ -43,16 +39,12 @@ public class ReCodeItRemapper
List<RemapModel> remapModels, List<RemapModel> remapModels,
string assemblyPath, string assemblyPath,
string outPath, string outPath,
bool crossMapMode = false,
bool validate = false) bool validate = false)
{ {
_remaps = []; _remaps = [];
_remaps = remapModels; _remaps = remapModels;
Module = DataProvider.LoadModule(assemblyPath); Module = DataProvider.LoadModule(assemblyPath);
AssemblyPath = assemblyPath;
CrossMapMode = crossMapMode;
OutPath = outPath; OutPath = outPath;
if (!Validate(_remaps)) return; if (!Validate(_remaps)) return;
@ -458,11 +450,7 @@ public class ReCodeItRemapper
{ {
var moduleName = Module.Name; var moduleName = Module.Name;
moduleName = CrossMapMode OutPath = Path.Combine(OutPath, moduleName.Replace(".dll", "-Remapped.dll"));
? moduleName
: moduleName.Replace(".dll", "-Remapped.dll");
OutPath = Path.Combine(OutPath, moduleName);
try try
{ {
@ -474,17 +462,23 @@ public class ReCodeItRemapper
throw; throw;
} }
if (!CrossMapMode) Logger.Log("Creating Hollow...", ConsoleColor.Yellow);
Hollow();
var hollowedDir = Path.GetDirectoryName(OutPath);
var hollowedPath = Path.Combine(hollowedDir, "Hollowed.dll");
try
{ {
Logger.Log("Creating Hollow...", ConsoleColor.Yellow);
Hollow();
var hollowedDir = Path.GetDirectoryName(OutPath);
var hollowedPath = Path.Combine(hollowedDir, "Hollowed.dll");
Module.Write(hollowedPath); Module.Write(hollowedPath);
DisplayEndBanner(hollowedPath);
} }
catch (Exception e)
{
Logger.Log(e);
throw;
}
DisplayEndBanner(hollowedPath);
if (DataProvider.Settings.Remapper.MappingPath != string.Empty) if (DataProvider.Settings.Remapper.MappingPath != string.Empty)
{ {