Log date · Sun
What changes for PE addresses in LIEF 1.0?
LIEF 1.0 changes PE address conversion from RVA to absolute address. Audit callers and establish a regression baseline.
What changes for PE addresses in LIEF 1.0?
Before upgrading, check what your PE addresses mean: LIEF 1.0.0 changes offset_to_virtual_address() from an RVA to an absolute virtual address and adds offset_to_rva(). [2] With 0.17.6, we generated and parsed two PE samples: file offset 0x400 returned 0x1000 in both; adding their different image bases produced 0x140001000 and 0x180001000. An old script that adds the base to the 1.0 absolute result would add it twice.
| Question | Finding |
|---|---|
| What did the older version return? | RVA 0x1000 for both samples. |
| What did changing the base do? | The RVA stayed fixed; base plus RVA changed. |
| What should 1.0 callers check? | Use the absolute address or the new RVA API. |
Release and experiment scope
LIEF 1.0.0 was released on GitHub at 13:55 UTC on 2026-07-12; its changelog is headed “1.0.0 - July 12th, 2026”. [1][2] LIEF parses and modifies formats including ELF, PE and Mach-O, so it may appear in post-build inspection or processing.
Using Python 3.8.20 and LIEF 0.17.6’s PE factory, we generated two synthetic files with one .demo section, wrote them and parsed them again. The variants differ only in image base; we check the section start and a position 16 bytes into it. This is a baseline for the older version, not a test of 1.0, a runnable application, signatures or loader behavior.
Python 3.8.20
LIEF: 0.17.6-08dc3b7f
base=0x140000000 raw=0x400 rva=0x1000
offset=0x400 returned=0x1000 base_plus_returned=0x140001000
offset=0x410 returned=0x1010 base_plus_returned=0x140001010
base=0x180000000 raw=0x400 rva=0x1000
offset=0x400 returned=0x1000 base_plus_returned=0x180001000
offset=0x410 returned=0x1010 base_plus_returned=0x180001010File offset, RVA and virtual address
A file offset identifies a position in the file; an RVA is relative to the image base; here the absolute virtual address is the image base plus the RVA. Our section maps file offset 0x400 to RVA 0x1000, and moving 0x10 bytes gives RVA 0x1010. Do not pass an unlabeled number downstream: a plausible value can belong to a completely different address space.
The release notes explicitly change this PE return value to an absolute address and add offset_to_rva(). [2] If an old caller adds the base itself, remove that addition after upgrading; if the caller needs an RVA, request an RVA explicitly. Distinguish headers, section raw size and virtual size, and establish that an input offset belongs to the expected section before applying a section mapping. The sample formula is not a conversion rule for every offset.
offset=0x400 returned=0x1000 base_plus_returned=0x140001000
offset=0x410 returned=0x1010 base_plus_returned=0x140001010The two bases make mistakes easier to detect: with only one sample, a hardcoded base or an accidental second addition may be hidden by a matching expected value. A real regression set should also include different section layouts and valid offsets near their boundaries.
Other upgrade risks and recommendations
Version 1.0 also adds parse_from_dump() for ELF, Mach-O and PE; Mach-O can select an architecture from FAT, create FAT with FatBinary.create(), and fixes an extra byte written after LC_UNIXTHREAD/LC_THREAD (#1344). The changelog also lists big-endian writing, LC_FUNCTION_VARIANT_FIXUPS, Objective-C categories, Rust minimum 1.85.0 and removal of Python 3.8 support. [2] Memory-dump parsing is a reminder that disk encryption alone does not make runtime logic unobservable.
| Question | Finding |
|---|---|
| Reading PE addresses | Label each output’s address type and add fixed-sample assertions. |
| Writing Mach-O | Compare load commands for each architecture and verify the artifact. |
| Modifying signed artifacts | Sign after the final modification; verify the signature and platform requirements. |
| Using Python 3.8 | Migrate the runtime first, then validate the upgrade. |
These are engineering recommendations, not compatibility or protection gains measured here. Pair structural and byte checks around signing with actual installation, launch and workflow tests; a parseable structure does not establish that an application runs.
Check your own build
First find LIEF calls in build scripts and CI, pin the current version and save a baseline for a representative release artifact. The command below searches common calls; run it from your own project root and also review wrappers and dependency lockfiles. Keep artifacts and internal address output out of public logs.
rg -n 'offset_to_virtual_address|offset_to_rva|lief' .Choose several file offsets within known sections and record raw section offsets, RVAs, image base and old caller output. Write assertions against independently established expectations, upgrade in an isolated environment and compare. Confirm whether each downstream consumer expects an RVA or absolute address; a successful exit alone is insufficient. LIEF’s PE documentation also describes parser configuration, including a rebasing option for memory-loaded data. [3]
Compare structure and signatures before and after modifications, then exercise the release flow on the target platform. Retain tool versions, input hashes, results and matching signature verification records with each build. If an upgrade regression appears, those records help separate address semantics, file writing and later signing steps.
Your checklist
- Find and pin LIEF versions in the pipeline.
- Record RVA, base and expected absolute address for known PE offsets.
- Check whether callers add the image base twice.
- Migrate unsupported Python 3.8 environments.
- Re-sign modified artifacts and verify the release flow.
Primary sources
- GitHub: lief-project/LIEF release 1.0.0 · Source date 2026-07-12 · Checked 2026-10-12
- LIEF documentation: Changelog · Source date 2026-07-12 · Checked 2026-10-12
- LIEF documentation: PE Python API · Checked 2026-11-11