;================================================================================= ; This is test an application for ptrace.asm ; It does nothing except continuously printing "#" to the terminal. ; When ptrace changes value of edi it'll start printing "@". ;================================================================================= format ELF include '../../include/symbols.inc' include '../../include/structs.inc' section '.text' executable public _start _start: xor edi, edi @@: mov eax, SYS_WRITE mov ebx, STDOUT mov ecx, msg_s mov edx, 1 int 0x80 mov [stime+timespec.tv_sec], 4 mov [stime+timespec.tv_nsec], 0 mov eax, SYS_NANOSLEEP mov ebx, stime xor ecx, ecx int 0x80 cmp edi, 0x12345678 jne @b mov [msg_s], "@" jmp @b section '.data' writeable msg_s db "#" msg_s_sz = $-msg_s stime timespec