Expand description
Fixed-size PE-overlay trailer (spec R5).
setup.exe is [stub][payload.zip][install.lua][uninstall.lua][manifest][signed_stub]
followed by (optional alignment padding and) this fixed-size trailer. The
runtime locates the trailer at overlay_end − TRAILER_LEN — the overlay end
being the raw EOF for an unsigned file but the Authenticode certificate-table
offset once signed (see pe::overlay_end) — reads these bytes, validates
MAGIC, and then locates every other section from the offset/length table.
Byte layout (little-endian, TRAILER_LEN = 108 bytes):
offset size field
0 8 magic = b"EMBALASU"
8 4 format version (u32) = FORMAT_VERSION
12 6×16 section table: (offset u64, len u64) for
stub, payload.zip, install.lua, uninstall.lua, manifest,
signed_stub (zero-length = none embedded)This is the single source of truth shared by both sides of the overlay: the
package-time writer (embala-setup, which Trailer::to_bytes) and the
install-time runtime (embala-setup-runtime, which Trailer::parse). It
is its own crate — with no dependency on the stubs — so the two never form a
cycle (the runtime cannot depend on embala-setup, which include_bytes!s
the runtime).
Modules§
- pe
- Locate the overlay end relative to the PE, not the raw file EOF.
Structs§
- Manifest
- The manifest embedded in the overlay’s manifest section.
- Package
- Product identity, mirrored from the embala
[package]section. - Section
- A byte range of one overlay section within the
setup.exefile. - Trailer
- Parsed overlay trailer.
stub.lenis the overlay start (spec R5); the uninstaller copies[0..stub.len)as its engine prefix (Phase 3). - Uninstall
Option - One declarative uninstall option (spec R2).
defaultpre-ticks its checkbox.
Enums§
- Trailer
Error - Why a trailer failed to parse.
Constants§
- FORMAT_
VERSION - Overlay format version. Bumped on any incompatible layout change.
- MAGIC
- Trailer magic: “EMBALA SetUp”.
- SECTION_
COUNT - Sections described by the table, in serialized order.
- TRAILER_
LEN - Total trailer size: magic (8) + version (4) + 6 × (offset u64 + len u64).