pub fn get_elf_segments(
    elf: &ElfFile<'_>,
    elf_base_addr: Option<usize>
) -> Vec<ELFSegment>
Expand description

To parse the elf file and return the segments of the elf file

Arguments

  • elf_data - The elf file data
  • elf_base_addr - The base address of the elf file if the file will be loaded to the memory

Return

Return the entry point, the segments of the elf file and the relocate pairs

Warning

It can’t be used to parse the elf file which need the dynamic linker, but you can do this by calling this function recursively