The detour technique is much nicer on ARM64. All the instructions are 4 bytes and you have a `jump immediate` instruction so its possible to jump to the detour code using 1 instruction assuming you have an empty area close by. On X86 the smallest instruction is 1 byte and the detour jump instruction is going to be larger than 1 byte. Having to overwrite the target instruction with multiple instructions is tricky beca…
Well, if you assume “sane”, then you can do whole-function (or basic block) rewriting if the detour would overwrite other reachable instructions. More annoying for sure, but should be doable.