{"id":13419320,"url":"https://github.com/trailofbits/pe-parse","last_synced_at":"2025-05-14T09:07:00.622Z","repository":{"id":11941639,"uuid":"14511434","full_name":"trailofbits/pe-parse","owner":"trailofbits","description":"Principled, lightweight C/C++ PE parser","archived":false,"fork":false,"pushed_at":"2024-11-27T20:29:07.000Z","size":713,"stargazers_count":836,"open_issues_count":19,"forks_count":161,"subscribers_count":75,"default_branch":"master","last_synced_at":"2025-05-12T05:54:16.703Z","etag":null,"topics":["hacktoberfest","pe-format","portable-executable"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trailofbits.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-11-19T02:10:17.000Z","updated_at":"2025-05-12T02:47:24.000Z","dependencies_parsed_at":"2023-02-19T04:20:17.859Z","dependency_job_id":"958284f1-b4e0-46c1-ac4b-411d88201305","html_url":"https://github.com/trailofbits/pe-parse","commit_stats":{"total_commits":267,"total_committers":41,"mean_commits":6.512195121951219,"dds":0.7752808988764045,"last_synced_commit":"31ac5966503689d5693cd9fb520bd525a8710e17"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trailofbits%2Fpe-parse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trailofbits%2Fpe-parse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trailofbits%2Fpe-parse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trailofbits%2Fpe-parse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trailofbits","download_url":"https://codeload.github.com/trailofbits/pe-parse/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253685207,"owners_count":21947304,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest","pe-format","portable-executable"],"created_at":"2024-07-30T22:01:14.324Z","updated_at":"2025-05-14T09:07:00.603Z","avatar_url":"https://github.com/trailofbits.png","language":"C++","funding_links":[],"categories":["TODO scan for Android support in followings","\u003ca id=\"620af0d32e6ac1f4a3e97385d4d3efc0\"\u003e\u003c/a\u003ePE"],"sub_categories":["\u003ca id=\"574db8bbaafbee72eeb30e28e2799458\"\u003e\u003c/a\u003e工具"],"readme":"# pe-parse\n\n[![CI](https://github.com/trailofbits/pe-parse/actions/workflows/ci.yml/badge.svg)](https://github.com/trailofbits/pe-parse/actions/workflows/ci.yml)\n\npe-parse is a principled, lightweight parser for Windows portable executable files.\nIt was created to assist in compiled program analysis, potentially of programs of unknown origins.\nThis means that it should be resistant to malformed or maliciously crafted PE files, and it should\nsupport questions that analysis software would ask of an executable program container.\nFor example, listing relocations, describing imports and exports, and supporting byte reads from\nvirtual addresses as well as file offsets.\n\npe-parse supports these use cases via a minimal API that provides methods for\n * Opening and closing a PE file\n * Iterating over the imported functions\n * Iterating over the relocations\n * Iterating over the exported functions\n * Iterating over sections\n * Iterating over resources\n * Reading bytes from specified virtual addresses\n * Retrieving the program entry point\n\nThe interface is defined in `parser-library/parse.h`.\n\nThe program in `dump-pe/main.cpp` is an example of using the parser-library API to dump\ninformation about a PE file.\n\nInternally, the parser-library uses a bounded buffer abstraction to access information stored in\nthe PE file. This should help in constructing a sane parser that allows for detection of the use\nof bogus values in the PE that would result in out of bounds accesses of the input buffer.\nOnce data is read from the file it is sanitized and placed in C++ STL containers of internal types.\n\n\u003e [!WARNING]\n\u003e pe-parse's error handling is not thread safe. If you want to perform PE\n\u003e writes/parses in multiple threads, you **must** independently synchronize\n\u003e your operations.\n\n## Installation\n\npe-parse can be installed via [vcpkg](https://github.com/microsoft/vcpkg):\n\n```bash\n$ vcpkg install pe-parse\n```\n\npe-parse includes Python bindings via `pepy`, which can be installed via `pip`:\n\n```bash\n$ pip3 install pepy\n```\n\nMore information about `pepy` can be found in its [README](./pepy/README.md).\n\n## Dependencies\n\n### CMake\n  * Debian/Ubuntu: `sudo apt-get install cmake`\n  * RedHat/Fedora: `sudo yum install cmake`\n  * OSX: `brew install cmake`\n  * Windows: Download the installer from the [CMake page](https://cmake.org/download/)\n\n## Building\n\n### Generic instructions\n\n```\ngit clone https://github.com/trailofbits/pe-parse.git\ncd pe-parse\n\nmkdir build\ncd build\n\ncmake -DCMAKE_BUILD_TYPE=Release ..\ncmake --build .\n\n# optional\ncmake --build . --target install\n```\n\n### Windows-specific\n\nVS 2017 and VS 2019 are supported.\n\n```\n# Compile 64-bit binaries with Visual Studio 2017\ncmake -G \"Visual Studio 15 2017 Win64\" ..\n\n# Or, with VS 2019, use the -A flag for architecture\ncmake -G \"Visual Studio 16 2019\" -A Win64 ..\n\n# Pass the build type at build time\ncmake --build . --config Release\n```\n\n## Testing\n\nYou can build the (catch2-based) tests by adding `-DPEPARSE_ENABLE_TESTING=ON` during CMake configuration. Build, and then run with `ctest` or `cmake --build . --target test`.\n\nTo run the full test suite with the [Corkami test suite](https://github.com/corkami/pocs/tree/master/PE), you must clone the submodule with `git submodule update --init`.\n\n## Examples\n\nYou can build the included examples by adding `-DPEPARSE_ENABLE_EXAMPLES=ON` during CMake configuration.\n\n## Building with Sanitizers\n\nIf you are familiar with C++ sanitizers and any specific development environment requirements for them (compiler, instrumented standard library, etc.), you can choose to compile with any of the following sanitizers: `Address`, `HWAddress`, `Undefined`, `Memory`, `MemoryWithOrigins`, `Leak`, `Address,Undefined`.\n\nFor example, to compile with both `Address` and `Undefined` sanitizers, use the following (recommended for development and testing, and tested in CI):\n\n```bash\nmkdir build-san\ncd build-san\n\ncmake -DCMAKE_BUILD_TYPE=Debug -DPEPARSE_ENABLE_TESTING=ON -DPEPARSE_USE_SANITIZER=Address,Undefined ..\ncmake --build .\n```\n\n## Using the library\n\nOnce the library is installed, linking to it is easy! Add the following lines in your CMake project:\n\n```\nfind_package(pe-parse REQUIRED)\n\ntarget_link_libraries(your_target_name PRIVATE pe-parse::pe-parse)\n```\n\nYou can see a full example in the [examples/peaddrconv](examples/peaddrconv) folder.\n\n## Authors\n\npe-parse was designed and implemented by [Andrew Ruef](https://github.com/awruef),\nwith significant contributions from [Wesley Shields](https://github.com/wxsBSD).\n\npe-parse is currently maintained by [Eric Kilmer](https://github.com/ekilmer)\nand [William Woodruff](https://github.com/woodruffw).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrailofbits%2Fpe-parse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrailofbits%2Fpe-parse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrailofbits%2Fpe-parse/lists"}