Function at 0x40a81a
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket
Receive data
Receive data on socket
Resolve dns
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x3c
mov eax, dword [0x445bbc]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
push 0
push 1
push 2
mov esi, ecx
mov dword [ebp - 0x38], eax
call dword [sym.imp.WS2_32.dll_socket]
mov edi, eax
mov dword [ebp - 0x30], edi
cmp edi, 0xffffffff
je 0x40a9c7
push str.client.update.sandai.net
call dword [sym.imp.WS2_32.dll_gethostbyname]
test eax, eax
jne 0x40a86a
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push edi
jmp 0x40a9c1
push 2
pop ecx
mov word [ebp - 0x2c], cx
mov eax, dword [eax + 0xc]
mov eax, dword [eax]
mov eax, dword [eax]
push 0x26d0
mov dword [ebp - 0x28], eax
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x2a], ax
push 0x10
lea eax, [ebp - 0x2c]
push eax
push edi
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
je 0x40a85e
mov edi, dword [esi + 0x14]
add edi, 0x18
je 0x40a9c7
push edi
call fcn.0042842a
pop ecx
push edi
mov ebx, eax
push 0
push ebx
call sub.MSVCR90.dll_memset
mov eax, dword [esi + 0x14]
add esp, 0xc
cmp dword [esi + 0x18], 0x10
jb 0x40a8cb
mov esi, dword [esi + 4]
jmp 0x40a8ce
add esi, 4
test ebx, ebx
je 0x40a8e3
push dword [ebp + 0xc]
mov ecx, ebx
push eax
push esi
mov eax, edi
call fcn.0040a9d8
add esp, 0xc
xor esi, esi
push 0
mov eax, edi
sub eax, esi
push eax
lea eax, [esi + ebx]
push eax
push dword [ebp - 0x30]
call dword [sym.imp.WS2_32.dll_send]
cmp eax, 0xffffffff
je 0x40a9af
add esi, eax
cmp esi, edi
jb 0x40a8e5
push ebx
call sub.MSVCR90.dll_void___cdecl_operator_delete___void__
mov esi, dword [sym.imp.WS2_32.dll_recv]
pop ecx
xor edi, edi
mov ebx, dword [ebp - 0x30]
push 0
push 0x18
pop eax
sub eax, edi
push eax
lea eax, [ebp + edi - 0x1c]
push eax
push ebx
call esi
cmp eax, 0xffffffff
je 0x40a9ba
test eax, eax
je 0x40a9c0
add edi, eax
cmp edi, 0x18
jb 0x40a917
push dword [ebp - 0x14]
call dword [sym.imp.WS2_32.dll_ntohl]
mov dword [ebp - 0x34], eax
test eax, eax
je 0x40a9c0
cmp eax, 0xa00000
ja 0x40a9c0
xor edi, edi
inc eax
push eax
call fcn.0042842a
mov ebx, eax
mov eax, dword [ebp - 0x34]
pop ecx
inc eax
push eax
push edi
push ebx
call sub.MSVCR90.dll_memset
add esp, 0xc
mov eax, dword [ebp - 0x34]
push 0
sub eax, edi
push eax
lea eax, [ebx + edi]
push eax
push dword [ebp - 0x30]
call esi
cmp eax, 0xffffffff
je 0x40a9af
add edi, eax
cmp edi, dword [ebp - 0x34]
jb 0x40a974
push dword [ebp - 0x30]
call dword [sym.imp.WS2_32.dll_closesocket]
mov ecx, dword [ebp - 0x38]
push ebx
call dword [sym.imp.MSVCP90.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::assign_char_const__]
push ebx
call sub.MSVCR90.dll_void___cdecl_operator_delete___void__
pop ecx
mov al, 1
jmp 0x40a9c9
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push dword [ebp - 0x30]
jmp 0x40a9c1
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push ebx
call dword [sym.imp.WS2_32.dll_closesocket]
xor al, al
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0042898c
leave
ret