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

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x2bc
mov ebx, eax
mov dword [esp + 0x38], ecx
mov eax, dword [eax]
mov dword [esp + 0x3c], eax
mov dword [ecx], 0xffffffff
lea eax, [esp + 0x60]
mov dword [esp + 0xc], eax
lea eax, [esp + 0x120]
mov dword [esp + 8], eax
mov dword [esp + 4], edx
mov dword [esp], ebx
call fcn.00413a44
mov ebp, eax
test eax, eax
je 0x413b88
xor ebp, ebp
mov eax, ebp
add esp, 0x2bc
pop ebx
pop esi
pop edi
pop ebp
ret
lea ecx, [esp + 0x64]
lea edx, [esp + 0x72]
lea eax, [esp + 0x130]
call fcn.00413494
test eax, eax
je 0x413e14
lea ecx, [esp + 0x72]
mov dword [esp + 8], ecx
mov dword [esp + 4], str.__Trying__s..._n
mov eax, dword [esp + 0x3c]
mov dword [esp], eax
call fcn.0040e21c
mov eax, dword [esp + 0x120]
cmp eax, 2
je 0x413cbc
cmp eax, 0x17
je 0x413cbc
mov eax, dword [esp + 0x60]
mov dword [esp], eax
call fcn.00413820
mov edx, dword [esp + 0x3c]
mov eax, dword [edx + 0x1e8]
test eax, eax
je 0x413c23
mov dword [esp + 8], 0
mov edx, dword [esp + 0x60]
mov dword [esp + 4], edx
mov ecx, dword [esp + 0x3c]
mov edx, dword [ecx + 0x1ec]
mov dword [esp], edx
call eax
cmp eax, 2
je 0x41413c
test eax, eax
jne 0x4140c4
mov dword [esp + 0x50], 0
mov eax, dword [esp + 0x120]
cmp eax, 2
je 0x413e60
cmp eax, 0x17
je 0x413e60
mov edx, dword [esp + 0x60]
mov dword [esp + 0x40], edx
mov dword [esp + 4], 1
mov edx, dword [esp + 0x40]
mov dword [esp], edx
call fcn.0043f3bc
call fcn.0041125c
mov dword [ebx + 0x250], eax
mov dword [ebx + 0x254], edx
cmp dword [ebx + 0x258], 1
jle 0x413c90
mov eax, dword [ebx + 0x25c]
mov dword [esp + 4], eax
mov ecx, dword [esp + 0x3c]
mov dword [esp], ecx
call fcn.0040f9d8
mov eax, dword [esp + 0x50]
test eax, eax
jne 0x413ca5
cmp dword [ebx + 0x8c], 1
je 0x414280
mov eax, dword [esp + 0x60]
mov ecx, dword [esp + 0x38]
mov dword [ecx], eax
mov eax, ebp
add esp, 0x2bc
pop ebx
pop esi
pop edi
pop ebp
ret
cmp dword [esp + 0x124], 1
jne 0x413bd9
mov eax, dword [esp + 0x3c]
mov edi, dword [eax + 0x38c]
test edi, edi
jne 0x414149
mov eax, dword [esp + 0x60]
mov dword [esp], eax
call fcn.00413820
mov edx, dword [esp + 0x3c]
mov esi, dword [edx + 0x4ac]
test esi, esi
je 0x413be5
mov esi, dword [esp + 0x60]
mov dword [esp + 0x68], 1
mov dword [esp + 0x10], 4
lea eax, [esp + 0x68]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 8
mov dword [esp + 4], 0xffff
mov dword [esp], esi
call sub.WS2_32.dll_setsockopt
sub esp, 0x14
test eax, eax
js 0x4143e4
mov dword [esp + 0x1b0], 1
mov ecx, dword [esp + 0x3c]
mov eax, dword [ecx + 0x4b0]
mov dword [esp], eax
call fcn.00414aa4
lea eax, [eax + eax*4]
lea eax, [eax + eax*4]
lea eax, [eax + eax*4]
shl eax, 3
mov dword [esp + 0x68], eax
mov dword [esp + 0x1b4], eax
mov edx, dword [esp + 0x3c]
mov eax, dword [edx + 0x4b4]
mov dword [esp], eax
call fcn.00414aa4
lea eax, [eax + eax*4]
lea eax, [eax + eax*4]
lea eax, [eax + eax*4]
shl eax, 3
mov dword [esp + 0x68], eax
mov dword [esp + 0x1b8], eax
mov dword [esp + 0x20], 0
mov dword [esp + 0x1c], 0
lea eax, [esp + 0x6c]
mov dword [esp + 0x18], eax
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0xc
lea eax, [esp + 0x1b0]
mov dword [esp + 8], eax
mov dword [esp + 4], 0x98000004
mov dword [esp], esi
call sub.WS2_32.dll_WSAIoctl
sub esp, 0x24
test eax, eax
je 0x413be5
call sub.WS2_32.dll_WSAGetLastError
mov dword [esp + 0xc], eax
mov dword [esp + 8], esi
mov dword [esp + 4], str.Failed_to_set_SIO_KEEPALIVE_VALS_on_fd__d:__d_n
mov ecx, dword [esp + 0x3c]
mov dword [esp], ecx
call fcn.0040e21c
jmp 0x413be5
call sub.KERNEL32.dll_GetLastError
mov esi, eax
mov dword [esp + 4], eax
mov dword [esp], ebx
call fcn.0040227c
mov dword [esp + 0xc], eax
mov dword [esp + 8], esi
mov dword [esp + 4], str.sa_addr_inet_ntop___failed_with_errno__d:__s
mov edx, dword [esp + 0x3c]
mov dword [esp], edx
call fcn.0040dcf0
mov eax, dword [esp + 0x60]
mov dword [esp + 4], eax
mov dword [esp], ebx
call fcn.004139e0
mov eax, ebp
add esp, 0x2bc
pop ebx
pop esi
pop edi
pop ebp
ret
lea eax, [esp + 0x130]
mov dword [esp], eax
call fcn.0043f3f4
mov dword [esp + 0x5c], eax
mov edx, dword [esp + 0x120]
mov dword [esp + 0x48], edx
mov edx, dword [esp + 0x60]
mov dword [esp + 0x40], edx
mov edx, dword [ebx]
mov dword [esp + 0x44], edx
mov dword [esp + 0x68], 0
mov edx, dword [edx + 0x1b8]
mov word [esp + 0x54], dx
mov edx, dword [esp + 0x44]
mov edx, dword [edx + 0x1bc]
mov dword [esp + 0x58], edx
mov ecx, dword [esp + 0x44]
mov edx, dword [ecx + 0x3cc]
test edx, edx
je 0x4140e0
lea eax, [esp + 0xa0]
mov dword [esp + 0x4c], eax
xor eax, eax
mov ecx, pe_nt_image_headers32
mov edi, dword [esp + 0x4c]
rep stosb byte es:[edi], al
mov ecx, 0xffffffff
mov edi, edx
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp ecx, 0xfe
ja 0x414104
mov dword [esp + 0x1b0], 0
lea edi, [esp + 0x1b4]
mov ecx, 0xfc
rep stosb byte es:[edi], al
mov esi, 0x5a6257
mov cl, 3
mov edi, edx
repe cmpsb byte [esi], byte es:[edi]
jne 0x414318
add edx, 3
mov edi, 1
mov dword [esp + 0x14], 0x100
lea esi, [esp + 0x1b0]
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], edx
mov eax, dword [ebx + 0x88]
mov dword [esp + 8], eax
mov eax, dword [esp + 0x5c]
mov dword [esp + 4], eax
mov ecx, dword [esp + 0x48]
mov dword [esp], ecx
mov dword [esp + 0x34], edx
call fcn.0043f3fc
cmp eax, 1
mov edx, dword [esp + 0x34]
je 0x414408
jae 0x414387
test edi, edi
jne 0x414487
mov esi, dword [ebx + 0x268]
cmp dword [esp + 0x48], 2
je 0x414412
lea edi, [esp + 0x68]
mov dword [esp + 0xc], edi
mov dword [esp + 8], 0
mov dword [esp + 4], edx
mov dword [esp], ebx
mov dword [esp + 0x34], edx
call fcn.00406c70
dec eax
mov edx, dword [esp + 0x34]
je 0x414472
mov dword [ebx + 0x268], esi
mov eax, dword [esp + 0x68]
test eax, eax
je 0x414398
mov dword [esp + 8], 0x100
lea esi, [esp + 0x1b0]
mov dword [esp + 4], esi
mov eax, dword [eax]
mov dword [esp], eax
mov dword [esp + 0x34], edx
call fcn.004069fc
mov eax, dword [esp + 0x68]
mov eax, dword [eax]
mov eax, dword [eax + 4]
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], esi
mov ecx, dword [esp + 0x48]
mov dword [esp + 0xc], ecx
mov edx, dword [esp + 0x34]
mov dword [esp + 8], edx
mov dword [esp + 4], str.Name__s_family__i_resolved_to__s_family__i_n
mov edx, dword [esp + 0x44]
mov dword [esp], edx
call fcn.0040e21c
mov eax, dword [esp + 0x68]
mov dword [esp + 4], eax
mov edx, dword [esp + 0x44]
mov dword [esp], edx
call fcn.00406e38
cmp dword [esp + 0x48], 2
je 0x414421
mov dword [esp + 0x48], 0
mov edi, dword [esp + 0x58]
mov esi, dword [esp + 0x54]
add esi, edi
mov dword [esp + 0x54], ebp
mov ebp, edi
mov edi, esi
sub edi, ebp
mov ecx, dword [esp + 0x48]
mov dword [esp + 8], ecx
mov eax, dword [esp + 0x4c]
mov dword [esp + 4], eax
mov edx, dword [esp + 0x40]
mov dword [esp], edx
call sub.WS2_32.dll_bind
sub esp, 0xc
test eax, eax
jns 0x4141a4
dec ebp
test ebp, ebp
jle 0x41421c
movzx edi, di
mov dword [esp + 8], edi
mov dword [esp + 4], str.Bind_to_local_port__hu_failed__trying_next_n
mov edx, dword [esp + 0x44]
mov dword [esp], edx
call fcn.0040e21c
mov eax, esi
sub eax, ebp
cmp word [esp + 0xa0], 2
jne 0x414050
movzx eax, ax
mov dword [esp], eax
call sub.WS2_32.dll_ntohs
push edx
mov word [esp + 0xa2], ax
jmp 0x414050
mov eax, dword [esp + 0x60]
mov dword [esp + 4], eax
mov dword [esp], ebx
call fcn.004139e0
mov ebp, 0x2a
jmp 0x413b7b
cmp word [esp + 0x54], 0
je 0x413c4c
lea ecx, [esp + 0xa0]
mov dword [esp + 0x4c], ecx
mov ecx, pe_nt_image_headers32
xor eax, eax
mov edi, dword [esp + 0x4c]
rep stosb byte es:[edi], al
cmp dword [esp + 0x48], 2
jne 0x414038
mov word [esp + 0xa0], 2
movzx eax, word [esp + 0x54]
mov dword [esp], eax
call sub.WS2_32.dll_htons
push ecx
mov word [esp + 0xa2], ax
mov dword [esp + 0x48], 0x10
jmp 0x414040
mov dword [esp + 0x50], 1
jmp 0x413c2b
mov esi, dword [ebx]
mov eax, dword [esi + 0x38c]
mov dword [esp + 0x6c], eax
mov dword [esp + 0x10], 4
lea eax, [esp + 0x6c]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 1
mov dword [esp + 4], 6
mov eax, dword [esp + 0x60]
mov dword [esp], eax
call sub.WS2_32.dll_setsockopt
sub esp, 0x14
test eax, eax
js 0x4143ba
mov dword [esp + 4], str.TCP_NODELAY_set_n
mov dword [esp], esi
call fcn.0040e21c
jmp 0x413cdc
mov ebp, dword [esp + 0x54]
mov esi, edi
mov dword [esp + 0x6c], pe_nt_image_headers32
lea edx, [esp + 0x1b0]
mov ecx, pe_nt_image_headers32
xor eax, eax
mov edi, edx
rep stosb byte es:[edi], al
lea eax, [esp + 0x6c]
mov dword [esp + 8], eax
mov dword [esp + 4], edx
mov edx, dword [esp + 0x40]
mov dword [esp], edx
call sub.WS2_32.dll_getsockname
sub esp, 0xc
test eax, eax
js 0x414334
movzx eax, si
mov dword [esp + 8], eax
mov dword [esp + 4], str.Local_port:__hu_n
mov edx, dword [esp + 0x44]
mov dword [esp], edx
call fcn.0040e21c
mov dword [ebx + 0x248], 1
mov edx, dword [esp + 0x60]
mov dword [esp + 0x40], edx
jmp 0x413c4c
call sub.WS2_32.dll_WSAGetLastError
mov esi, eax
mov edx, dword [esp + 0x44]
mov dword [edx + 0x8644], eax
mov dword [esp + 4], eax
mov dword [esp], ebx
call fcn.0040227c
mov dword [esp + 0xc], eax
mov dword [esp + 8], esi
mov dword [esp + 4], str.bind_failed_with_errno__d:__s
mov edx, dword [esp + 0x44]
mov dword [esp], edx
call fcn.0040dcf0
mov ebp, 0x2d
mov eax, dword [esp + 0x60]
mov dword [esp + 4], eax
mov dword [esp], ebx
call fcn.004139e0
cmp ebp, 1
jne 0x413b7b
mov ebp, 7
jmp 0x413b7b
mov eax, dword [esp + 0x12c]
mov dword [esp + 8], eax
lea eax, [esp + 0x130]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x60]
mov dword [esp], eax
call sub.WS2_32.dll_connect
sub esp, 0xc
inc eax
jne 0x413ca5
call sub.WS2_32.dll_WSAGetLastError
mov esi, eax
cmp eax, 0xb
je 0x413ca5
jl 0x4142cd
lea eax, [eax - 0x2733]
cmp eax, 1
jbe 0x413ca5
mov dword [esp + 4], esi
mov dword [esp], ebx
call fcn.0040227c
mov dword [esp + 0xc], eax
lea eax, [esp + 0x72]
mov dword [esp + 8], eax
mov dword [esp + 4], str.Immediate_connect_fail_for__s:__s_n
mov edx, dword [esp + 0x3c]
mov dword [esp], edx
call fcn.0040e21c
mov ecx, dword [esp + 0x3c]
mov dword [ecx + 0x8644], esi
mov eax, dword [esp + 0x60]
mov dword [esp + 4], eax
mov dword [esp], ebx
call fcn.004139e0
jmp 0x414273
mov esi, str.host_
mov ecx, 5
mov edi, edx
repe cmpsb byte [esi], byte es:[edi]
jne 0x414401
add edx, 5
jmp 0x413f75
call sub.WS2_32.dll_WSAGetLastError
mov esi, eax
mov edx, dword [esp + 0x44]
mov dword [edx + 0x8644], eax
mov dword [esp + 4], eax
mov dword [esp], ebx
call fcn.0040227c
mov dword [esp + 0xc], eax
mov dword [esp + 8], esi
mov dword [esp + 4], str.getsockname___failed_with_errno__d:__s
mov edx, dword [esp + 0x44]
mov dword [esp], edx
call fcn.0040dcf0
mov eax, dword [esp + 0x60]
mov dword [esp + 4], eax
mov dword [esp], ebx
call fcn.004139e0
mov ebp, 0x2d
jmp 0x413b7b
cmp eax, 2
je 0x414449
test edi, edi
je 0x413f75
mov dword [esp + 8], edx
mov dword [esp + 4], str.Couldnt_bind_to__s
mov edx, dword [esp + 0x44]
mov dword [esp], edx
call fcn.0040dcf0
mov ebp, 0x2d
jmp 0x41425a
call sub.WS2_32.dll_WSAGetLastError
mov dword [esp + 4], eax
mov dword [esp], ebx
call fcn.0040227c
mov dword [esp + 8], eax
mov dword [esp + 4], str.Could_not_set_TCP_NODELAY:__s_n
mov dword [esp], esi
call fcn.0040e21c
jmp 0x413cdc
mov dword [esp + 8], esi
mov dword [esp + 4], str.Failed_to_set_SO_KEEPALIVE_on_fd__d_n
mov edx, dword [esp + 0x3c]
mov dword [esp], edx
call fcn.0040e21c
jmp 0x413be5
xor edi, edi
jmp 0x413f21
mov ebp, 1
jmp 0x41425a
mov dword [ebx + 0x268], 1
jmp 0x413f86
lea eax, [esp + 0xa4]
mov dword [esp + 8], eax
mov dword [esp + 4], esi
mov dword [esp], 2
call fcn.00414ffc
test eax, eax
jg 0x41410f
jmp 0x414038
mov ecx, dword [esp + 0x48]
mov dword [esp + 0x10], ecx
mov dword [esp + 0xc], esi
mov dword [esp + 8], edx
mov dword [esp + 4], str.Local_Interface__s_is_ip__s_using_address_family__i_n
mov edx, dword [esp + 0x44]
mov dword [esp], edx
call fcn.0040e21c
jmp 0x41402d
mov dword [esp + 4], edi
mov dword [esp], ebx
call fcn.00404130
mov edx, dword [esp + 0x34]
jmp 0x413fb1
mov dword [esp + 8], edx
mov dword [esp + 4], str.Couldnt_bind_to_interface__s
mov edx, dword [esp + 0x44]
mov dword [esp], edx
call fcn.0040dcf0
mov ebp, 0x2d
jmp 0x41425a