35 lines
1.1 KiB
C#
Raw Normal View History

2024-06-22 12:39:10 -04:00
using CliFx;
using CliFx.Attributes;
using CliFx.Infrastructure;
using ReCodeIt.Utils;
using ReCodeItLib.Remapper;
namespace ReCodeIt.Commands;
[Command("DeObfuscate", Description = "Generates a de-obfuscated -cleaned dll in the folder your assembly is in")]
public class DeObfuscate : ICommand
{
[CommandParameter(0, IsRequired = true, Description = "The absolute path to your obfuscated assembly or exe file, folder must contain all references to be resolved.")]
2024-06-22 12:39:10 -04:00
public string AssemblyPath { get; init; }
[CommandParameter(1, IsRequired = false, Description = "Is the target the EFT launcher?")]
public bool IsLauncher { get; init; } = false;
2024-06-22 12:39:10 -04:00
public ValueTask ExecuteAsync(IConsole console)
{
DataProvider.IsCli = true;
2024-06-22 14:40:04 -04:00
DataProvider.LoadAppSettings();
2024-06-22 12:39:10 -04:00
Logger.Log("Deobfuscating assembly...");
Deobfuscator.Deobfuscate(AssemblyPath, IsLauncher);
2024-06-22 12:39:10 -04:00
Logger.Log("Complete", ConsoleColor.Green);
// Wait for log termination
Logger.Terminate();
while(Logger.IsRunning()) {}
2024-06-22 12:39:10 -04:00
return default;
}
}