Skip to main content

Module pef

Module pef 

Source
Expand description

Preferred Executable Format (PEF) parsing helpers for PowerPC CFM apps.

This module intentionally stays pure: it parses container metadata, materializes initialized section bytes, and resolves the main transition vector. Relocation application, CFM import binding, and PPC execution are separate loader phases.

Structs§

PefEntryPoint
Main PowerPC transition vector resolved from the loader header.
PefExportedSymbol
One symbol exported by a PEF container.
PefExportedSymbolHashSlot
One 4-byte export hash-table slot.
PefExportedSymbolKey
One 4-byte export hash key.
PefHeader
Parsed 40-byte PEF container header.
PefImportedLibrary
One 24-byte imported-library table entry from the loader section.
PefImportedSymbol
One packed 4-byte imported-symbol table entry.
PefInstantiatedSection
Runtime bytes for one instantiated PEF section.
PefLoaderHeader
Parsed 56-byte loader-section header.
PefRelocContext
Inputs for applying relocation instructions to one instantiated section.
PefRelocFailure
Relocation failure with the interpreter state needed for loader diagnostics.
PefRelocHeader
One 12-byte relocation-header table entry from the loader section.
PefResolvedImport
Name-resolved import table row, preserving the original symbol index.
PefSection
One entry from the PEF section header table.

Enums§

PefRelocApplyError
Reasons the relocation interpreter may refuse a chunk stream.
PefRelocDecodeError
Decode failure for one relocation instruction.
PefRelocOp
One decoded PEF relocation instruction.

Constants§

SECTION_KIND_CODE
SECTION_KIND_CONSTANT
SECTION_KIND_DEBUG
SECTION_KIND_EXECUTABLE_DATA
SECTION_KIND_LOADER
SECTION_KIND_PATTERN_DATA
SECTION_KIND_UNPACKED_DATA

Functions§

apply_pef_relocations
apply_pef_relocations_detailed
data_fork_is_pef
Detect a PEF container in a classic Mac data fork.
decode_pef_reloc
instantiate_pef_section
instantiate_pef_sections
parse_pef_export_hash_keys
Parse the full 32-bit export hash keys from the loader section.
parse_pef_export_hash_slots
Parse the export hash-slot table from the loader section.
parse_pef_exported_symbols
Parse every symbol exported by a PEF container.
parse_pef_header
parse_pef_imported_libraries
parse_pef_imported_symbols
parse_pef_loader_header
parse_pef_reloc_headers
parse_pef_sections
pef_loader_string_at
Read a NUL-terminated MacRoman loader string by string-table offset.
pef_reloc_chunk_stream
resolve_pef_imports
resolve_pef_main_entry
unpack_pef_pattern_data
Unpack one pattern-initialized data section’s initialized bytes.