Function at 0x403020
Capabilities:
Connect socket
Get local ipv4 addresses
Get socket information
Set socket configuration

Disassembly:
push ebp
mov ebp, ecx
push edi
push esi
push ebx
mov ebx, eax
sub esp, 0x2ac
mov esi, dword [eax]
mov dword [ecx], 0xffffffff
lea eax, [esp + 0x50]
mov dword [esp + 4], edx
mov dword [esp + 0xc], eax
lea eax, [esp + 0x110]
mov dword [esp + 8], eax
mov dword [esp], ebx
call sym._Curl_socket
test eax, eax
je 0x403070
xor eax, eax
add esp, 0x2ac
pop ebx
pop esi
pop edi
pop ebp
ret
lea eax, [esp + 0x54]
mov dword [esp + 8], eax
lea eax, [esp + 0x62]
mov dword [esp + 4], eax
lea eax, [esp + 0x120]
mov dword [esp], eax
call sym._Curl_getaddressinfo
mov edi, dword [esp + 0x50]
mov byte [esp + 0x41], al
mov dword [esp + 0x34], edi
test al, al
je 0x403518
lea eax, [esp + 0x62]
mov dword [esp + 4], str.__Trying__s..._n
mov dword [esp + 8], eax
mov dword [esp], esi
call sym._Curl_infof
mov eax, dword [esp + 0x110]
cmp eax, 2
je 0x403280
cmp eax, 0x17
je 0x403280
mov eax, dword [esp + 0x34]
mov dword [esp], eax
call sym._Curl_sndbufset
mov edi, dword [esi + 0x1b0]
test edi, edi
je 0x403138
mov dword [esp + 4], 1
mov dword [esp], esi
call sym._Curl_set_in_callback
mov eax, dword [esp + 0x34]
mov dword [esp + 8], 0
mov dword [esp + 4], eax
mov eax, dword [esi + 0x1b4]
mov dword [esp], eax
call dword [esi + 0x1b0]
mov dword [esp + 4], 0
mov dword [esp], esi
mov edi, eax
call sym._Curl_set_in_callback
cmp edi, 2
je 0x40313d
test edi, edi
jne 0x403638
mov byte [esp + 0x41], 0
mov eax, dword [esp + 0x110]
cmp eax, 2
je 0x4033c8
cmp eax, 0x17
je 0x4033c8
mov eax, dword [esp + 0x34]
mov dword [esp + 4], 1
mov dword [esp], eax
call sym._curlx_nonblock
call sym._Curl_now
cmp dword [ebx + 0x284], 1
mov dword [ebx + 0x27c], eax
mov dword [ebx + 0x280], edx
jg 0x403250
cmp byte [esp + 0x41], 0
jne 0x403240
cmp dword [ebx + 0x90], 1
jne 0x403240
cmp byte [ebx + 0x276], 0
je 0x403210
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edi, eax
cmp eax, 0xb
je 0x403240
lea eax, [eax - 0x2733]
cmp eax, 1
jbe 0x403240
mov dword [esp + 4], edi
mov dword [esp], ebx
call sym._Curl_strerror
mov dword [esp + 4], str.Immediate_connect_fail_for__s:__s_n
mov dword [esp + 0xc], eax
lea eax, [esp + 0x62]
mov dword [esp + 8], eax
mov dword [esp], esi
call sym._Curl_infof
mov dword [esi + 0x82c], edi
mov eax, dword [esp + 0x34]
mov dword [esp], ebx
mov dword [esp + 4], eax
call sym._Curl_closesocket
mov eax, 7
jmp 0x40305b
mov eax, dword [esp + 0x11c]
mov dword [esp + 8], eax
lea eax, [esp + 0x120]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x34]
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_connect]
sub esp, 0xc
cmp eax, 0xffffffff
je 0x4031a9
nop
mov eax, dword [esp + 0x34]
mov dword [ebp], eax
jmp 0x403059
mov dword [esp + 8], 3
mov eax, dword [ebx + 0x288]
mov dword [esp], esi
mov dword [esp + 4], eax
call sym._Curl_expire
cmp byte [esp + 0x41], 0
je 0x403193
jmp 0x403240
cmp dword [esp + 0x114], 1
jne 0x4030d4
cmp byte [esi + 0x4f6], 0
jne 0x403618
mov eax, dword [esp + 0x34]
mov dword [esp], eax
call sym._Curl_sndbufset
cmp byte [esi + 0x638], 0
je 0x4030e0
mov edi, dword [esp + 0x34]
lea eax, [esp + 0x5c]
mov dword [esp + 0x5c], 1
mov dword [esp + 0x10], 4
mov dword [esp + 0xc], eax
mov dword [esp + 8], 8
mov dword [esp + 4], 0xffff
mov dword [esp], edi
call dword [sym.imp.WS2_32.dll_setsockopt]
sub esp, 0x14
test eax, eax
js 0x403738
mov eax, dword [esi + 0x63c]
mov dword [esp + 0x1a0], 1
mov dword [esp], eax
call sym._curlx_sltosi
imul eax, eax, 0x3e8
mov dword [esp + 0x5c], eax
mov dword [esp + 0x1a4], eax
mov eax, dword [esi + 0x640]
mov dword [esp], eax
call sym._curlx_sltosi
mov dword [esp + 0x20], 0
imul eax, eax, 0x3e8
mov dword [esp + 0x1c], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0x5c], eax
mov dword [esp + 0x1a8], eax
lea eax, [esp + 0x90]
mov dword [esp + 0x18], eax
lea eax, [esp + 0x1a0]
mov dword [esp + 8], eax
mov eax, dword [esp + 0x34]
mov dword [esp + 0xc], 0xc
mov dword [esp + 4], 0x98000004
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_WSAIoctl]
sub esp, 0x24
test eax, eax
je 0x4030e0
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [esp + 4], str.Failed_to_set_SIO_KEEPALIVE_VALS_on_fd__d:__d_n
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x34]
mov dword [esp], esi
mov dword [esp + 8], eax
call sym._Curl_infof
jmp 0x4030e0
lea eax, [esp + 0x120]
mov dword [esp], eax
call sym._Curl_ipv6_scope
mov dword [esp + 0x58], 0
mov dword [esp + 0x48], eax
mov eax, dword [esp + 0x110]
mov dword [esp + 0x3c], eax
mov eax, dword [ebx]
mov ecx, dword [eax + 0x184]
movzx edi, word [eax + 0x180]
mov dword [esp + 0x38], eax
mov edx, dword [eax + 0x530]
mov word [esp + 0x42], di
mov dword [esp + 0x44], ecx
test edx, edx
jne 0x40341d
test di, di
je 0x403156
mov ecx, 0x20
lea edi, [esp + 0x90]
xor eax, eax
rep stosd dword es:[edi], eax
test edx, edx
je 0x403568
mov dword [esp], edx
mov dword [esp + 0x4c], edx
call sym._strlen
cmp eax, 0xfe
ja 0x403568
xor eax, eax
mov ecx, 0x40
lea edi, [esp + 0x1a0]
mov edx, dword [esp + 0x4c]
rep stosd dword es:[edi], eax
cmp byte [edx], 0x69
jne 0x4037a0
cmp byte [edx + 1], 0x66
jne 0x4037a0
cmp byte [edx + 2], 0x21
jne 0x4037a0
add edx, 3
lea eax, [esp + 0x1a0]
mov dword [esp + 0x14], 0x100
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], edx
mov eax, dword [ebx + 0x8c]
mov dword [esp + 0x4c], edx
mov dword [esp + 8], eax
mov eax, dword [esp + 0x48]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x3c]
mov dword [esp], eax
call sym._Curl_if2ip
cmp eax, 1
je 0x4031f3
cmp eax, 2
mov edx, dword [esp + 0x4c]
je 0x403a8f
test eax, eax
jne 0x4039c8
mov dword [esp + 8], edx
mov eax, dword [esp + 0x38]
mov dword [esp + 4], str.Couldnt_bind_to_interface__s
lea esi, cs:[esi]
nop
mov dword [esp], eax
call sym._Curl_failf
mov eax, dword [esp + 0x34]
mov dword [esp], ebx
mov dword [esp + 4], eax
call sym._Curl_closesocket
mov eax, 0x2d
jmp 0x40305b
mov ebp, dword [sym.imp.msvcrt.dll__errno]
call ebp
mov eax, dword [eax]
mov dword [esp], ebx
mov dword [esp + 4], eax
call sym._Curl_strerror
mov edi, eax
call ebp
mov dword [esp + 0xc], edi
mov eax, dword [eax]
mov dword [esp + 4], str.sa_addr_inet_ntop___failed_with_errno__d:__s
mov dword [esp], esi
mov dword [esp + 8], eax
call sym._Curl_failf
mov eax, dword [esp + 0x34]
mov dword [esp], ebx
mov dword [esp + 4], eax
call sym._Curl_closesocket
jmp 0x403059
cmp dword [esp + 0x3c], 0x17
je 0x403998
xor edi, edi
cmp dword [esp + 0x3c], 2
je 0x403935
mov eax, dword [sym.imp.WS2_32.dll_ntohs]
mov dword [esp + 0x48], esi
mov esi, dword [esp + 0x44]
mov dword [esp + 0x44], ebp
mov dword [esp + 0x3c], eax
movzx ebp, word [esp + 0x42]
lea esi, [esi]
lea eax, [esp + 0x90]
mov dword [esp + 8], edi
mov dword [esp + 4], eax
mov eax, dword [esp + 0x34]
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_bind]
sub esp, 0xc
test eax, eax
jns 0x403670
sub esi, 1
test esi, esi
jle 0x4036e8
movzx eax, bp
mov dword [esp + 4], str.Bind_to_local_port__hu_failed__trying_next_n
add ebp, 1
mov dword [esp + 8], eax
mov eax, dword [esp + 0x38]
mov dword [esp], eax
call sym._Curl_infof
movzx eax, bp
cmp word [esp + 0x90], 2
mov dword [esp], eax
je 0x403658
call dword [sym.imp.WS2_32.dll_ntohs]
sub esp, 4
mov word [esp + 0x92], ax
jmp 0x4035a0
mov edi, dword [esp + 0x34]
mov dword [esp], ebx
mov dword [esp + 4], edi
call sym._Curl_tcpnodelay
mov dword [esp], edi
call sym._Curl_sndbufset
jmp 0x4032a7
mov eax, dword [esp + 0x34]
mov dword [esp], ebx
mov dword [esp + 4], eax
call sym._Curl_closesocket
mov eax, 0x2a
jmp 0x40305b
mov eax, dword [esp + 0x3c]
call eax
sub esp, 4
mov word [esp + 0x92], ax
jmp 0x4035a0
xor eax, eax
mov ecx, 0x20
mov word [esp + 0x42], bp
mov esi, dword [esp + 0x48]
lea edx, [esp + 0x1a0]
mov dword [esp + 0x5c], pe_nt_image_headers32
mov ebp, dword [esp + 0x44]
mov edi, edx
rep stosd dword es:[edi], eax
mov edi, dword [esp + 0x34]
lea eax, [esp + 0x5c]
mov dword [esp + 4], edx
mov dword [esp + 8], eax
mov dword [esp], edi
call dword [sym.imp.WS2_32.dll_getsockname]
sub esp, 0xc
test eax, eax
js 0x403758
movzx eax, word [esp + 0x42]
mov dword [esp + 4], str.Local_port:__hu_n
mov dword [esp + 8], eax
mov eax, dword [esp + 0x38]
mov dword [esp], eax
call sym._Curl_infof
mov byte [ebx + 0x273], 1
jmp 0x403156
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edi, dword [esp + 0x38]
mov esi, eax
mov dword [edi + 0x82c], eax
mov dword [esp + 4], eax
mov dword [esp], ebx
call sym._Curl_strerror
mov dword [esp + 8], esi
mov dword [esp + 0xc], eax
mov dword [esp + 4], str.bind_failed_with_errno__d:__s
mov dword [esp], edi
call sym._Curl_failf
mov eax, dword [esp + 0x34]
mov dword [esp], ebx
mov dword [esp + 4], eax
call sym._Curl_closesocket
jmp 0x403508
mov dword [esp + 8], edi
mov dword [esp + 4], str.Failed_to_set_SO_KEEPALIVE_on_fd__d_n
mov dword [esp], esi
call sym._Curl_infof
jmp 0x4030e0
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ebp, dword [esp + 0x38]
mov esi, eax
mov dword [ebp + 0x82c], eax
mov dword [esp + 4], eax
mov dword [esp], ebx
call sym._Curl_strerror
mov dword [esp + 8], esi
mov dword [esp + 0xc], eax
mov dword [esp + 4], str.getsockname___failed_with_errno__d:__s
mov dword [esp], ebp
call sym._Curl_failf
mov dword [esp + 4], edi
mov dword [esp], ebx
call sym._Curl_closesocket
jmp 0x403508
mov dword [esp + 4], edx
mov dword [esp + 8], 5
mov dword [esp], str.host_
mov dword [esp + 0x4c], edx
call sym._strncmp
mov edx, dword [esp + 0x4c]
test eax, eax
je 0x403965
lea eax, [esp + 0x1a0]
mov dword [esp + 0x14], 0x100
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], edx
mov eax, dword [ebx + 0x8c]
mov dword [esp + 0x4c], edx
mov dword [esp + 8], eax
mov eax, dword [esp + 0x48]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x3c]
mov dword [esp], eax
call sym._Curl_if2ip
cmp eax, 1
je 0x4031f3
cmp eax, 2
mov edx, dword [esp + 0x4c]
je 0x403a8f
lea esi, cs:[esi]
nop
mov eax, dword [ebx + 0x294]
cmp dword [esp + 0x3c], 2
mov dword [esp + 0x48], eax
je 0x403a6b
cmp dword [esp + 0x3c], 0x17
jne 0x403846
mov dword [ebx + 0x294], 2
lea edi, [esp + 0x58]
mov dword [esp + 4], edx
mov dword [esp + 0xc], edi
mov dword [esp + 8], 0
mov dword [esp], ebx
mov dword [esp + 0x4c], edx
call sym._Curl_resolv
mov edx, dword [esp + 0x4c]
cmp eax, 1
je 0x403a7a
mov eax, dword [esp + 0x48]
mov dword [ebx + 0x294], eax
mov eax, dword [esp + 0x58]
test eax, eax
je 0x4039c8
lea ecx, [esp + 0x1a0]
mov dword [esp + 8], 0x100
mov dword [esp + 4], ecx
mov eax, dword [eax]
mov dword [esp + 0x48], edx
mov dword [esp], eax
call sym._Curl_printable_address
mov eax, dword [esp + 0x58]
mov edi, dword [esp + 0x38]
mov edx, dword [esp + 0x48]
mov eax, dword [eax]
mov eax, dword [eax + 4]
mov dword [esp + 8], edx
mov dword [esp + 4], str.Name__s_family__i_resolved_to__s_family__i_n
mov dword [esp + 0x14], eax
lea eax, [esp + 0x1a0]
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x3c]
mov dword [esp], edi
mov dword [esp + 0xc], eax
call sym._Curl_infof
mov eax, dword [esp + 0x58]
mov dword [esp], edi
mov dword [esp + 4], eax
call sym._Curl_resolv_unlock
cmp dword [esp + 0x3c], 0x17
je 0x4039e4
cmp dword [esp + 0x3c], 2
je 0x40390f
xor edi, edi
jmp 0x403580
lea eax, [esp + 0x94]
mov dword [esp], 2
mov dword [esp + 8], eax
lea eax, [esp + 0x1a0]
mov dword [esp + 4], eax
call sym._Curl_inet_pton
test eax, eax
jle 0x403908
movzx eax, word [esp + 0x42]
mov edx, 2
mov edi, 0x10
mov word [esp + 0x90], dx
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_htons]
sub esp, 4
mov word [esp + 0x92], ax
jmp 0x403580
add edx, 5
jmp 0x403820
lea eax, [esp + 0x98]
mov dword [esp], 0x17
mov dword [esp + 8], eax
lea eax, [esp + 0x1a0]
mov dword [esp + 4], eax
call sym._Curl_inet_pton
test eax, eax
jle 0x4039be
lea esi, cs:[esi]
movzx eax, word [esp + 0x42]
mov ecx, 0x17
mov word [esp + 0x90], cx
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_htons]
sub esp, 4
mov word [esp + 0x92], ax
mov edi, 0x1c
jmp 0x403580
mov eax, dword [esp + 0x38]
mov byte [eax + 0x828], 0
mov dword [esp + 8], edx
mov dword [esp + 4], str.Couldnt_bind_to__s
jmp 0x4034f0
lea eax, [esp + 0x1a0]
mov dword [esp + 4], 0x25
mov dword [esp], eax
call sym._strchr
mov edi, eax
test eax, eax
je 0x40396d
mov byte [eax], 0
lea eax, [esp + 0x98]
mov dword [esp + 8], eax
lea eax, [esp + 0x1a0]
mov dword [esp + 4], eax
mov dword [esp], 0x17
call sym._Curl_inet_pton
test eax, eax
jle 0x4039be
mov eax, 0x17
add edi, 1
mov word [esp + 0x90], ax
movzx eax, word [esp + 0x42]
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_htons]
sub esp, 4
mov dword [esp], edi
mov word [esp + 0x92], ax
call sym._atoi
mov dword [esp + 0xa8], eax
jmp 0x4039be
mov dword [ebx + 0x294], 1
jmp 0x403846
mov dword [esp + 4], edi
mov dword [esp], ebx
call sym._Curl_resolver_wait_resolv
mov edx, dword [esp + 0x4c]
jmp 0x403873
mov eax, dword [esp + 0x3c]
mov dword [esp + 8], edx
mov dword [esp + 4], str.Local_Interface__s_is_ip__s_using_address_family__i_n
mov dword [esp + 0x10], eax
lea eax, [esp + 0x1a0]
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x38]
mov dword [esp], eax
call sym._Curl_infof
jmp 0x4038f6