jon.recoil.org

Module Iplt

Intermediate PLT (Procedure Linkage Table) for the dissector.

The intermediate PLT provides local PLT entries that are within range of PC-relative call/jump instructions from the code in a partition. Each entry contains a jump instruction through the corresponding IGOT entry.

Each PLT entry is 8 bytes:

The 4-byte displacement at offset +2 is filled by a PC32 relocation pointing to the corresponding IGOT entry.

val entry_size : int

Size of each IPLT entry in bytes.

module Entry : sig ... end

An entry in the intermediate PLT.

type t

A built intermediate PLT section.

val build : prefix:string -> igot:Igot.t -> symbols:string list -> Iplt.t

build ~prefix ~igot symbols builds an intermediate PLT from a list of symbols that need PLT entries.

Each PLT entry requires a corresponding IGOT entry, which must exist in the provided igot.

  • parameter prefix

    A unique prefix for this partition (e.g., "0", "1")

  • parameter igot

    The intermediate GOT (must contain entries for all symbols)

  • parameter symbols

    List of original symbol names needing PLT entries

val entries : Iplt.t -> Iplt.Entry.t list

Returns the list of entries in the IPLT.

val section_data : Iplt.t -> bytes

Returns the section data (machine code).

val section_size : Iplt.t -> int

Returns the size of the section in bytes.

val find_entry : Iplt.t -> symbol:string -> Iplt.Entry.t option

find_entry t ~symbol returns the entry for symbol, or None if not found.

val iplt_symbol_name : prefix:string -> symbol:string -> string

iplt_symbol_name ~prefix ~symbol returns the IPLT symbol name for the given original symbol.

module Relocation : sig ... end

A relocation for an IPLT entry.

val relocations : Iplt.t -> Iplt.Relocation.t list

relocations t returns the list of R_X86_64_PC32 relocations needed to fill the IPLT entries with displacements to their IGOT entries.