Function at 0x4125f0
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.004124fc
mov ebp, eax
test eax, eax
je 0x412640
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.00411f4c
test eax, eax
je 0x4128cc
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.0040ccd4
mov eax, dword [esp + 0x120]
cmp eax, 2
je 0x412774
cmp eax, 0x17
je 0x412774
mov eax, dword [esp + 0x60]
mov dword [esp], eax
call fcn.004122d8
mov edx, dword [esp + 0x3c]
mov eax, dword [edx + 0x1e8]
test eax, eax
je 0x4126db
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 0x412bf4
test eax, eax
jne 0x412b7c
mov dword [esp + 0x50], 0
mov eax, dword [esp + 0x120]
cmp eax, 2
je 0x412918
cmp eax, 0x17
je 0x412918
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.0043ef9c
call fcn.0040fd14
mov dword [ebx + 0x250], eax
mov dword [ebx + 0x254], edx
cmp dword [ebx + 0x258], 1
jle 0x412748
mov eax, dword [ebx + 0x25c]
mov dword [esp + 4], eax
mov ecx, dword [esp + 0x3c]
mov dword [esp], ecx
call fcn.0040e490
mov eax, dword [esp + 0x50]
test eax, eax
jne 0x41275d
cmp dword [ebx + 0x8c], 1
je 0x412d38
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 0x412691
mov eax, dword [esp + 0x3c]
mov edi, dword [eax + 0x38c]
test edi, edi
jne 0x412c01
mov eax, dword [esp + 0x60]
mov dword [esp], eax
call fcn.004122d8
mov edx, dword [esp + 0x3c]
mov esi, dword [edx + 0x4ac]
test esi, esi
je 0x41269d
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 0x412e9c
mov dword [esp + 0x1b0], 1
mov ecx, dword [esp + 0x3c]
mov eax, dword [ecx + 0x4b0]
mov dword [esp], eax
call fcn.0041355c
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.0041355c
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 0x41269d
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.0040ccd4
jmp 0x41269d
call sub.KERNEL32.dll_GetLastError
mov esi, eax
mov dword [esp + 4], eax
mov dword [esp], ebx
call fcn.004379c0
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.0040c7a8
mov eax, dword [esp + 0x60]
mov dword [esp + 4], eax
mov dword [esp], ebx
call fcn.00412498
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.0043efd4
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 0x412b98
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 0x412bbc
mov dword [esp + 0x1b0], 0
lea edi, [esp + 0x1b4]
mov ecx, 0xfc
rep stosb byte es:[edi], al
mov esi, 0x5a4657
mov cl, 3
mov edi, edx
repe cmpsb byte [esi], byte es:[edi]
jne 0x412dd0
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.0043efdc
cmp eax, 1
mov edx, dword [esp + 0x34]
je 0x412ec0
jae 0x412e3f
test edi, edi
jne 0x412f3f
mov esi, dword [ebx + 0x268]
cmp dword [esp + 0x48], 2
je 0x412eca
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.00405728
dec eax
mov edx, dword [esp + 0x34]
je 0x412f2a
mov dword [ebx + 0x268], esi
mov eax, dword [esp + 0x68]
test eax, eax
je 0x412e50
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.004054b4
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.0040ccd4
mov eax, dword [esp + 0x68]
mov dword [esp + 4], eax
mov edx, dword [esp + 0x44]
mov dword [esp], edx
call fcn.004058f0
cmp dword [esp + 0x48], 2
je 0x412ed9
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 0x412c5c
dec ebp
test ebp, ebp
jle 0x412cd4
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.0040ccd4
mov eax, esi
sub eax, ebp
cmp word [esp + 0xa0], 2
jne 0x412b08
movzx eax, ax
mov dword [esp], eax
call sub.WS2_32.dll_ntohs
push edx
mov word [esp + 0xa2], ax
jmp 0x412b08
mov eax, dword [esp + 0x60]
mov dword [esp + 4], eax
mov dword [esp], ebx
call fcn.00412498
mov ebp, 0x2a
jmp 0x412633
cmp word [esp + 0x54], 0
je 0x412704
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 0x412af0
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 0x412af8
mov dword [esp + 0x50], 1
jmp 0x4126e3
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 0x412e72
mov dword [esp + 4], str.TCP_NODELAY_set_n
mov dword [esp], esi
call fcn.0040ccd4
jmp 0x412794
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 0x412dec
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.0040ccd4
mov dword [ebx + 0x248], 1
mov edx, dword [esp + 0x60]
mov dword [esp + 0x40], edx
jmp 0x412704
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.004379c0
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.0040c7a8
mov ebp, 0x2d
mov eax, dword [esp + 0x60]
mov dword [esp + 4], eax
mov dword [esp], ebx
call fcn.00412498
cmp ebp, 1
jne 0x412633
mov ebp, 7
jmp 0x412633
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 0x41275d
call sub.WS2_32.dll_WSAGetLastError
mov esi, eax
cmp eax, 0xb
je 0x41275d
jl 0x412d85
lea eax, [eax - 0x2733]
cmp eax, 1
jbe 0x41275d
mov dword [esp + 4], esi
mov dword [esp], ebx
call fcn.004379c0
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.0040ccd4
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.00412498
jmp 0x412d2b
mov esi, str.host_
mov ecx, 5
mov edi, edx
repe cmpsb byte [esi], byte es:[edi]
jne 0x412eb9
add edx, 5
jmp 0x412a2d
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.004379c0
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.0040c7a8
mov eax, dword [esp + 0x60]
mov dword [esp + 4], eax
mov dword [esp], ebx
call fcn.00412498
mov ebp, 0x2d
jmp 0x412633
cmp eax, 2
je 0x412f01
test edi, edi
je 0x412a2d
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.0040c7a8
mov ebp, 0x2d
jmp 0x412d12
call sub.WS2_32.dll_WSAGetLastError
mov dword [esp + 4], eax
mov dword [esp], ebx
call fcn.004379c0
mov dword [esp + 8], eax
mov dword [esp + 4], str.Could_not_set_TCP_NODELAY:__s_n
mov dword [esp], esi
call fcn.0040ccd4
jmp 0x412794
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.0040ccd4
jmp 0x41269d
xor edi, edi
jmp 0x4129d9
mov ebp, 1
jmp 0x412d12
mov dword [ebx + 0x268], 1
jmp 0x412a3e
lea eax, [esp + 0xa4]
mov dword [esp + 8], eax
mov dword [esp + 4], esi
mov dword [esp], 2
call fcn.00413ab4
test eax, eax
jg 0x412bc7
jmp 0x412af0
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.0040ccd4
jmp 0x412ae5
mov dword [esp + 4], edi
mov dword [esp], ebx
call fcn.00402be8
mov edx, dword [esp + 0x34]
jmp 0x412a69
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.0040c7a8
mov ebp, 0x2d
jmp 0x412d12