Crate hooker

Source

Structs§

HookInfo
information required for hooking a fn
RelocatedFnStart
information about relocated instructions from the start of a fn

Enums§

HookError
an error which occured while trying to relocate instructions.
JumperKind
the different kinds of jumper available

Constants§

LONG_JUMPER_LEN
the length of a long jumper.
MAX_JUMPER_LEN
the maximum length of a jumper of any kind.
MAX_MAYBE_RELOCATED_INSN_LEN
the maximum length of an instruction that is either relocated or the original instruction
MAX_RELOCATED_INSNS_AMOUNT
the maximum amount of instructions that we may need to relocate when hooking a fn.
MAX_RELOCATED_INSNS_LEN
the maximum total length of all of the relocated instruction when relocating the instructions at the start of a fn.
MAX_RELOCATED_INSN_LEN
the maximum length of a relocated instruction
MAX_TRAMPOLINE_LEN
the maximum length of a trampoiline.
SHORT_JUMPER_LEN
the length of a short jumper.
SHORT_REL_JUMPER_LEN
the length of a short relative jumper.

Functions§

determine_best_jumper_kind
determines the best jumper kind to use in a specific case.
determine_best_jumper_kind_and_build
determines the best jumper kind to use in a specific case and builds it.
gen_hook_info
generates information needed to hook the given fn.
relocate_fn_start
relocate the instructions at the start of the fn so that we can put them in a different memory address and they will still work fine.

Type Aliases§

JumperBytes
a type alias for the bytes of a jumper.
RelocatedInsnBytes
a type alias for the bytes of a relocated instruction.
RelocatedInsnsBytes
a type alias for the bytes of some relocated instructions.
TrampolineBytes
a type alias for the bytes of a trampoline.