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.
| Format | Source | Address field | Types |
|---|---|---|---|
| PE | .reloc / IMAGE_BASE_RELOCATION | page RVA + 12-bit offset | IMAGE_REL_BASED_* |
| PE | section IMAGE_RELOCATION | RVA per entry | IMAGE_REL_I386_* / IMAGE_REL_AMD64_* |
| ELF | .rel / .rela sections | r_offset (VA) | arch-specific R_* in r_info |
| Mach-O | section.reloff | section-relative offset | relocation_info (not decoded yet) |
Structs§
- ElfReloc
Hit - ELF relocation with the owning section index.
- PeBase
Reloc Hit - One PE base relocation targeting a specific RVA.
- PeSection
Reloc Hit - One PE COFF section relocation targeting a specific RVA.
Functions§
- elf_
relocs_ at_ file_ offset - Lists ELF relocations whose
r_offsetmaps tofile_offsetviacrate::validation::elf_va_to_file_offset. - elf_
relocs_ at_ va - Lists ELF relocations whose
r_offsetequalsva. - 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
rvaacross all sections.