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
{
2024-11-02 15:58:08 -04:00
[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 ; }
2024-11-02 15:58:08 -04:00
[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..." ) ;
2024-11-02 15:58:08 -04:00
Deobfuscator . Deobfuscate ( AssemblyPath , IsLauncher ) ;
2024-06-22 12:39:10 -04:00
Logger . Log ( "Complete" , ConsoleColor . Green ) ;
2024-06-26 14:45:54 -04:00
// Wait for log termination
Logger . Terminate ( ) ;
while ( Logger . IsRunning ( ) ) { }
2024-06-22 12:39:10 -04:00
return default ;
}
}