3 ms·
I had a question the article states: >"When the processor executes the int 3 instruction, control is passed to the breakpoint interrupt handler, which – in the
by bogomipz 10y ago
I had a question the article states:
>"When the processor executes the int 3 instruction, control is passed to the breakpoint interrupt handler, which – in the case of Linux – signals the process with a SIGTRAP. You can see this process in the diagram below, where we overwrite the first byte of the mov instruction with 0xcc,"
0xCC is not 3 in decimal however it is 204. AM I missing something or is the actual number 3 obscured in the encoding somewhere?
- detaro 10y ago0xCC is a special opcode for the assembly instruction "INT 3" (trigger interrupt number 3), for exactly this use case of providing an 1-byte opcode for debuggers. The general encoding for "INT <X>" is 0xCD <X>
- bogomipz 10y agoThanks, that makes perfect sense, I don't know why I was thinking as a literal value. Cheers.