Function at 0x40b500
Capabilities:
Connect socket
Get socket status
Resolve dns
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x418605
mov eax, dword fs:[0]
push eax
sub esp, 0x388
mov eax, dword [0x42000c]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
mov eax, dword [ebp + 8]
lea ecx, [ebp - 0x48]
mov dword [ebp - 4], 0
xorps xmm0, xmm0
movlpd qword [ebp - 0x58], xmm0
movlpd qword [ebp - 0x50], xmm0
mov dword [ebp - 0x64], eax
mov dword [ebp - 0x60], 1
mov dword [ebp - 0x68], 0
mov dword [ebp - 0x5c], 0
call fcn.004014b0
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x388]
cmp dword [ebp - 0x34], 0x10
lea eax, [ebp - 0x48]
push ecx
cmovae eax, dword [ebp - 0x48]
lea ecx, [ebp - 0x68]
push ecx
push eax
push esi
call dword [sym.imp.WS2_32.dll_getaddrinfo]
test eax, eax
jne 0x40b7d1
mov ebx, dword [ebp - 0x388]
mov dword [ebp - 0x18], ebx
test ebx, ebx
je 0x40b7ca
mov esi, dword [sym.imp.WS2_32.dll_setsockopt]
nop dword [eax + eax]
push 0x80
push 0
push 0
push dword [ebx + 0xc]
push dword [ebx + 8]
push dword [ebx + 4]
call dword [sym.imp.WS2_32.dll_WSASocketW]
mov edi, eax
mov dword [ebp - 0x38c], edi
cmp edi, 0xffffffff
jne 0x40b5f5
push dword [ebx + 0xc]
push dword [ebx + 8]
push dword [ebx + 4]
call dword [sym.imp.WS2_32.dll_socket]
mov edi, eax
mov dword [ebp - 0x38c], eax
cmp edi, 0xffffffff
je 0x40b7b6
cmp byte [ebp + 0x10], 0
je 0x40b60f
push 4
lea eax, [ebp - 0x1c]
mov dword [ebp - 0x1c], 1
push eax
push 1
push 6
push edi
call esi
mov ecx, dword [ebp + 0x38]
test ecx, ecx
je 0x40b622
mov dword [ebp - 0x1c], edi
lea edx, [ebp - 0x1c]
mov eax, dword [ecx]
push edx
call dword [eax + 8]
cmp dword [ebx + 4], 0x17
jne 0x40b63c
push 4
lea eax, [ebp - 0x1c]
mov dword [ebp - 0x1c], 0
push eax
push 0x1b
push 0x29
push edi
call esi
lea eax, [ebp - 0x1c]
mov dword [ebp - 0x1c], 1
push eax
push 0x8004667e
push edi
call dword [sym.imp.WS2_32.dll_ioctlsocket]
push dword [ebx + 0x10]
push dword [ebx + 0x18]
push edi
call dword [sym.imp.WS2_32.dll_connect]
test eax, eax
jns 0x40b762
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
jne 0x40b79f
mov eax, dword [ebp + 0x44]
lea esi, [ebp - 0x174]
mov dword [ebp - 0x170], edi
mov ecx, 0x41
mov dword [ebp - 0x174], 1
mov ebx, dword [eax]
mov eax, dword [ebp + 0x40]
mov dword [ebp - 0x2c], ebx
mov edx, dword [eax]
mov eax, edi
lea edi, [ebp - 0x27c]
mov dword [ebp - 0x20], eax
rep movsd dword es:[edi], dword [esi]
mov ecx, 0x41
mov dword [ebp - 0x30], edx
lea esi, [ebp - 0x174]
lea edi, [ebp - 0x384]
rep movsd dword es:[edi], dword [esi]
lea ecx, [ebp - 0x30]
inc eax
push ecx
lea ecx, [ebp - 0x384]
push ecx
lea ecx, [ebp - 0x27c]
push ecx
lea ecx, [ebp - 0x174]
push ecx
push eax
call dword [sym.imp.WS2_32.dll_select]
mov esi, eax
test esi, esi
jns 0x40b6fd
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
cmp dword [eax], 4
jne 0x40b6fb
mov eax, dword [ebp - 0x20]
jmp 0x40b6c4
test esi, esi
jle 0x40b790
mov ebx, dword [sym.imp.WS2_32.dll___WSAFDIsSet]
lea eax, [ebp - 0x174]
push eax
push dword [ebp - 0x20]
call ebx
test eax, eax
jne 0x40b729
lea eax, [ebp - 0x27c]
push eax
push dword [ebp - 0x20]
call ebx
test eax, eax
je 0x40b790
lea eax, [ebp - 0x28]
mov dword [ebp - 0x24], 0
push eax
lea eax, [ebp - 0x24]
mov dword [ebp - 0x28], 4
push eax
push 0x1007
push 0xffff
push dword [ebp - 0x20]
call dword [sym.imp.WS2_32.dll_getsockopt]
test eax, eax
js 0x40b790
cmp dword [ebp - 0x24], 0
mov edi, dword [ebp - 0x38c]
jne 0x40b796
lea eax, [ebp - 0x18]
mov dword [ebp - 0x18], 0
push eax
push 0x8004667e
push edi
call dword [sym.imp.WS2_32.dll_ioctlsocket]
mov eax, dword [ebp + 0x48]
mov dword [eax], 0
push dword [ebp - 0x388]
call dword [sym.imp.WS2_32.dll_freeaddrinfo]
jmp 0x40b7d4
mov edi, dword [ebp - 0x38c]
mov esi, dword [sym.imp.WS2_32.dll_setsockopt]
mov ebx, dword [ebp - 0x18]
push edi
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, dword [ebp + 0x48]
push edi
mov dword [eax], 2
call dword [sym.imp.WS2_32.dll_closesocket]
mov ebx, dword [ebx + 0x1c]
mov dword [ebp - 0x18], ebx
test ebx, ebx
jne 0x40b5b0
mov ebx, dword [ebp - 0x388]
push ebx
call dword [sym.imp.WS2_32.dll_freeaddrinfo]
or edi, 0xffffffff
mov edx, dword [ebp - 0x34]
cmp edx, 0x10
jb 0x40b80a
mov ecx, dword [ebp - 0x48]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x40b800
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x40b800
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push edx
push ecx
call fcn.00416d22
add esp, 8
mov ecx, dword [ebp + 0x38]
mov dword [ebp - 0x38], 0
mov dword [ebp - 0x34], 0xf
mov byte [ebp - 0x48], 0
test ecx, ecx
je 0x40b834
mov esi, dword [ecx]
lea eax, [ebp + 0x14]
cmp ecx, eax
setne dl
movzx edx, dl
push edx
call dword [esi + 0x10]
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.00416887
mov esp, ebp
pop ebp
ret