NtProtectVirtualMemory/PE-Library

GitHub: NtProtectVirtualMemory/PE-Library

一个现代 C++17 编写的 Windows PE 文件解析与操作库,提供简洁接口处理各类 PE 结构。

Stars: 7 | Forks: 0

# Premier PE 库 一个现代 C++ 库,用于解析和操作 Windows 可移植可执行 (PE) 文件。 ## 概述 Premier PE Library 提供了一个简洁的接口来处理 Windows PE 文件格式。该库旨在处理 DOS 头、NT 头、节 (Sections)、数据目录等,专注于简单性和性能。 ## 功能特性 该库目前提供的以下功能将列在下面 ``` - Full PE32 and PE32+ (x86 / x64) parsing support - DOS header, NT headers, optional headers, and section table access - Import and export table enumeration (by name and ordinal) - Relocation table parsing with block and entry detail - TLS directory inspection and callback enumeration - Resource tree parsing with version info and manifest extraction - Rich header parsing with checksum validation and tool identification - RVA, VA, and file offset conversion utilities - Debug directory parsing - Unicode and ASCII String extraction ``` ## 快速开始 ### 前置条件 - Visual Studio 2022 (或更高版本,需支持 C++17) - Windows SDK 10.0 - Platform Toolset v143 或更高版本 ### 基本用法 ``` #include "pe-lib/image.hpp" int main() { PE::Image image("path\to\file.exe"); // Your code here return 0; } ``` ## PE Fuzzer 该 fuzzer 已经处理了 **~150,000** 个不同的 PE 样本,并帮助发现和修复了多个解析边缘情况、缓冲区问题和潜在崩溃以及执行缓慢的单元。 ### 当前状态 - 已处理 **~150k** 个唯一样本。 - 所有发现的崩溃和未定义行为问题已修复。 - 在开发和测试期间积极使用。 ### 基本用法 1. 打开 "x64 Native Tools Command Prompt for VS" 2. cd "path/to/PE-Fuzzer.exe" 3. PE-Fuzzer.exe "path/to/corpus" -jobs=6 -workers=6 -rss_limit_mb=0 -dict="path/to/pe-fuzzer.dict" ## 贡献 我们**接受**的内容: - 错误报告和崩溃复现 (尤其是带有 ASAN 日志) - 解析器鲁棒性改进 / 边缘情况处理 - 性能优化 - 更好的文档 / 代码注释 - Fuzzer 语料库样本、字典条目或变异策略 ### 如何贡献 1. 如果你正在修复错误或添加功能,请**先开启一个 issue** (除非是非常明显的拼写错误/文档修复) 2. Fork 本仓库并从 `main` 创建你的分支 3. 如果可能,添加或扩展测试,这将受到高度赞赏。 4. 确保代码遵循当前风格: - 在能提高可读性/安全性时使用 C++ 特性 - 保持公共 API 简洁和最小化 - 私有成员/函数使用 `snake_case`,公共类型使用 `PascalCase` 5. 创建小型、专注于单一目的的 pull request,并附上清晰的标题和描述 ## 许可证 本项目基于 MIT 许可证授权 - 详情请参阅 [LICENSE](LICENSE.txt) 文件。
标签:C++ 库, DAST, DNS 反向解析, fuzzing, Header 解析, PE32+, PE 文件解析, Rich Header, SecList, TLS, Windows, Windows 开发, x64, x86, 二进制分析, 云安全监控, 云安全运维, 云资产清单, 内存取证, 可执行文件, 导入表, 导出表, 恶意软件分析, 文件格式, 无依赖, 解析器, 资源解析, 逆向工程, 重定位表, 防御工具, 静态分析