pefile
Python PE parsing module
Decision gist · record as of 2026-08-14
Yes. pefile is a mature, actively maintained, zero-dependency library with a permissive license and no known vulnerabilities. It solves a specific and well-defined problem—PE file parsing—with proven robustness against edge cases and malware-crafted binaries. Install it if you need to analyze or inspect Windows executables programmatically.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction: pure Python wheel with no runtime dependencies.
- Actively maintained with recent commits and a stable release history since 2016.
License · maintenance · safety
MIT (permissive) — MIT license permits unrestricted use, modification, and distribution in both open-source and commercial contexts.
last release 2024-08-26 (718 days) · last repo commit 2026-08-14 · 2,061 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 8,372,690 downloads/mo, #1,629 on PyPI
Alternatives
Verify before relying
import pefile
pe = pefile.PE('/path/to/binary.exe')
print(pe.DOS_HEADER)
print(pe.sections)- Whether the package handles all modern PE variants (e.g., ARM64 executables, signed binaries with complex certificates).
- Performance characteristics when parsing very large PE files or processing many files in sequence.
What it is and what it does
pefile is a pure-Python library for reading and analyzing Portable Executable (PE) files, the binary format underlying Windows executables, DLLs, and system libraries. It exposes PE internal structures—headers, sections, import/export tables, resources—as object attributes with both uppercase names for raw structures and lowercase names for processed elements like the import table. The library is designed to handle real-world edge cases including corrupted, malformed, and malware-obfuscated PE files that may violate the standard format.
The package has no runtime dependencies and installs as a pure Python wheel, making it lightweight and portable. It supports Python 3.6 and later, is actively maintained with recent commits, and has been battle-tested against malware and unusual PE variants since its initial release in 2016.
Use it for
- Analyze Windows executables and DLLs to extract metadata, imports, exports, and resource sections for security or compatibility audits.
- Parse PE files in malware analysis workflows to inspect suspicious binaries for obfuscation, packing, or anomalous structures.
- Automate binary inspection in build pipelines to validate executable structure, detect tampering, or extract version information.
- Reverse-engineer or debug Windows binaries by examining their sections, entry points, and import tables programmatically.
- Inspect PE files in forensic or incident-response contexts to understand binary composition and detect signs of compromise.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
pefile is a mature, actively maintained, zero-dependency library with a permissive license and no known vulnerabilities. It solves a specific and well-defined problem—PE file parsing—with proven robustness against edge cases and malware-crafted binaries. Install it if you need to analyze or inspect Windows executables programmatically.
Install
pefile on PyPI
Before you install
Low friction: pure Python wheel with no runtime dependencies. Actively maintained with recent commits and a stable release history since 2016.
License in practice
MIT license permits unrestricted use, modification, and distribution in both open-source and commercial contexts.
Quickstart
import pefile
pe = pefile.PE('/path/to/binary.exe')
print(pe.DOS_HEADER)
print(pe.sections)
Verify before relying
- Whether the package handles all modern PE variants (e.g., ARM64 executables, signed binaries with complex certificates).
- Performance characteristics when parsing very large PE files or processing many files in sequence.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.6.0 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 718 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 8,372,690 / month, #1,629 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Science/ResearchNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonTopic :: Software Development :: Libraries :: Python Modules |
Evidence: pefile-2024.8.26-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “PE file parser”
- pefilepefile reads and parses Portable Executable (PE) files—the binary…
- liefLIEF parses, modifies, and abstracts binary executable formats (ELF,…
- cleCLE loads binary executables and shared libraries, resolves their…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also cle · pyinstxtractor-ng · dnfile · pex · lief · olefile · dllist · pyxbe · signify · auto-py-to-exe