mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-07-09 02:16:55 +00:00
Somewhat add SFX support
This commit is contained in:
@@ -160,41 +160,17 @@ namespace ExtractionTool
|
||||
if (exe == null)
|
||||
return;
|
||||
|
||||
// TODO: Add Wise installer handling here
|
||||
|
||||
// New Executable
|
||||
if (exe is NewExecutable nex)
|
||||
{
|
||||
// Wise Installer -- Reimplement
|
||||
// var wi = new WiseInstaller();
|
||||
// if (wi.CheckExecutable(file, nex, includeDebug) != null)
|
||||
// wi.Extract(file, nex, outputDirectory, includeDebug);
|
||||
// No-op
|
||||
}
|
||||
|
||||
// Portable Executable
|
||||
else if (exe is PortableExecutable pex)
|
||||
{
|
||||
// CExe, Embedded Archives, Embedded Executables
|
||||
pex.Extract(outputDirectory, includeDebug);
|
||||
|
||||
// 7-zip SFX -- Reimplement
|
||||
// var szsfx = new SevenZipSFX();
|
||||
// if (szsfx.CheckExecutable(file, pex, includeDebug) != null)
|
||||
// szsfx.Extract(file, pex, outputDirectory, includeDebug);
|
||||
|
||||
// WinRAR SFX -- Reimplement
|
||||
// var wrsfx = new WinRARSFX();
|
||||
// if (wrsfx.CheckExecutable(file, pex, includeDebug) != null)
|
||||
// wrsfx.Extract(file, pex, outputDirectory, includeDebug);
|
||||
|
||||
// WinZip SFX -- Reimplement
|
||||
// var wzsfx = new WinZipSFX();
|
||||
// if (wzsfx.CheckExecutable(file, pex, includeDebug) != null)
|
||||
// wzsfx.Extract(file, pex, outputDirectory, includeDebug);
|
||||
|
||||
// Wise Installer -- Reimplement
|
||||
// var wi = new WiseInstaller();
|
||||
// if (wi.CheckExecutable(file, pex, includeDebug) != null)
|
||||
// wi.Extract(file, pex, outputDirectory, includeDebug);
|
||||
}
|
||||
}
|
||||
|
||||
// GCF
|
||||
|
||||
@@ -1100,7 +1100,17 @@ namespace SabreTools.Serialization.Wrappers
|
||||
bool cexe = ExtractCExe(outputDirectory, includeDebug);
|
||||
bool overlay = ExtractFromOverlay(outputDirectory, includeDebug);
|
||||
bool resources = ExtractFromResources(outputDirectory, includeDebug);
|
||||
return cexe || overlay || resources;
|
||||
|
||||
var sevenZipSfx = SevenZip.Create(_dataSource);
|
||||
bool sevenZip = sevenZipSfx?.Extract(outputDirectory, lookForHeader: true, includeDebug) ?? false;
|
||||
|
||||
var pkzipSfx = PKZIP.Create(_dataSource);
|
||||
bool pkzip = pkzipSfx?.Extract(outputDirectory, lookForHeader: true, includeDebug) ?? false;
|
||||
|
||||
var rarSfx = RAR.Create(_dataSource);
|
||||
bool rar = rarSfx?.Extract(outputDirectory, lookForHeader: true, includeDebug) ?? false;
|
||||
|
||||
return cexe || overlay || resources || sevenZip || pkzip || rar;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user