Function at 0x10016220
Capabilities:
Connect socket
Resolve dns
Set socket configuration

Disassembly:
sub esp, 0x30
mov eax, dword [esp + 0x34]
xorps xmm0, xmm0
push ebx
push ebp
mov ebp, dword [esp + 0x44]
mov ebx, dword [eax + 0x28]
lea eax, [esp + 0x3c]
push edi
mov edi, dword [esp + 0x4c]
push eax
lea eax, [esp + 0x20]
mov dword [esp + 0x10], ebx
push eax
push edi
push ebp
mov dword [esp + 0x2c], 0
movlpd qword [esp + 0x3c], xmm0
movlpd qword [esp + 0x44], xmm0
mov dword [esp + 0x30], 2
mov dword [esp + 0x34], 1
mov dword [esp + 0x38], 6
call dword [sym.imp.WS2_32.dll_getaddrinfo]
test eax, eax
je 0x100162a4
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push edi
push ebp
lea eax, [ebx + 0x80a4]
push str._s:_s_bad_server_address__wsa:__d_
push eax
call fcn.10018fa0
add esp, 0x14
xor eax, eax
pop edi
pop ebp
pop ebx
add esp, 0x30
ret
push esi
mov esi, dword [esp + 0x44]
test esi, esi
je 0x100162d6
mov eax, dword [esp + 0x2c]
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x24]
nop dword [eax]
cmp dword [esi + 4], edx
jne 0x100162cf
cmp dword [esi + 8], ecx
jne 0x100162cf
cmp dword [esi + 0xc], eax
je 0x10016300
mov esi, dword [esi + 0x1c]
test esi, esi
jne 0x100162c0
push edi
push ebp
push str._s:_s_no_acceptable_server_address
lea eax, [ebx + 0x80a4]
push eax
call fcn.10018fa0
add esp, 0x10
push dword [esp + 0x44]
call dword [sym.imp.WS2_32.dll_freeaddrinfo]
pop esi
pop edi
pop ebp
xor eax, eax
pop ebx
add esp, 0x30
ret
mov ebx, dword [esp + 0x48]
lea ecx, [esp + 0x18]
push ecx
mov dword [esp + 0x1c], 0x40
lea eax, [ebx + 0x10]
push eax
push 0
push dword [esi + 0x10]
mov dword [esp + 0x2c], eax
push dword [esi + 0x18]
call dword [sym.imp.WS2_32.dll_WSAAddressToStringA]
test eax, eax
mov eax, dword [esp + 0x10]
je 0x10016360
push edi
push ebp
add eax, 0x80a4
push str._s:_s_failed_to_get_server_address_string
push eax
call fcn.10018fa0
add esp, 0x10
push dword [esp + 0x44]
call dword [sym.imp.WS2_32.dll_freeaddrinfo]
mov ebp, dword [esp + 0x1c]
xor eax, eax
pop esi
pop edi
mov byte [ebp], 0
pop ebp
pop ebx
add esp, 0x30
ret
lea edi, [eax + 0x84a4]
add eax, 0x1808954
mov dword [esp + 0x1c], eax
lea ebp, [ebx + 0x10]
cmp edi, eax
jae 0x100163b8
cmp dword [edi + 8], 0xffffffff
je 0x100163ae
mov ecx, ebp
lea eax, [edi + 0x10]
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x100163a1
test dl, dl
je 0x1001639d
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x100163a1
add eax, 2
add ecx, 2
test dl, dl
jne 0x10016381
xor eax, eax
jmp 0x100163a6
sbb eax, eax
or eax, 1
test eax, eax
je 0x100163f7
mov eax, dword [esp + 0x1c]
add edi, 0x200064
cmp edi, eax
jb 0x10016376
mov eax, dword [ebx + 0x54]
test eax, eax
je 0x100163c8
push eax
call fcn.100b813d
add esp, 4
mov eax, dword [esi + 0x10]
push eax
mov dword [ebx + 0x58], eax
call fcn.100b8158
add esp, 4
mov dword [ebx + 0x54], eax
test eax, eax
jne 0x10016423
mov eax, dword [esp + 0x10]
push str.connection_address
push ebp
push str._s_failed_to_allocate_memory_for__s
add eax, 0x80a4
jmp 0x100162e3
mov eax, dword [esp + 0x10]
push ebp
add eax, 0x80a4
push str._s_already_connected_to_server
push eax
call fcn.10018fa0
add esp, 0xc
push dword [esp + 0x44]
call dword [sym.imp.WS2_32.dll_freeaddrinfo]
pop esi
pop edi
pop ebp
xor eax, eax
pop ebx
add esp, 0x30
ret
push dword [esi + 0x10]
push dword [esi + 0x18]
push eax
call fcn.100aff00
add esp, 0xc
push dword [esi + 0xc]
push dword [esi + 8]
push dword [esi + 4]
call dword [sym.imp.WS2_32.dll_socket]
mov dword [ebx + 8], eax
cmp eax, 0xffffffff
jne 0x10016464
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
mov eax, dword [esp + 0x14]
push ebp
push str._s_failed_to_create_server_socket__wsa:__d_
add eax, 0x80a4
jmp 0x100162e3
lea ecx, [esp + 0x14]
mov dword [esp + 0x14], 1
push ecx
push 0x8004667e
push eax
call dword [sym.imp.WS2_32.dll_ioctlsocket]
test eax, eax
jne 0x10016530
cmp dword [esp + 0x14], eax
je 0x10016530
push dword [esi + 0x10]
push dword [esi + 0x18]
push dword [ebx + 8]
call dword [sym.imp.WS2_32.dll_connect]
test eax, eax
je 0x100164ef
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov esi, eax
cmp esi, 0x2733
je 0x100164f3
mov eax, dword [esp + 0x10]
push esi
push ebp
add eax, 0x80a4
push str._s_failed_to_start_connecting_to_server__wsa:__d_
push eax
call fcn.10018fa0
add esp, 0x10
push dword [ebx + 8]
call dword [sym.imp.WS2_32.dll_closesocket]
push dword [esp + 0x44]
mov dword [ebx + 8], 0xffffffff
call dword [sym.imp.WS2_32.dll_freeaddrinfo]
pop esi
pop edi
pop ebp
xor eax, eax
pop ebx
add esp, 0x30
ret
mov esi, dword [esp + 0x44]
push dword [esp + 0x44]
call dword [sym.imp.WS2_32.dll_freeaddrinfo]
mov ecx, dword [ebx]
or ecx, 1
cmp dword [esp + 0x54], 0
mov dword [ebx], ecx
je 0x10016510
or ecx, 2
mov dword [ebx], ecx
cmp esi, 0x2733
je 0x1001651d
or ecx, 4
mov dword [ebx], ecx
mov ecx, dword [0xc1a9b4]
mov eax, ebx
pop esi
pop edi
pop ebp
mov dword [ebx + 0xc], ecx
pop ebx
add esp, 0x30
ret
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
mov eax, dword [esp + 0x14]
push ebp
add eax, 0x80a4
push str._s_failed_to_setup_non_blocking_socket__wsa:__d_
push eax
call fcn.10018fa0
add esp, 0x10
push dword [ebx + 8]
call dword [sym.imp.WS2_32.dll_closesocket]
push dword [esp + 0x44]
mov dword [ebx + 8], 0xffffffff
call dword [sym.imp.WS2_32.dll_freeaddrinfo]
pop esi
pop edi
pop ebp
xor eax, eax
pop ebx
add esp, 0x30
ret