Inside our inline hooking engine: relocating prologues with iced-x86 (x86-64 + AArch64, deps closed to two crates)

A from-scratch inline hooking and detour engine for x86-64 and AArch64, written in Rust. The dependency list is closed to exactly iced-x86 and thiserror. No frida-gum, no vendored Dobby or shadowhook. The writeup covers the six stages in order: resolve the target address; decode the prologue until at least 5 bytes are covered without splitting an instruction; relocate the moved prologue, where BlockEncoder re-encodes it for its new address; stand up a near-memory trampoline within rel32 reach of the target; flip page protection, RX for the trampoline and RWX briefly for the site; and write the 5-byte jmp rel32 as a single aligned 8-byte store so the patch lands atomically. It also states the
…