This is the updated PE file manipulation library, taken from RetDec
The original project by Sebastian Porst was further modified by Avast Software to:
- Modify directory structure, i.e. split sources and headers.
- Fix bugs.
- Handle corrupted and exotic PE files.
- Parse additional structures:
- COFF symbol table.
- Delay import directory.
- Rich header.
- Security directory.
A single target named pelib is exposed. It can be used as follows:
target_link_libraries(project-that-needs-pelib pelib)- A compiler supporting C++17
- On Windows, only Microsoft Visual C++ is supported (Visual Studio 2019 or older).
- CMake (version >= 3.6)
- Clone the repository or download the sources into a directory named
pelib.git clone https://github.com/iArtorias/pelib-updated.git
- Linux:
cd pelib-updatedmkdir build && cd buildcmake ..make
- Windows:
- Open
pelib_vs2022.slninVisual Studio 2022(orpelib_vs2019.slninVisual Studio 2019) and build the library or follow the instructions below - Open a command prompt (e.g.
cmd.exe) cd pelib-updatedmkdir build && cd buildcmake .. -G<generator>cmake --build . --config Release -- -m- Alternatively, you can open
pelib.slngenerated bycmake.
- Open
You must pass the following parameters to cmake:
- (Windows only)
-G<generator>is-G"Visual Studio 17 2022" -A Win32for 32-bit build usingVisual Studio 2022, or-G"Visual Studio 17 2022" -A x64for 64-bit build using Visual Studio 2022. Older versions of Visual Studio may be used (Visual Studio 16 2019by usingVisual Studio 2019).
You can pass additional parameters to cmake:
-DCMAKE_BUILD_TYPE=Debugto build with debugging information, which is useful during development. By default, the project is built in theReleasemode. This has no effect on Windows, but the same thing can be achieved by runningcmake --build .with the--config Debugparameter.
The original PeLib modules:
- Copyright (c) 2004 - 2005 Sebastian Porst (webmaster@the-interweb.com), licensed under the zlib/libpng License. See the
ZLIB_LICENSEfile for more details.
Modules added by Avast Software:
- Copyright (c) 2017 - 2020 Avast Software, licensed under the MIT license. See the
MIT_LICENSEfile for more details.