网址
简介
可以从单文件的应用程序中将其中包含的内容,包括程序集、配置文件等等,拆解到文件夹 中,方便开发人员进行分析。
dotnet tool install -g sfextract
sfextract [file] -o|--output [directory]
sfextract Application.exe -o path/to/output/
sfextract Application.exe
var reader = new ExecutableReader("application.exe");
// Validate if executable is a single file executable, and can be extracted
var isSingleFile = reader.IsSingleFile;
if (isSingleFile)
{
// Extract specific file entry
await reader.Manifest.Entries[0].ExtractToFileAsync("example.dll");
// , or create an in-memory stream of a specifc file entry
var stream = await reader.Manifest.Entries[0].AsStreamAsync()
// Extract all files to a directory
await reader.ExtractToDirectoryAsync("path/to/output");
}
提取内容到文件
var reader = new ExecutableReader("application.exe");
await reader.Manifest.Entries[0].ExtractToFileAsync("example.dll");
提取指定内容到流
var reader = new ExecutableReader("application.exe");
var stream = await reader.Manifest.Entries[0].AsStreamAsync()