Function at 0x401540
Capabilities:
Get socket status
Receive data
Receive data on socket

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x3e4
mov eax, dword [0x4a4300]
xor eax, esp
mov dword [esp + 0x3e0], eax
mov eax, dword [0x4ab6f8]
mov ecx, 0x58
or eax, dword [0x4ab6fc]
push ebx
push esi
push edi
mov esi, 0x4ab6f8
lea edi, [esp + 0x20]
rep movsd dword es:[edi], dword [esi]
je 0x40182d
xor ecx, ecx
mov dword [esp + 0x1c], ecx
jmp 0x401590
mov edi, dword [esp + ecx*4 + 0x158]
test edi, edi
je 0x40181f
push 0x3f
lea eax, [esp + 0x3ad]
mov dword [esp + 0x14], 0xffffffff
push 0
push eax
mov byte [esp + 0x3b4], 0
call fcn.004523e0
xorps xmm0, xmm0
mov dword [esp + 0x3a8], 0
add esp, 0xc
movq qword [esp + 0x3a0], xmm0
xor esi, esi
lea esp, [esp]
mov ecx, edi
call fcn.00401460
mov dword [esp + esi*4 + 0x39c], eax
inc esi
cmp esi, 3
jl 0x4015e0
mov esi, dword [esp + 0x39c]
mov ebx, dword [esp + 0x3a4]
mov edi, dword [esp + 0x3a0]
test esi, esi
jne 0x401619
test edi, edi
jne 0x401619
test ebx, ebx
je 0x4017ed
call fcn.0040fd80
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], edx
call fcn.0040fd80
sub eax, dword [esp + 0x14]
sbb edx, dword [esp + 0x18]
test edx, edx
jg 0x4017ed
jl 0x401648
cmp eax, 0xbb8
ja 0x4017ed
test esi, esi
jne 0x401658
test edi, edi
jne 0x401658
test ebx, ebx
je 0x4017ed
push 0x100
lea eax, [esp + 0x298]
push 0
push eax
call fcn.004523e0
add esp, 0xc
lea eax, [esp + 0x18c]
xor esi, esi
mov dword [esp + 0x290], esi
push 0x100
push esi
push eax
call fcn.004523e0
xor edx, edx
add esp, 0xc
mov dword [esp + 0x184], edx
xor edi, edi
mov dword [esp + 0x188], edx
mov dword [esp + 0x180], edx
mov dword [esp + 0x184], 0x64
mov ecx, dword [esp + edi*4 + 0x39c]
test ecx, ecx
je 0x401723
xor eax, eax
test esi, esi
je 0x4016d1
cmp dword [esp + eax*4 + 0x294], ecx
je 0x4016d1
inc eax
cmp eax, esi
jb 0x4016c3
cmp eax, esi
jne 0x4016f0
cmp esi, 0x40
jae 0x4016f0
mov dword [esp + eax*4 + 0x294], ecx
mov esi, dword [esp + 0x290]
inc esi
mov dword [esp + 0x290], esi
xor eax, eax
test edx, edx
je 0x401704
cmp dword [esp + eax*4 + 0x18c], ecx
je 0x401704
inc eax
cmp eax, edx
jb 0x4016f6
cmp eax, edx
jne 0x401723
cmp edx, 0x40
jae 0x401723
mov dword [esp + eax*4 + 0x18c], ecx
mov edx, dword [esp + 0x188]
inc edx
mov dword [esp + 0x188], edx
inc edi
cmp edi, 3
jl 0x4016b2
lea eax, [esp + 0x180]
push eax
lea eax, [esp + 0x18c]
push eax
push 0
lea eax, [esp + 0x29c]
push eax
push 0
call dword [sym.imp.WS2_32.dll_select]
xor edi, edi
lea ecx, [ecx]
mov esi, dword [esp + edi*4 + 0x39c]
test esi, esi
je 0x4017a6
push 0
push 0x40
lea eax, [esp + 0x3b0]
push eax
push esi
call dword [sym.imp.WS2_32.dll_recv]
test eax, eax
je 0x401794
cmp eax, 0x14
je 0x4017e0
cmp eax, 0xffffffff
jne 0x4017a6
mov ebx, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call ebx
cmp eax, 0x2733
je 0x4017a6
call ebx
cmp eax, 0x2749
je 0x4017a6
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [esp + edi*4 + 0x39c], 0
inc edi
cmp edi, 3
jl 0x401750
call fcn.0040fd80
sub eax, dword [esp + 0x14]
sbb edx, dword [esp + 0x18]
test edx, edx
jg 0x4017ed
jl 0x4017c6
cmp eax, 0xbb8
ja 0x4017ed
mov ebx, dword [esp + 0x3a4]
mov edi, dword [esp + 0x3a0]
mov esi, dword [esp + 0x39c]
jmp 0x401648
call fcn.0040fd80
mov ebx, eax
sub ebx, dword [esp + 0x14]
jmp 0x4017f1
mov ebx, dword [esp + 0x10]
xor esi, esi
mov eax, dword [esp + esi*4 + 0x39c]
test eax, eax
je 0x401810
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [esp + esi*4 + 0x39c], 0
inc esi
cmp esi, 3
jl 0x4017f3
cmp ebx, 0xffffffff
jne 0x401844
mov ecx, dword [esp + 0x1c]
inc ecx
mov dword [esp + 0x1c], ecx
cmp ecx, 0xa
jb 0x401590
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x3e0]
xor ecx, esp
call fcn.004516e1
mov esp, ebp
pop ebp
ret
mov ecx, dword [esp + 0x3ec]
mov eax, ebx
pop edi
cdq
pop esi
sub eax, edx
pop ebx
xor ecx, esp
sar eax, 1
call fcn.004516e1
mov esp, ebp
pop ebp
ret