All pastes #629093 Raw Edit

Stuff

public text v1 · immutable
·published 2007-07-21 23:41 UTC
rendered paste body
        mov %esp, %ebp
        // allocate space for fd_set -- this was taken from a disassemble of fd_set fd;
        sub $0x90, %esp
        // move socket descriptor into eax from previous connect call
        mov %edi, %eax
        // assign the socket descriptor (FD_SET(eax, &fd))
        bts %eax, 0xffffff7c(%ebp)
        // move server socket descriptor into eax from previous accept call
        mov %esi, %eax
        // assign the socket descriptor (FD_SET(eax, &fd))
        bts %eax, 0xffffff7c(%ebp)
        // store &fds into eax
        lea 0xffffff7c(%ebp), %ecx
        // argv[1] - number of fds+1
        mov $0x3, %ebx
        // argv[2] - argv[4]
        xor %edx, %edx
        xor %esi, %esi
        xor %edi, %edi
        // index into syscall table for select() (not old_select)
        movb $142, %al
        int $0x80