Function at 0x403280
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Convert ip address from string
Create tcp socket
Create udp socket
Get socket status
Receive data
Receive data on socket
Send data
Send data on socket
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34c
mov eax, dword [0x44e040]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
push 6
push 1
push 2
mov esi, ecx
mov dword [ebp - 0x34c], 0
mov dword [ebp - 0x124], 0xc
mov dword [ebp - 0x344], 0
call dword [sym.imp.WS2_32.dll_socket]
mov ebx, eax
xorps xmm0, xmm0
mov eax, 2
movups xmmword [0x12aa158], xmm0
push esi
mov word [0x12aa158], ax
call dword [sym.imp.WS2_32.dll_htons]
push 0x12aa15c
push 0x12b0ee0
push 2
mov word [0x12aa15a], ax
call dword [sym.imp.WS2_32.dll_inet_pton]
lea eax, [ebp - 0x128]
mov dword [ebp - 0x128], 1
push eax
push 0x8004667e
push ebx
call dword [sym.imp.WS2_32.dll_ioctlsocket]
mov esi, eax
test esi, esi
je 0x403386
push esi
push ebx
push str.THDATA:_ioctlsocket_on_sockfd__d__failed_with_error:__ld_n
push 2
call fcn.0041c1d3
add esp, 4
push eax
call fcn.004010a0
add esp, 0x10
mov byte [ebp - 0x88], 0
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push esi
push ebx
push str.THDATA:_ioctlsocket_on_sockfd__d__failed_with_error:__ld__SockLasterr__ld_
lea eax, [ebp - 0x88]
push 0x80
push eax
call fcn.00401160
add esp, 0x18
lea ecx, [ebp - 0x88]
call fcn.004020c0
push ebx
call dword [sym.imp.WS2_32.dll_closesocket]
or ebx, 0xffffffff
mov ecx, dword [ebp - 4]
mov eax, ebx
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00413b45
mov esp, ebp
pop ebp
ret
mov edi, dword [sym.imp.WS2_32.dll_WSAGetLastError]
xor ecx, ecx
mov dword [ebp - 0x348], ecx
mov esi, dword [sym.imp.WS2_32.dll___WSAFDIsSet]
test ecx, ecx
jne 0x4033b7
push 0x10
push 0x12aa158
push ebx
call dword [sym.imp.WS2_32.dll_connect]
mov dword [ebp - 0x344], eax
jmp 0x403447
lea eax, [ebp - 0x130]
mov dword [ebp - 0x33c], ebx
push eax
lea eax, [ebp - 0x238]
mov dword [ebp - 0x340], 1
push eax
lea eax, [ebp - 0x340]
mov dword [ebp - 0x234], ebx
push eax
push 0
lea eax, [ebx + 1]
mov dword [ebp - 0x238], 1
push eax
mov dword [ebp - 0x130], 0x78
mov dword [ebp - 0x12c], 0
call dword [sym.imp.WS2_32.dll_select]
cmp eax, 0xffffffff
je 0x4038fa
test eax, eax
je 0x4038b1
lea eax, [ebp - 0x238]
push eax
push ebx
call esi
test eax, eax
jne 0x403865
lea eax, [ebp - 0x340]
push eax
push ebx
call esi
test eax, eax
jne 0x403575
mov eax, dword [ebp - 0x344]
test eax, eax
je 0x4035de
push 0
call fcn.0041c257
add esp, 4
mov edi, eax
mov eax, dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov esi, edx
call eax
push eax
push esi
push edi
push str.__llu__NB_connection_with_the_server_failed___d_..._n
push 2
call fcn.0041c1d3
add esp, 4
push eax
call fcn.004010a0
mov edi, dword [sym.imp.WS2_32.dll_WSAGetLastError]
add esp, 0x14
mov byte [ebp - 0x88], 0
call edi
push eax
push 0x12b0ee0
push str._NB_Conn_with_the_server__s__failed_err__ld_
lea eax, [ebp - 0x88]
push 0x80
push eax
call fcn.00401160
add esp, 0x14
lea ecx, [ebp - 0x88]
call fcn.004020c0
call edi
cmp eax, 0x2733
jne 0x40352c
push 0
mov dword [ebp - 0x348], 1
call fcn.0041c257
add esp, 4
push edx
push eax
push str.__llu_connection_with_the_server_inprogress_n
push 2
call fcn.0041c1d3
add esp, 4
push eax
call fcn.004010a0
add esp, 0x10
mov byte [ebp - 0x88], 0
call edi
push eax
push 0x12b0ee0
push str._NB_Conn_with_the_server__s__In_progress_Err__ld
lea eax, [ebp - 0x88]
push 0x80
push eax
call fcn.00401160
add esp, 0x14
lea ecx, [ebp - 0x88]
call fcn.004020c0
mov ecx, 1
jmp 0x403394
mov esi, dword [ebp - 0x34c]
inc esi
cmp dword [0x6947e0], 0
mov dword [ebp - 0x34c], esi
je 0x403553
mov dword [ebp - 0x124], 5
push 0xbb8
jmp 0x403558
push 0x1388
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, dword [ebp - 0x348]
cmp esi, dword [ebp - 0x124]
jg 0x40395a
jmp 0x403394
push 0
call fcn.0041c257
add esp, 4
mov edi, eax
mov eax, dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov esi, edx
call eax
push eax
push esi
push edi
push str.__llu__NB_Connection_with_the_server_Success_WriteFd_set_Err_ld_n
push 2
call fcn.0041c1d3
add esp, 4
push eax
call fcn.004010a0
mov edi, dword [sym.imp.WS2_32.dll_WSAGetLastError]
add esp, 0x14
mov byte [ebp - 0x88], 0
call edi
push eax
push 0x12b0ee0
push str._NB_Conn_with_the_server__s__success_WriteFd_set__Err_ld
lea eax, [ebp - 0x88]
push 0x80
push eax
call fcn.00401160
add esp, 0x14
lea ecx, [ebp - 0x88]
call fcn.004020c0
mov ecx, ebx
call fcn.00402d70
cmp dword [0x6947e0], 0
je 0x403777
push 0
call fcn.0041c257
add esp, 4
push ebx
push 0x12b0ee0
push edx
push eax
push str.__lu__Infra_compact__NB_connection_established_with_Aggregator__s__sockfd__d_n
push 2
call fcn.0041c1d3
add esp, 4
push eax
call fcn.004010a0
add esp, 0x18
xorps xmm0, xmm0
xor ecx, ecx
mov esi, 0x12
movups xmmword [0x6947e4], xmm0
mov dword [ebp - 0x344], ecx
mov dword [ebp - 0x348], esi
nop dword [eax]
push 0
push esi
lea eax, [ebp - 0x9c]
add eax, ecx
push eax
push ebx
call dword [sym.imp.WS2_32.dll_recv]
test eax, eax
jns 0x4036bb
call edi
cmp eax, 0x2733
jne 0x4036d5
mov ecx, dword [ebp - 0x344]
test esi, esi
jg 0x403640
cmp ecx, 0x12
je 0x403713
push 0
call fcn.0041c257
add esp, 4
push ebx
push 0x12b0ee0
push edx
push eax
push str.__lu__Infra_compact_Sensor_Id_override_fetch_NB___failed_with_aggregator__s__sockfd__d_n
push 2
call fcn.0041c1d3
add esp, 4
push eax
call fcn.004010a0
add esp, 0x18
mov byte [ebp - 0x88], 0
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push ebx
push 0x12b0ee0
push str.Server_Sensor_Id_override_fetch_failed_NB__with_aggregator__s__sockfd__d__err__ld_
jmp 0x40334a
jle 0x403660
mov ecx, dword [ebp - 0x344]
add ecx, eax
sub esi, eax
mov dword [ebp - 0x344], ecx
mov dword [ebp - 0x348], esi
jmp 0x403666
push 0
call fcn.0041c257
add esp, 4
mov edi, eax
mov eax, dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov esi, edx
push dword [ebp - 0x348]
push 0x12
call eax
push eax
push ebx
push esi
push edi
push str.__lu_THDATA:td_rcv_aggr_response_socket__d__recv_with_error:__ld__Maxbytes_d_Recvd_d_n
push 2
call fcn.0041c1d3
add esp, 4
push eax
call fcn.004010a0
add esp, 0x20
jmp 0x403673
movups xmm0, xmmword [ebp - 0x9c]
push 0x41
lea eax, [ebp - 0xe8]
push eax
push 0x6947e4
push 0x17
movups xmmword [0x6947e4], xmm0
call dword [sym.imp.WS2_32.dll_inet_ntop]
mov ax, word [ebp - 0x8c]
push 0
mov word [0x44fdfc], ax
call fcn.0041c257
movzx ecx, word [0x44fdfc]
add esp, 4
push ecx
lea ecx, [ebp - 0xe8]
push ecx
push edx
push eax
push str.__lu__Infra_compact_aggr_conn_mode_NB__Sensor_Id_override__s___Short_SensorId_u_n
push 2
call fcn.0041c1d3
add esp, 4
push eax
call fcn.004010a0
add esp, 0x18
xor ecx, ecx
mov dword [ebp - 0x124], 0x12345678
mov dword [ebp - 0x344], ecx
mov esi, 4
nop
push 0
push esi
lea eax, [ebp - 0x124]
add eax, ecx
push eax
push ebx
call dword [sym.imp.WS2_32.dll_send]
test eax, eax
jns 0x40384a
call edi
cmp eax, 0x2733
jne 0x4039d0
push 0x1f4
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, dword [ebp - 0x344]
test esi, esi
jg 0x403790
cmp ecx, 4
je 0x403373
push 0
call fcn.0041c257
add esp, 4
mov edi, eax
mov esi, edx
call fcn.004248d1
push dword [eax]
push ebx
push esi
push edi
push str.__lu__Infra_compact_signature_write_failed__NB_sockfd__d__err:__d_n
push 2
call fcn.0041c1d3
add esp, 4
push eax
call fcn.004010a0
add esp, 0x18
mov byte [ebp - 0x88], 0
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push str.Server_signature_write_failed_NB_err__ld_._Exiting
lea eax, [ebp - 0x88]
push 0x80
push eax
call fcn.00401160
add esp, 0x10
lea ecx, [ebp - 0x88]
call fcn.004020c0
mov eax, dword [0x12aa16c]
test eax, eax
je 0x4039c2
jmp 0x4039b9
jle 0x4037c3
mov ecx, dword [ebp - 0x344]
add ecx, eax
sub esi, eax
mov dword [ebp - 0x344], ecx
jmp 0x4037c9
push 0
call fcn.0041c257
add esp, 4
mov edi, eax
mov esi, edx
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push esi
push edi
push str.__llu__NB_Connection_with_the_server_failed_select_Exception_set_error__ld_n
push 2
call fcn.0041c1d3
add esp, 4
push eax
call fcn.004010a0
add esp, 0x14
mov byte [ebp - 0x88], 0
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push 0x12b0ee0
push str._NB_Conn_with_the_server__s__failed_select_Exception_set_error__ld.._Exiting
jmp 0x403941
push 0
call fcn.0041c257
add esp, 4
mov edi, eax
mov esi, edx
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push esi
push edi
push str.__llu__NB_Connection_with_the_server_timeout_select_error__ld_n
push 2
call fcn.0041c1d3
add esp, 4
push eax
call fcn.004010a0
add esp, 0x14
mov byte [ebp - 0x88], 0
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push 0x12b0ee0
push str._NB_Conn_with_the_server__s__timeout_select_error__ld.._Exiting
jmp 0x403941
push 0
call fcn.0041c257
add esp, 4
mov edi, eax
mov esi, edx
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push esi
push edi
push str.__llu__NB_Connection_with_the_server_failed_select_error__ld_n
push 2
call fcn.0041c1d3
add esp, 4
push eax
call fcn.004010a0
add esp, 0x14
mov byte [ebp - 0x88], 0
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push 0x12b0ee0
push str._NB_Conn_with_the_server__s__failed_select_error__ld.._Exiting
lea eax, [ebp - 0x88]
push 0x80
push eax
call fcn.00401160
add esp, 0x14
jmp 0x40382d
push 0
call fcn.0041c257
add esp, 4
push esi
push edx
push eax
push str.__llu__NB_connection_with_the_server_failed_multiple_times.._retry_attempt___d_..._n
push 2
call fcn.0041c1d3
add esp, 4
push eax
call fcn.004010a0
add esp, 0x14
mov byte [ebp - 0x88], 0
lea eax, [ebp - 0x88]
push esi
push 0x12b0ee0
push str._NB_Conn_with_the_server__s__failed_multiple_times__d_._Exiting
push 0x80
push eax
call fcn.00401160
add esp, 0x14
lea ecx, [ebp - 0x88]
call fcn.004020c0
mov eax, dword [0x12aa16c]
test eax, eax
je 0x4039c2
push eax
call fcn.00420137
add esp, 4
push ebx
call dword [sym.imp.WS2_32.dll_closesocket]
push 1
call fcn.0041c620
push 0
call fcn.0041c257
add esp, 4
mov edi, eax
mov esi, edx
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push dword [0x44fde8]
push esi
push edi
push str.THDATA:__u___NB_Dispatch_to_server_failed_sock__d__connection_error__ld__n
push 2
call fcn.0041c1d3
add esp, 4
push eax
call fcn.004010a0
add esp, 0x18
mov byte [ebp - 0x120], 0
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push ebx
push str._NB_Send_failed_on_sock__d___err__ld_
lea eax, [ebp - 0x120]
push 0x80
push eax
call fcn.00401160
add esp, 0x14
lea ecx, [ebp - 0x120]
call fcn.004020c0
mov eax, dword [0x12aa16c]
test eax, eax
je 0x403a4a
push eax
call fcn.00420137
add esp, 4
push dword [0x44fde8]
call dword [sym.imp.WS2_32.dll_closesocket]
push 1
call fcn.0041c620
int3