SingleFileExtractor
1.0.0
เครื่องมือสำหรับแยกเนื้อหา (แอสเซมบลี การกำหนดค่า ฯลฯ) จากแอปพลิเคชันไฟล์เดียวไปยังไดเร็กทอรี เหมาะสำหรับวัตถุประสงค์เช่นการวิเคราะห์มัลแวร์
หากต้องการใช้เครื่องมือนี้ ให้ติดตั้งเป็นเครื่องมือดอทเน็ตส่วนกลาง:
dotnet tool install -g sfextract
sfextract [file] -o|--output [directory]
แยกไฟล์
sfextract Application.exe -o path/to/output/
รายการไฟล์
การละเว้นไดเร็กทอรีเอาต์พุตจะแสดงรายการไฟล์ทั้งหมดในไฟล์เดียวที่สามารถเรียกใช้งานได้
sfextract Application.exe
ติดตั้งแพ็คเกจ SingleFileExtractor.Core
NuGet เพื่อใช้งานโดยทางโปรแกรม:
var reader = new ExecutableReader("application.exe");
เมื่อคุณต้องการทราบว่าแอสเซมบลีจุดเริ่มต้นคืออะไร คุณสามารถอ่านข้อมูลการเริ่มต้นได้
var reader = new ExecutableReader("application.exe");var startupInfo = reader.StartupInfo;
var reader = new ExecutableReader("application.exe");// ตรวจสอบว่าไฟล์เรียกทำงานเป็นไฟล์เดียวที่เรียกใช้งานได้หรือไม่ และสามารถแตกไฟล์ได้ var isSingleFile = reader.IsSingleFile;if (isSingleFile){// แยกไฟล์เฉพาะ entryawait reader.Manifest.Entries [0].ExtractToFileAsync("example.dll");// หรือสร้างสตรีมในหน่วยความจำของไฟล์ specifc entryvar stream = await reader.Manifest.Entries[0].AsStreamAsync()// แยกไฟล์ทั้งหมดไปยังไดเร็กทอรีรอ reader.ExtractToDirectoryAsync("path/to/output");}
var reader = new ExecutableReader("application.exe");รอ reader.Manifest.Entries[0].ExtractToFileAsync("example.dll");
var reader = new ExecutableReader("application.exe");var stream = รอ reader.Manifest.Entries[0].AsStreamAsync()
แอปพลิเคชันอื่นที่ฉันกำลังดำเนินการอยู่ต้องการให้ฉันแยกเนื้อหาของไฟล์เดียว เนื่องจากฉันเคยเห็นคนถามถึงวิธีการทำเช่นนี้ ฉันจึงตัดสินใจเปลี่ยนมันให้เป็นเครื่องมือดอทเน็ตและแพ็คเกจ NuGet
GitHub: dotnet/runtime สำหรับการประดิษฐ์แอปพลิเคชันไฟล์เดียว
MIT License Copyright (c) 2021 Joery Droppers (https://github.com/Droppers) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.