Function at 0x401990
Capabilities:
Connect socket
Get local ipv4 addresses
Get socket information
Resolve function by parsing pe exports

Disassembly:
push ebp
push edi
push esi
push ebx
mov ebx, ecx
sub esp, 0x1cc
cmp byte [ecx + 0x105], 0
movzx eax, byte [esp + 0x1e0]
mov byte [esp + 0x3b], al
je 0x401f98
mov eax, dword [ebx + 0xc8]
fld1
mov byte [ebx + 4], 0
fchs
fstp qword [eax + 0x468]
test byte [eax + 0x79], 8
jne 0x401e80
lea eax, [esp + 0xf8]
mov dword [esp], 0
mov dword [esp + 4], eax
call sym._clock_gettime
mov esi, dword [esp + 0xfc]
mov eax, 0x10624dd3
imul esi
mov eax, dword [ebx + 0xc8]
sar esi, 0x1f
mov ecx, edx
sar ecx, 6
sub ecx, esi
add ecx, dword [eax + 0x490]
mov eax, 0x431bde83
imul ecx
mov eax, ecx
sar eax, 0x1f
sar edx, 0x12
sub edx, eax
mov eax, dword [esp + 0xf8]
add eax, edx
imul edx, edx, 0xf4240
mov dword [esp + 0x34], eax
sub ecx, edx
mov dword [esp + 0x3c], ecx
lea esi, [esi]
nop
lea eax, [esp + 0xf8]
mov dword [esp], 0
mov esi, 0x10624dd3
mov dword [esp + 4], eax
call sym._clock_gettime
mov eax, dword [esp + 0xf8]
mov ecx, dword [esp + 0xfc]
mov dword [ebx + 0xf8], eax
mov eax, ecx
sar ecx, 0x1f
imul esi
mov eax, dword [ebx + 0xc8]
add eax, 0xd0
sar edx, 6
sub edx, ecx
mov dword [ebx + 0xfc], edx
mov dword [esp], eax
call sym._SockAddr_get_sizeof_sockaddr
mov dword [esp + 8], eax
mov eax, dword [ebx + 0xc8]
add eax, 0xd0
mov dword [esp + 4], eax
mov eax, dword [ebx + 0xcc]
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_connect]
sub esp, 0xc
mov edi, eax
lea eax, [esp + 0xf8]
mov dword [esp], 0
mov dword [esp + 4], eax
call sym._clock_gettime
mov ecx, dword [esp + 0xfc]
mov ebp, dword [esp + 0xf8]
mov eax, ecx
sar ecx, 0x1f
mov dword [ebx + 0xf0], ebp
imul esi
mov esi, edx
sar esi, 6
sub esi, ecx
mov dword [ebx + 0xf4], esi
cmp edi, 0xffffffff
jne 0x401fc8
lea edi, [esp + 0x4e]
mov dword [esp + 4], 0x32
mov dword [esp], edi
call sym._errno_decode
mov eax, dword [ebx + 0xc8]
add eax, 0xd0
mov dword [esp], eax
call sym._SockAddr_getPort
mov dword [esp + 8], 0xc8
mov esi, eax
lea eax, [esp + 0xf8]
mov dword [esp + 4], eax
mov eax, dword [ebx + 0xc8]
add eax, 0xd0
mov dword [esp], eax
call sym._SockAddr_getHostAddress
mov edx, dword [ebx + 0xc8]
mov ecx, dword [ebx + 0xf4]
mov ebp, dword [ebx + 0xf0]
mov dword [esp + 0x18], 1
mov eax, dword [edx + 0x80]
shr eax, 0x11
and eax, 1
mov dword [esp + 0x14], eax
mov eax, dword [edx + 0x78]
mov dword [esp + 8], ebp
lea ebp, [esp + 0x80]
shr eax, 0x19
mov dword [esp + 0xc], ecx
and eax, 1
mov dword [esp + 4], 0x78
mov dword [esp + 0x10], eax
mov dword [esp], ebp
call sym._iperf_formattime
movzx ecx, si
lea eax, [esp + 0xf8]
mov dword [esp + 0x1c], ebp
mov dword [esp + 0x14], ecx
mov dword [esp + 0x18], edi
mov dword [esp + 0x10], eax
mov eax, dword [ebx + 0xc8]
mov dword [esp + 0x30], ecx
mov eax, dword [eax + 0x28]
mov dword [esp + 8], str._stcp_connect_to__s_port__d_failed___s__on__s
mov dword [esp + 4], 0
mov dword [esp + 0xc], eax
mov dword [esp], 0
call dword [sym.imp.msvcrt.dll__snprintf]
mov dword [esp + 4], 1
lea edx, [eax + 1]
mov dword [esp], edx
mov dword [esp + 0x28], edx
call sym._calloc
mov esi, eax
test eax, eax
je 0x401c67
mov ecx, dword [esp + 0x30]
lea eax, [esp + 0xf8]
mov edx, dword [esp + 0x28]
mov dword [esp + 0x1c], ebp
mov dword [esp + 0x18], edi
mov dword [esp + 0x14], ecx
mov dword [esp + 0x10], eax
mov eax, dword [ebx + 0xc8]
mov eax, dword [eax + 0x28]
mov dword [esp + 4], edx
mov dword [esp + 8], str._stcp_connect_to__s_port__d_failed___s__on__s
mov dword [esp + 0xc], eax
mov dword [esp], esi
call dword [sym.imp.msvcrt.dll__snprintf]
mov dword [esp], esi
call sym._InitStringReport
mov dword [esp], eax
call sym._PostReport
mov dword [esp], esi
call sym._free
cmp byte [esp + 0x3b], 0
jne 0x401cb0
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov esi, dword [sym.imp.msvcrt.dll__errno]
mov edi, eax
call esi
mov dword [eax], edi
cmp edi, 0x274c
je 0x401df8
call esi
cmp dword [eax], 0x274d
je 0x401df8
call esi
cmp dword [eax], 0x2733
je 0x401df8
lea esi, [esi]
nop
mov eax, dword [ebx + 0xcc]
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_closesocket]
mov ecx, ebx
sub esp, 4
call method.Client.mySockInit__
mov dword [esp], 0x2710
call sym._delay_loop
mov eax, dword [ebx + 0xf0]
mov edi, dword [esp + 0x34]
cmp eax, edi
jl 0x401a40
je 0x401e68
movzx esi, byte [ebx + 4]
mov eax, dword [ebx + 0xc8]
mov ecx, esi
test cl, cl
jne 0x401ecf
mov dword [esp + 0x18], 1
mov edx, dword [eax + 0x80]
shr edx, 0x11
and edx, 1
mov dword [esp + 0x14], edx
mov eax, dword [eax + 0x78]
mov dword [esp + 4], 0x78
shr eax, 0x19
and eax, 1
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x34]
mov dword [esp + 8], eax
mov eax, dword [esp + 0x3c]
mov dword [esp + 0xc], eax
lea eax, [esp + 0xf8]
mov dword [esp], eax
call sym._iperf_formattime
lea eax, [esp + 0xf8]
mov dword [esp + 0x10], eax
mov eax, dword [ebx + 0xc8]
mov eax, dword [eax + 0x28]
mov dword [esp + 8], str._stcp_connect_attempt_timer_expired_on__s_n
mov dword [esp + 4], 0
mov dword [esp + 0xc], eax
mov dword [esp], 0
call dword [sym.imp.msvcrt.dll__snprintf]
mov dword [esp + 4], 1
mov ebp, eax
lea eax, [eax + 1]
mov dword [esp], eax
call sym._calloc
mov edi, eax
test eax, eax
je 0x4020ac
lea eax, [esp + 0xf8]
mov dword [esp + 0x10], eax
mov eax, dword [ebx + 0xc8]
mov eax, dword [eax + 0x28]
mov dword [esp + 4], ebp
mov dword [esp], edi
mov dword [esp + 0xc], eax
mov dword [esp + 8], str._stcp_connect_attempt_timer_expried_on__s_n
call dword [sym.imp.msvcrt.dll__snprintf]
mov dword [esp], edi
call sym._InitStringReport
mov dword [esp], eax
call sym._PostReport
mov dword [esp], edi
call sym._free
add esp, 0x1cc
mov eax, esi
pop ebx
pop esi
pop edi
pop ebp
ret 4
mov eax, dword [ebx + 0xf0]
cmp dword [esp + 0x34], eax
jle 0x401e50
mov ecx, dword [ebx + 0xf4]
sub eax, dword [ebx + 0xf8]
mov edx, dword [ebx + 0xc8]
imul eax, eax, 0xf4240
sub ecx, dword [ebx + 0xfc]
mov edx, dword [edx + 0x490]
add eax, ecx
sub edx, eax
mov eax, 0x2710
cmp edx, eax
cmovl edx, eax
mov dword [esp], edx
call sym._delay_loop
mov eax, dword [ebx + 0xf0]
jmp 0x401cdb
jne 0x401ced
mov ecx, dword [ebx + 0xf4]
cmp dword [esp + 0x3c], ecx
jg 0x401e0a
lea esi, [esi]
mov eax, dword [esp + 0x3c]
cmp eax, dword [ebx + 0xf4]
jg 0x401a40
jmp 0x401ced
add eax, 0xd0
mov dword [esp], eax
call sym._SockAddr_get_sizeof_sockaddr
mov dword [esp + 8], eax
mov eax, dword [ebx + 0xc8]
add eax, 0xd0
mov dword [esp + 4], eax
mov eax, dword [ebx + 0xcc]
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_connect]
mov edx, eax
mov eax, dword [ebx + 0xc8]
fldz
sub esp, 0xc
fstp qword [eax + 0x468]
cmp edx, 0xffffffff
je 0x402090
mov byte [ebx + 4], 1
mov edx, dword [ebx + 0xcc]
lea ecx, [eax + 0x1d8]
add eax, 0x158
mov dword [esp], edx
mov dword [esp + 8], ecx
mov dword [esp + 4], eax
call dword [sym.imp.WS2_32.dll_getsockname]
mov eax, dword [ebx + 0xc8]
sub esp, 0xc
lea edx, [eax + 0x150]
add eax, 0xd0
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov eax, dword [ebx + 0xcc]
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_getpeername]
mov eax, dword [ebx + 0xc8]
sub esp, 0xc
mov dword [esp], eax
call sym._SockAddr_Ifrname
mov eax, dword [ebx + 0xc8]
mov edx, dword [eax + 0x78]
test dh, 8
jne 0x402010
nop
test dh, 0x80
je 0x401fa8
and edx, 0x10000
jne 0x401f82
test byte [eax + 0x7e], 0x80
jne 0x401f82
cmp byte [ebx + 4], 0
mov dword [esp], eax
je 0x402078
call sym._InitConnectionReport
mov ecx, dword [ebx + 0xf8]
mov edx, dword [eax + 8]
mov dword [edx + 4], ecx
mov ecx, dword [ebx + 0xfc]
mov dword [edx + 8], ecx
mov dword [esp], eax
call sym._PostReport
movzx esi, byte [ebx + 4]
add esp, 0x1cc
pop ebx
mov eax, esi
pop esi
pop edi
pop ebp
ret 4
call method.Client.mySockInit__
jmp 0x4019b5
mov dword [esp], eax
call sym._InitSettingsReport
mov dword [esp], eax
call sym._PostReport
mov eax, dword [ebx + 0xc8]
mov edx, dword [eax + 0x78]
jmp 0x401f45
sub esi, dword [ebx + 0xfc]
sub ebp, dword [ebx + 0xf8]
mov eax, dword [ebx + 0xc8]
mov edx, dword [ebx + 0xcc]
mov dword [esp + 0x28], esi
fild dword [esp + 0x28]
fdiv dword [0x45a310]
mov dword [esp + 0x28], ebp
fild dword [esp + 0x28]
faddp st(1)
fmul dword [0x45a314]
fstp qword [eax + 0x468]
mov byte [ebx + 4], 1
jmp 0x401ed5
test dword [eax + 0x7c], 0x2000008
jne 0x401f40
mov esi, dword [eax + 0x98]
cmp byte [eax + 0xa0], 0
mov edi, dword [eax + 0x9c]
mov ecx, esi
je 0x40210e
or ecx, edi
je 0x402146
mov dword [esp + 0x28], esi
mov dword [esp + 0x2c], edi
fild qword [esp + 0x28]
test edi, edi
jns 0x402056
fadd dword [0x45a318]
fstp qword [esp + 0x28]
fld qword [esp + 0x28]
fdivr dword [0x45a320]
fdiv dword [0x45a314]
fstp qword [eax + 0x338]
jmp 0x401f40
call sym._InitConnectionReport
mov dword [esp], eax
call sym._PostReport
jmp 0x401f82
mov dword [esp + 8], 0xf1
mov dword [esp + 4], str.Client.cpp
mov dword [esp], str.udp_connect
call sym._warn_errno
cmp byte [ebx + 4], 0
mov edx, dword [ebx + 0xcc]
jne 0x40214d
cmp edx, 0xffffffff
je 0x4020dc
mov dword [esp], edx
call dword [sym.imp.WS2_32.dll_closesocket]
sub esp, 4
cmp eax, 0xffffffff
je 0x4020f0
mov dword [ebx + 0xcc], 0xffffffff
mov eax, dword [ebx + 0xc8]
mov edx, dword [eax + 0x78]
jmp 0x401f40
mov dword [esp + 8], 0x10b
mov dword [esp + 4], str.Client.cpp
mov dword [esp], str.client_connect_close
call sym._warn_errno
jmp 0x4020d2
or ecx, edi
je 0x402146
fild dword [eax + 0x68]
mov dword [esp + 0x28], esi
mov dword [esp + 0x2c], edi
fild qword [esp + 0x28]
test edi, edi
jns 0x40212b
fadd dword [0x45a318]
fstp qword [esp + 0x28]
fld qword [esp + 0x28]
fdivr dword [0x45a31c]
fmulp st(1)
fdiv dword [0x45a314]
jmp 0x40206a
fldz
jmp 0x40206a
mov eax, dword [ebx + 0xc8]
jmp 0x401ed5