Function at 0x4014a0
Capabilities:
Connect socket
Get socket status
Receive data
Receive data on socket

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x3f4
mov eax, dword [0x4a2300]
xor eax, esp
mov dword [esp + 0x3f0], eax
mov eax, dword [0x4a9430]
mov ecx, 0x58
or eax, dword [0x4a9434]
push ebx
push esi
push edi
mov esi, 0x4a9430
lea edi, [esp + 0x20]
rep movsd dword es:[edi], dword [esi]
je 0x40180d
xor ecx, ecx
mov dword [esp + 0x1c], ecx
jmp 0x4014f0
mov ebx, dword [esp + ecx*4 + 0x158]
test ebx, ebx
je 0x4017ff
push 0x3f
lea eax, [esp + 0x3bd]
mov dword [esp + 0x14], 0xffffffff
push 0
push eax
mov byte [esp + 0x3c4], 0
call fcn.00451650
xorps xmm0, xmm0
mov dword [esp + 0x3b8], 0
add esp, 0xc
movq qword [esp + 0x3b0], xmm0
xor edi, edi
lea esp, [esp]
xor edx, edx
xor ecx, ecx
call fcn.0040f220
mov esi, eax
test esi, esi
je 0x4015c1
xorps xmm0, xmm0
mov dword [esp + 0x192], 0
mov eax, 2
movq qword [esp + 0x18a], xmm0
push 0xfff2
mov word [esp + 0x19a], 0
mov word [esp + 0x18c], ax
call dword [sym.imp.WS2_32.dll_htons]
mov word [esp + 0x18a], ax
lea eax, [esp + 0x188]
push 0x10
push eax
push esi
mov dword [esp + 0x198], ebx
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x4015c3
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
je 0x4015c3
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
xor esi, esi
mov dword [esp + edi*4 + 0x3ac], esi
inc edi
cmp edi, 3
jl 0x401540
mov esi, dword [esp + 0x3ac]
mov ebx, dword [esp + 0x3b4]
mov edi, dword [esp + 0x3b0]
test esi, esi
jne 0x4015f9
test edi, edi
jne 0x4015f9
test ebx, ebx
je 0x4017cd
call fcn.0040ee00
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], edx
call fcn.0040ee00
sub eax, dword [esp + 0x14]
sbb edx, dword [esp + 0x18]
test edx, edx
jg 0x4017cd
jl 0x401628
cmp eax, 0xbb8
ja 0x4017cd
test esi, esi
jne 0x401638
test edi, edi
jne 0x401638
test ebx, ebx
je 0x4017cd
push 0x100
lea eax, [esp + 0x2a8]
push 0
push eax
call fcn.00451650
add esp, 0xc
lea eax, [esp + 0x19c]
xor esi, esi
mov dword [esp + 0x2a0], esi
push 0x100
push esi
push eax
call fcn.00451650
xor edx, edx
add esp, 0xc
mov dword [esp + 0x184], edx
xor edi, edi
mov dword [esp + 0x198], edx
mov dword [esp + 0x180], edx
mov dword [esp + 0x184], 0x64
mov ecx, dword [esp + edi*4 + 0x3ac]
test ecx, ecx
je 0x401703
xor eax, eax
test esi, esi
je 0x4016b1
cmp dword [esp + eax*4 + 0x2a4], ecx
je 0x4016b1
inc eax
cmp eax, esi
jb 0x4016a3
cmp eax, esi
jne 0x4016d0
cmp esi, 0x40
jae 0x4016d0
mov dword [esp + eax*4 + 0x2a4], ecx
mov esi, dword [esp + 0x2a0]
inc esi
mov dword [esp + 0x2a0], esi
xor eax, eax
test edx, edx
je 0x4016e4
cmp dword [esp + eax*4 + 0x19c], ecx
je 0x4016e4
inc eax
cmp eax, edx
jb 0x4016d6
cmp eax, edx
jne 0x401703
cmp edx, 0x40
jae 0x401703
mov dword [esp + eax*4 + 0x19c], ecx
mov edx, dword [esp + 0x198]
inc edx
mov dword [esp + 0x198], edx
inc edi
cmp edi, 3
jl 0x401692
lea eax, [esp + 0x180]
push eax
lea eax, [esp + 0x19c]
push eax
push 0
lea eax, [esp + 0x2ac]
push eax
push 0
call dword [sym.imp.WS2_32.dll_select]
xor edi, edi
lea ecx, [ecx]
mov esi, dword [esp + edi*4 + 0x3ac]
test esi, esi
je 0x401786
push 0
push 0x40
lea eax, [esp + 0x3c0]
push eax
push esi
call dword [sym.imp.WS2_32.dll_recv]
test eax, eax
je 0x401774
cmp eax, 0x14
je 0x4017c0
cmp eax, 0xffffffff
jne 0x401786
mov ebx, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call ebx
cmp eax, 0x2733
je 0x401786
call ebx
cmp eax, 0x2749
je 0x401786
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [esp + edi*4 + 0x3ac], 0
inc edi
cmp edi, 3
jl 0x401730
call fcn.0040ee00
sub eax, dword [esp + 0x14]
sbb edx, dword [esp + 0x18]
test edx, edx
jg 0x4017cd
jl 0x4017a6
cmp eax, 0xbb8
ja 0x4017cd
mov ebx, dword [esp + 0x3b4]
mov edi, dword [esp + 0x3b0]
mov esi, dword [esp + 0x3ac]
jmp 0x401628
call fcn.0040ee00
mov ebx, eax
sub ebx, dword [esp + 0x14]
jmp 0x4017d1
mov ebx, dword [esp + 0x10]
xor esi, esi
mov eax, dword [esp + esi*4 + 0x3ac]
test eax, eax
je 0x4017f0
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [esp + esi*4 + 0x3ac], 0
inc esi
cmp esi, 3
jl 0x4017d3
cmp ebx, 0xffffffff
jne 0x401824
mov ecx, dword [esp + 0x1c]
inc ecx
mov dword [esp + 0x1c], ecx
cmp ecx, 0xa
jb 0x4014f0
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x3f0]
xor ecx, esp
call fcn.0045094b
mov esp, ebp
pop ebp
ret
mov ecx, dword [esp + 0x3fc]
mov eax, ebx
pop edi
cdq
pop esi
sub eax, edx
pop ebx
xor ecx, esp
sar eax, 1
call fcn.0045094b
mov esp, ebp
pop ebp
ret