top | item 44726126

(no title)

etune | 7 months ago

ATOM could inject code before or after any basic block in a program: https://dl.acm.org/doi/abs/10.1145/178243.178260. The general technique, IIRC, was to replace the first instruction of the basic block with a jump to code that contained your new code and then the overwritten instructions, and then jump back into the original code.

discuss

order

dillstead|7 months ago

Yes, I've implemented this technique before at my job. Relocating assembly instructions especially those that contain branching logic can be tricky as the offsets have to be recomputed or a new instruction needs to be used instead. More often that not, you may not have enough space for that new instruction.

nicholasmoser|7 months ago

This is also similar to what is done with video game modification (think Gecko, Game Shark, Game Genie).