Cross-platform C library to read data from PE/PE+ files (the format of Windows .exe and .dll files).
The pedeps C library provides functions to retrieve data from Windows .exe and .dll files.
These files are in either PE (Windows 32-bit) or PE+ (Windows 64-bit) format, which are extensions of the COFF format.
Currently the library allows iterating through:
- exported symbols
- imported symbols from dependency .dll files
The library was written with the following goals in mind:
- written in standard C, but allows being used by C++
- hiding the complexity of the file format
- portable across different platforms (Windows, macOS, *nix)
- no dependencies
The following libraries are provided:
-lpedeps
- requires#include <pedeps.h>
(and optionally#include <pestructs.h>
)
Some command line utilities are included:
listpedeps
- show information and list imported and exported symbolscopypedeps
- copy file(s) to a folder along with all dependency files
The library has no depencancies.
The utilities have the following dependency:
- libavl (only for copypedeps)
- a C compiler like gcc or clang, on Windows MinGW and MinGW-w64 are supported
- a Linux/Unix shell environment (like bash, which is also present on macOS), on Windows MSYS is supported
- the make command
- To build run:
make
- To install run:
make install
- To install to a specific folder run:
make install PREFIX=/usr/local
- Building from source using MSVC is not supported. However, binary downloads are available for Windows (both 32-bit and 64-bit). They include a .def file that can be used to generate the .lib file with the following commands (run from a prompt inside the lib folder of the extracted binary package):
- for Windows 32-bit:
lib /def:pedeps.def /out:pedeps.lib /machine:X86
- for Windows 64-bit:
lib /def:pedeps.def /out:pedeps.lib /machine:X64
- for Windows 32-bit:
pedeps is released under the terms of the MIT License (MIT), see LICENSE.txt.
This means you are free to use pedeps in any of your projects, from open source to commercial.