SingleFileExtractor 提取exe程序 netcore库

网址

SingleFileExtractor

简介

可以从单文件的应用程序中将其中包含的内容,包括程序集、配置文件等等,拆解到文件夹 中,方便开发人员进行分析。


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()


作者:spike

分类: Net

创作时间:2025-04-17

更新时间:2025-04-19

联系方式放在中括号之中例如[[email protected]],回复评论在开头加上标号例如:#1