Function at 0x42c570
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Get local ipv4 addresses
Get socket information
Get socket status
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x58cf9b
mov eax, dword fs:[0]
push eax
sub esp, 0x1bc
mov eax, dword [0x61b000]
xor eax, ebp
mov dword [ebp - 0x20], eax
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x19c], ecx
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x10], 0
push 0
push 1
mov eax, dword [ebp - 0x19c]
add eax, 0x58
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedCompareExchange]
test eax, eax
je 0x42c5de
push str.Tcp_connection_already_in_fixing__break._n
push 0x5f8e3c
call fcn.0040c230
add esp, 8
jmp 0x42cb76
mov dword [ebp - 0x14], 1
push str.Trying_to_fix_connection_for_tcp_report..._n
push 0x5f8ec8
call fcn.0040c230
add esp, 8
cmp dword [ebp + 8], 0
je 0x42c64d
cmp dword [ebp + 0xc], 0
je 0x42c64d
mov ecx, dword [ebp + 8]
mov dword [ebp - 0x1a0], ecx
mov edx, dword [ebp - 0x1a0]
add edx, 1
mov dword [ebp - 0x1a4], edx
mov eax, dword [ebp - 0x1a0]
mov cl, byte [eax]
mov byte [ebp - 0x1a5], cl
add dword [ebp - 0x1a0], 1
cmp byte [ebp - 0x1a5], 0
jne 0x42c61b
mov edx, dword [ebp - 0x1a0]
sub edx, dword [ebp - 0x1a4]
mov dword [ebp - 0x1ac], edx
jne 0x42c664
push str.Err:_IP_addr__port_params_invalid__break__n
push 0x5f8f5c
call fcn.0040c230
add esp, 8
jmp 0x42cb76
mov eax, dword [ebp + 0xc]
push eax
mov ecx, dword [ebp + 8]
push ecx
push str.Tip:_Try_connect_to_ip_S__port_d_..._n
push 0x5f8fe0
call fcn.0040c230
add esp, 0x10
mov edx, dword [ebp - 0x19c]
cmp dword [edx], 0xffffffff
je 0x42c694
mov ecx, dword [ebp - 0x19c]
call fcn.0042bde0
push 6
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov ecx, dword [ebp - 0x19c]
mov dword [ecx], eax
mov edx, dword [ebp - 0x19c]
cmp dword [edx], 0xffffffff
jne 0x42c6d1
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push str.Err:_socket___ret_INVALID_SOCKET_err_d__break__n
push 0x5f9080
call fcn.0040c230
add esp, 0xc
jmp 0x42cb76
mov dword [ebp - 0x4c], 0xbb8
push 4
lea eax, [ebp - 0x4c]
push eax
push 0x1005
push 0xffff
mov ecx, dword [ebp - 0x19c]
mov edx, dword [ecx]
push edx
call dword [sym.imp.WS2_32.dll_setsockopt]
cmp eax, 0xffffffff
jne 0x42c715
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push str.WAR:_setsockopt_send_timeout_500ms_err_d__continue..._n
push 0x5f912c
call fcn.0040c230
add esp, 0xc
push 4
lea eax, [ebp - 0x4c]
push eax
push 0x1006
push 0xffff
mov ecx, dword [ebp - 0x19c]
mov edx, dword [ecx]
push edx
call dword [sym.imp.WS2_32.dll_setsockopt]
cmp eax, 0xffffffff
jne 0x42c752
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push str.WAR:_setsockopt_receive_timeout_500ms_err_d__continue..._n
push 0x5f91d8
call fcn.0040c230
add esp, 0xc
mov byte [ebp - 0x19], 1
push 1
lea eax, [ebp - 0x19]
push eax
push 1
push 6
mov ecx, dword [ebp - 0x19c]
mov edx, dword [ecx]
push edx
call dword [sym.imp.WS2_32.dll_setsockopt]
cmp eax, 0xffffffff
jne 0x42c78d
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push str.WAR:_setsockopt_tcp_no_delay_err_d__continue..._n
push 0x5f9278
call fcn.0040c230
add esp, 0xc
xor eax, eax
mov dword [ebp - 0x16c], eax
mov dword [ebp - 0x168], eax
mov dword [ebp - 0x164], eax
mov dword [ebp - 0x160], eax
mov ecx, 2
mov word [ebp - 0x16c], cx
movzx edx, word [ebp + 0xc]
push edx
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x16a], ax
mov eax, dword [ebp + 8]
push eax
call sub.WS2_32.dll_inet_addr
mov dword [ebp - 0x168], eax
mov dword [ebp - 0x18], 1
lea ecx, [ebp - 0x18]
push ecx
push 0x8004667e
mov edx, dword [ebp - 0x19c]
mov eax, dword [edx]
push eax
call dword [sym.imp.WS2_32.dll_ioctlsocket]
cmp eax, 0xffffffff
jne 0x42c816
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push str.Err:_async_ioctlsocket___set_nonblock__err_d_break__n
push 0x5f9320
call fcn.0040c230
add esp, 0xc
jmp 0x42cb76
push 0x10
lea ecx, [ebp - 0x16c]
push ecx
mov edx, dword [ebp - 0x19c]
mov eax, dword [edx]
push eax
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x42c85e
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
je 0x42c85e
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push str.WAR:_connect___err_d_break__n
push 0x5f9394
call fcn.0040c230
add esp, 0xc
jmp 0x42cb76
mov dword [ebp - 0x190], 1
mov dword [ebp - 0x18c], 0
mov dword [ebp - 0x15c], 0
mov dword [ebp - 0x194], 0
jmp 0x42c897
mov ecx, dword [ebp - 0x194]
add ecx, 1
mov dword [ebp - 0x194], ecx
mov edx, dword [ebp - 0x194]
cmp edx, dword [ebp - 0x15c]
jae 0x42c8c0
mov eax, dword [ebp - 0x194]
mov ecx, dword [ebp - 0x19c]
mov edx, dword [ebp + eax*4 - 0x158]
cmp edx, dword [ecx]
jne 0x42c8be
jmp 0x42c8c0
jmp 0x42c888
mov eax, dword [ebp - 0x194]
cmp eax, dword [ebp - 0x15c]
jne 0x42c8fb
cmp dword [ebp - 0x15c], 0x40
jae 0x42c8fb
mov ecx, dword [ebp - 0x194]
mov edx, dword [ebp - 0x19c]
mov eax, dword [edx]
mov dword [ebp + ecx*4 - 0x158], eax
mov ecx, dword [ebp - 0x15c]
add ecx, 1
mov dword [ebp - 0x15c], ecx
xor edx, edx
jne 0x42c87c
lea eax, [ebp - 0x190]
push eax
push 0
lea ecx, [ebp - 0x15c]
push ecx
push 0
push 0
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
jg 0x42c93f
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push str.WAR:_async_select____err_d_break__n
push 0x5f9414
call fcn.0040c230
add esp, 0xc
jmp 0x42cb76
mov dword [ebp - 0x18], 0
lea edx, [ebp - 0x18]
push edx
push 0x8004667e
mov eax, dword [ebp - 0x19c]
mov ecx, dword [eax]
push ecx
call dword [sym.imp.WS2_32.dll_ioctlsocket]
cmp eax, 0xffffffff
jne 0x42c981
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push str.WAR:_ioctlsocket___set_block__err_d_break__n
push 0x5f94a4
call fcn.0040c230
add esp, 0xc
jmp 0x42cb76
mov edx, dword [ebp + 0xc]
push edx
mov eax, dword [ebp + 8]
push eax
push str.Tip:_Reconnect_to_report_server_successed__ip_S__port_d
push 0x5f9550
call fcn.0040c230
add esp, 0x10
mov dword [ebp - 0x10], 1
push 0xc8
push 0x7530
mov ecx, dword [ebp - 0x19c]
mov edx, dword [ecx]
push edx
mov ecx, dword [ebp - 0x19c]
call fcn.0042c450
mov dword [ebp - 0x38], eax
cmp dword [ebp - 0x38], 0
je 0x42c9d5
mov dword [ebp - 0x1b0], 0x5f9584
jmp 0x42c9df
mov dword [ebp - 0x1b0], 0x5f9590
mov eax, dword [ebp - 0x1b0]
push eax
push str.Tip:_SetSocketTcpAlive_1s_30s_ret_s...
push 0x5f959c
call fcn.0040c230
add esp, 0xc
xor ecx, ecx
mov word [ebp - 0x48], cx
xor edx, edx
mov dword [ebp - 0x46], edx
mov dword [ebp - 0x42], edx
mov dword [ebp - 0x3e], edx
mov word [ebp - 0x3a], dx
mov dword [ebp - 0x50], 0x10
lea eax, [ebp - 0x50]
push eax
lea ecx, [ebp - 0x48]
push ecx
mov edx, dword [ebp - 0x19c]
mov eax, dword [edx]
push eax
call dword [sym.imp.WS2_32.dll_getsockname]
mov dword [ebp - 0x34], eax
cmp dword [ebp - 0x34], 0
je 0x42ca52
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push str.WAR:_getsockname___err_d_break__n
push 0x5f9668
call fcn.0040c230
add esp, 0xc
jmp 0x42cb76
mov byte [ebp - 0x30], 0
xor ecx, ecx
mov dword [ebp - 0x2f], ecx
mov dword [ebp - 0x2b], ecx
mov dword [ebp - 0x27], ecx
mov word [ebp - 0x23], cx
mov byte [ebp - 0x21], cl
mov edx, dword [ebp - 0x44]
push edx
call dword [sym.imp.WS2_32.dll_inet_ntoa]
push eax
lea eax, [ebp - 0x30]
push eax
call fcn.00431e20
add esp, 8
lea ecx, [ebp - 0x30]
push ecx
mov ecx, dword [ebp - 0x19c]
add ecx, 4
call fcn.00406110
push 0
push 1
mov edx, dword [0x6404c0]
push edx
call dword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
movzx eax, word [ebp - 0x46]
push eax
call dword [sym.imp.WS2_32.dll_ntohs]
movzx ecx, ax
push ecx
mov ecx, dword [ebp - 0x19c]
add ecx, 4
call fcn.00406190
push eax
push str.Tip:_Reconnect_using_local_IP_S__port_d_...
push 0x5f9704
call fcn.0040c230
add esp, 0x10
lea ecx, [ebp - 0x188]
call fcn.00406020
mov dword [ebp - 4], 0
lea edx, [ebp - 0x188]
push edx
mov eax, dword [ebp - 0x19c]
add eax, 0x20
push eax
mov ecx, dword [ebp - 0x19c]
add ecx, 0x3c
push ecx
mov edx, dword [ebp - 0x19c]
add edx, 4
push edx
call fcn.0040cbf0
add esp, 0x10
lea ecx, [ebp - 0x188]
call fcn.00406190
push eax
mov ecx, dword [ebp - 0x19c]
add ecx, 0x20
call fcn.00406190
push eax
mov ecx, dword [ebp - 0x19c]
add ecx, 0x3c
call fcn.00406190
push eax
mov ecx, dword [ebp - 0x19c]
add ecx, 4
call fcn.00406190
push eax
push str.TIP:_Find_ip_S_gateway_S_belong_ethernet_guid_S__descript_S...
push 0x5f97c4
call fcn.0040c230
add esp, 0x18
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x188]
call fcn.004060d0
xor eax, eax
jne 0x42c5af
cmp dword [ebp - 0x10], 0
je 0x42cc94
cmp dword [ebp + 8], 0
je 0x42cc94
mov ecx, dword [ebp + 8]
mov dword [ebp - 0x1b4], ecx
mov edx, dword [ebp - 0x1b4]
add edx, 1
mov dword [ebp - 0x1b8], edx
mov eax, dword [ebp - 0x1b4]
mov cl, byte [eax]
mov byte [ebp - 0x1b9], cl
add dword [ebp - 0x1b4], 1
cmp byte [ebp - 0x1b9], 0
jne 0x42cba2
mov edx, dword [ebp - 0x1b4]
sub edx, dword [ebp - 0x1b8]
mov dword [ebp - 0x1c0], edx
je 0x42cc94
push 0xc8
mov ecx, dword [ebp - 0x19c]
add ecx, 0x3c
call fcn.00406190
push eax
call fcn.0040e120
add esp, 8
mov dword [ebp - 0x198], eax
cmp dword [ebp - 0x198], 0
je 0x42cc0f
mov dword [ebp - 0x1c4], 0x5f97f8
jmp 0x42cc19
mov dword [ebp - 0x1c4], 0x5f9804
mov eax, dword [ebp - 0x1c4]
push eax
mov ecx, dword [ebp - 0x19c]
add ecx, 0x3c
call fcn.00406190
push eax
push str.Tip:_Reconnected_router_IP_S_ICMP_test_ret_s_...
push 0x5f987c
call fcn.0040c230
add esp, 0x10
push 0xc8
mov ecx, dword [ebp + 8]
push ecx
call fcn.0040e120
add esp, 8
mov dword [ebp - 0x198], eax
cmp dword [ebp - 0x198], 0
je 0x42cc6d
mov dword [ebp - 0x1c8], 0x5f98b0
jmp 0x42cc77
mov dword [ebp - 0x1c8], 0x5f98bc
mov edx, dword [ebp - 0x1c8]
push edx
mov eax, dword [ebp + 8]
push eax
push str.Tip:_Reconnected_target_host_IP_S_ICMP_test_ret_s_...
push str.CSafeLogging::CTcpCommunicator::ReConnectReportSrv
call fcn.0040c230
add esp, 0x10
cmp dword [ebp - 0x14], 0
je 0x42ccd8
cmp dword [ebp - 0x10], 0
jne 0x42ccc6
mov ecx, dword [ebp - 0x19c]
cmp dword [ecx], 0
jbe 0x42ccc6
mov edx, dword [ebp - 0x19c]
mov eax, dword [edx]
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
mov ecx, dword [ebp - 0x19c]
mov dword [ecx], 0xffffffff
push 0
mov edx, dword [ebp - 0x19c]
add edx, 0x58
push edx
call dword [sym.imp.KERNEL32.dll_InterlockedExchange]
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
mov ecx, dword [ebp - 0x20]
xor ecx, ebp
call fcn.00560c61
mov esp, ebp
pop ebp
ret 8