Skip to main content

Module reloc

Module reloc 

Source
Expand description

Per-format relocation listing helpers.

HexSpell does not unify relocation types across PE, ELF, and Mach-O — each format keeps its own entry layout. This module documents the mapping and provides thin filters by RVA/VA or file offset.

FormatSourceAddress fieldTypes
PE.reloc / IMAGE_BASE_RELOCATIONpage RVA + 12-bit offsetIMAGE_REL_BASED_*
PEsection IMAGE_RELOCATIONRVA per entryIMAGE_REL_I386_* / IMAGE_REL_AMD64_*
ELF.rel / .rela sectionsr_offset (VA)arch-specific R_* in r_info
Mach-Osection.reloffsection-relative offsetrelocation_info (not decoded yet)

Structs§

ElfRelocHit
ELF relocation with the owning section index.
PeBaseRelocHit
One PE base relocation targeting a specific RVA.
PeSectionRelocHit
One PE COFF section relocation targeting a specific RVA.

Functions§

elf_relocs_at_file_offset
Lists ELF relocations whose r_offset maps to file_offset via crate::validation::elf_va_to_file_offset.
elf_relocs_at_va
Lists ELF relocations whose r_offset equals va.
pe_base_relocs
Lists every PE base relocation entry (eager directory already parsed on PE).
pe_base_relocs_at_rva
Lists PE base relocations whose patched RVA equals rva.
pe_parse_base_relocations
Re-parses the PE base relocation directory from the image (lazy alternative to PE::base_relocations).
pe_relocs_at_file_offset
Lists PE base relocations whose patched slot maps to file_offset.
pe_section_relocs_at_rva
Lists PE COFF section relocations at rva across all sections.