{"id":23033867,"url":"https://github.com/alex94cp/peplus","last_synced_at":"2025-08-14T15:33:09.880Z","repository":{"id":94942228,"uuid":"134640151","full_name":"alex94cp/peplus","owner":"alex94cp","description":"A cross-platform header-only PE parser library for C++17","archived":false,"fork":false,"pushed_at":"2018-07-27T07:59:58.000Z","size":45,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-10-20T16:23:14.900Z","etag":null,"topics":["cpp17","cross-platform","header-only","portable-executable"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alex94cp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-05-24T00:30:48.000Z","updated_at":"2023-01-08T00:30:45.000Z","dependencies_parsed_at":"2023-06-11T04:45:22.999Z","dependency_job_id":null,"html_url":"https://github.com/alex94cp/peplus","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex94cp%2Fpeplus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex94cp%2Fpeplus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex94cp%2Fpeplus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex94cp%2Fpeplus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alex94cp","download_url":"https://codeload.github.com/alex94cp/peplus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229841530,"owners_count":18132574,"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":["cpp17","cross-platform","header-only","portable-executable"],"created_at":"2024-12-15T16:19:46.966Z","updated_at":"2024-12-15T16:19:47.416Z","avatar_url":"https://github.com/alex94cp.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PEPlus\n\nA cross-platform header-only PE parser library for C++17\n\n## Motivation\n\nFrom developer tools to antivirus software, a lot of programs need to extract some information from PE files (including executables and dynamic link libraries). Although there are some existing solutions for that (such as [pefile](https://github.com/erocarrera/pefile) for python), there isn't a clear winner when it comes to C++.\n\nPEPlus is an attempt to make PE parsing simple in C++. It takes advantage of new features present in C++17 (such as user-defined literals and range-based for-loops) so that the code you write is both expressive and easy to read.\n\n## Features\n\n* Native\n* Easy to use\n* Open-source\n* Header-only\n* Cross-platform\n* Actively maintained\n* PE/PE+ format support\n\n## Usage\n\nThese are all the include files you need to know about:\n\n```cpp\n#include \u003cpeplus/local_buffer.hpp\u003e  // Local memory buffer classes\n#include \u003cpeplus/any_buffer.hpp\u003e    // Type-erasing buffer interface\n\n#include \u003cpeplus/file_image.hpp\u003e    // PE file image parser class\n#include \u003cpeplus/virtual_image.hpp\u003e // Loaded PE image parser class\n```\n\nCreating a parser instance is simple:\n\n```cpp\nusing namespace peplus;\n\nconst char image_data[] = { /* your image data here */ };\n\nFileImage64\u003clocal_buffer\u003e image { image_data };\n```\n\nThis is how you access the optional header:\n\n```cpp\nconst auto opt_header = image.optional_header();\n// Bonus tip: use opt_header.offset() to get its location\n```\n\nAccessing the export directory and looking up an export symbol:\n\n```cpp\nif (const auto export_dir = image.export_directory()) {\n\tif (const auto export_info = export_dir-\u003efind(\"GetProcAddress\")) {\n\t\t// export_info-\u003eaddress contains GetProcAddress location\n\t}\n}\n```\n\nEnumerating your image dependencies:\n\n```cpp\nfor (const auto import_dtor : image.import_descriptors()) {\n\t// import_dtor.name_str() returns imported module name\n}\n```\n\nEnumerating your image resources:\n\n```cpp\nif (const auto resource_dir = image.resource_directory()) {\n\tfor (const auto res_entry : resource_dir-\u003eentries()) {\n\t\t// do something with each resource entry\n\t}\n}\n```\n\nReading data from your image is simple too:\n\n```cpp\nusing namespace peplus::literals::offset_literals;\n\nchar buffer[3] = {};\nimage.read(0_rva, 2, buffer); // now buffer equals \"MZ\"\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falex94cp%2Fpeplus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falex94cp%2Fpeplus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falex94cp%2Fpeplus/lists"}