rendered paste body.globl main
main:
sub $0x6, %esp
// our signal handler
// -----------------
// pop %ebp
// add $6, %esp
// inc %eax
// ret
mov %esp, %ebx
movb $0x5d, (%ebx)
inc %ebx
movb $0x83, (%ebx)
inc %ebx
movb $0xc4, (%ebx)
inc %ebx
movb $0x06, (%ebx)
inc %ebx
movb $0x40, (%ebx)
inc %ebx
movb $0xc3, (%ebx)
// install signal handler
mov %esp, %ecx
xor %eax, %eax
movb $48, %al
xor %ebx, %ebx
movb $11, %bl
int $0x80
// prepare vars for loop and save ebp for later ret
mov %esp, %ebx
xor %ecx, %ecx
inc %ecx
xor %eax, %eax
sub $4, %esp
push %ebp
// loop until we raise a SIGSEGV
doit:
cmp %cl, %al
je exit
inc %ebx
mov (%ebx), %edx
jmp doit
exit:
xor %eax, %eax
xor %ebx, %ebx
inc %eax
int $0x80