Drive by multi-architecture examples of software breakpoint detection :D
; intel x86_64 mov rcx , rsi ; move size argument into rcx for the loop mov rsi , rdi ; move the the text pointer to rsi for printing xor rax , rax ; clear out registers xor rdi , rdi scan: ; scan for breakpoints cmp byte [ rsi ] , 0xCC je fuck_you inc rsi loop scan xor rdi , rdi ret fuck_you: xor rdi , rdi mov al , 1 ret @ ARM scan: .code 32 ldr r3 , = 0xE7F00000 @ load breakpoint constant ldr r4 , = 0xFFFF0000 @ mask loop: ldr r2 , [ r0 ] @ load byte code into r2 and r2 , r4 @ clear out extra data in bytecode with mask cmp r2 , r3 @ is it a breakpoint ? beq fuck @ if so FUCK cmp r1 , # 0 @ are we at the end ? beq safe @ if so we are safe sub r1 , # 1 @ decrement the counter add r0 , # 1 @ increment our pointer bne loop @ if we are still loopi