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

Disassembly:
sub esp, 0x51c
push ebx
push ebp
push esi
mov esi, dword [esp + 0x52c]
cmp esi, 0xffffffff
push edi
jne 0x408013
or eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x51c
ret
mov eax, dword [esp + 0x534]
xor ebp, ebp
cmp eax, ebp
jne 0x40802e
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x51c
ret
mov edi, dword [esp + 0x53c]
mov ebx, 3
mov dword [esp + 0x10], ebp
cmp edi, ebp
mov dword [esp + 0x2c], esi
mov dword [esp + 0x28], 1
jl 0x408093
mov eax, 0x10624dd3
mov ecx, 0x3e8
imul edi
sar edx, 6
mov eax, edx
mov dword [esp + 0x18], ebp
shr eax, 0x1f
add edx, eax
mov eax, edi
mov dword [esp + 0x14], edx
cdq
idiv ecx
lea ecx, [esp + 0x28]
lea eax, [edx + edx*4]
lea eax, [eax + eax*4]
lea edx, [eax + eax*4]
lea eax, [esp + 0x14]
shl edx, 3
push eax
mov dword [esp + 0x1c], edx
push ebp
push ebp
lea edx, [esi + 1]
push ecx
push edx
jmp 0x40809f
push ebp
push ebp
lea eax, [esp + 0x30]
push ebp
lea ecx, [esi + 1]
push eax
push ecx
call sub.WS2_32.dll_select
cmp eax, ebp
je 0x408116
cmp eax, 0xffffffff
je 0x408102
mov edx, dword [esp + 0x10]
push ebp
push ebx
lea eax, [esp + edx + 0x24]
push eax
push esi
call sub.WS2_32.dll_recv
cmp eax, ebp
je 0x4082c0
cmp eax, 0xffffffff
je 0x408102
mov ecx, dword [esp + 0x10]
sub ebx, eax
add ecx, eax
cmp ebx, ebp
mov dword [esp + 0x10], ecx
jg 0x40803e
mov cl, byte [esp + 0x1e]
mov bl, byte [esp + 0x1d]
mov dl, byte [esp + 0x1c]
and cl, bl
and cl, dl
cmp cl, 0xff
je 0x408126
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x51c
ret
call sub.WS2_32.dll_WSAGetLastError
cmp eax, ebp
je 0x4080df
cmp eax, 0x5b4
jne 0x40833b
pop edi
pop esi
pop ebp
mov eax, 0x3908
pop ebx
add esp, 0x51c
ret
lea edi, [edi + edi*4]
mov dword [esp + 0x20], ebp
mov ebx, 4
mov dword [esp + 0x10], ebp
lea edi, [edi + edi*4]
shl edi, 2
cmp edi, ebp
mov dword [esp + 0x2c], esi
mov dword [esp + 0x28], 1
jl 0x408191
mov eax, 0x10624dd3
mov ecx, 0x3e8
imul edi
sar edx, 6
mov eax, edx
mov dword [esp + 0x18], ebp
shr eax, 0x1f
add edx, eax
mov eax, edi
mov dword [esp + 0x14], edx
cdq
idiv ecx
lea ecx, [esp + 0x28]
lea eax, [edx + edx*4]
lea eax, [eax + eax*4]
lea edx, [eax + eax*4]
lea eax, [esp + 0x14]
shl edx, 3
push eax
mov dword [esp + 0x1c], edx
push ebp
push ebp
lea edx, [esi + 1]
push ecx
push edx
jmp 0x40819d
push ebp
push ebp
lea eax, [esp + 0x30]
push ebp
lea ecx, [esi + 1]
push eax
push ecx
call sub.WS2_32.dll_select
cmp eax, ebp
je 0x4082b0
cmp eax, 0xffffffff
je 0x4081e3
mov edx, dword [esp + 0x10]
push ebp
push ebx
lea eax, [esp + edx + 0x28]
push eax
push esi
call sub.WS2_32.dll_recv
cmp eax, ebp
je 0x4082c0
cmp eax, 0xffffffff
je 0x4081e3
mov ecx, dword [esp + 0x10]
sub ebx, eax
add ecx, eax
cmp ebx, ebp
mov dword [esp + 0x10], ecx
jg 0x40813c
jmp 0x4081f0
call sub.WS2_32.dll_WSAGetLastError
cmp eax, ebp
jne 0x40833b
cmp dword [esp + 0x20], ebp
jg 0x408204
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x51c
ret
mov dword [esp + 0x24], ebp
mov ebx, 4
mov dword [esp + 0x10], ebp
cmp edi, ebp
mov dword [esp + 0x2c], esi
mov dword [esp + 0x28], 1
jl 0x408266
mov eax, 0x10624dd3
mov dword [esp + 0x18], ebp
imul edi
sar edx, 6
mov ecx, edx
mov eax, edi
shr ecx, 0x1f
add edx, ecx
mov ecx, 0x3e8
mov dword [esp + 0x14], edx
cdq
idiv ecx
lea ecx, [esp + 0x28]
lea eax, [edx + edx*4]
lea eax, [eax + eax*4]
lea edx, [eax + eax*4]
lea eax, [esp + 0x14]
shl edx, 3
push eax
mov dword [esp + 0x1c], edx
push ebp
push ebp
lea edx, [esi + 1]
push ecx
push edx
jmp 0x408272
push ebp
push ebp
lea eax, [esp + 0x30]
push ebp
lea ecx, [esi + 1]
push eax
push ecx
call sub.WS2_32.dll_select
cmp eax, ebp
je 0x4082b0
cmp eax, 0xffffffff
je 0x4082d0
mov edx, dword [esp + 0x10]
push ebp
push ebx
lea eax, [esp + edx + 0x2c]
push eax
push esi
call sub.WS2_32.dll_recv
cmp eax, ebp
je 0x4082c0
cmp eax, 0xffffffff
je 0x4082d0
mov ecx, dword [esp + 0x10]
sub ebx, eax
add ecx, eax
cmp ebx, ebp
mov dword [esp + 0x10], ecx
jg 0x408211
jmp 0x4082d9
pop edi
pop esi
pop ebp
mov eax, 0x5b4
pop ebx
add esp, 0x51c
ret
pop edi
pop esi
pop ebp
mov eax, 0x2746
pop ebx
add esp, 0x51c
ret
call sub.WS2_32.dll_WSAGetLastError
cmp eax, ebp
jne 0x40833b
mov ebx, dword [esp + 0x20]
test ebx, ebx
jle 0x40832c
sub ebx, ebp
cmp ebx, 0x400
jle 0x4082f0
mov ebx, 0x400
push edi
lea ecx, [esp + 0x130]
push ebx
push ecx
push esi
call fcn.00407ec0
add esp, 0x10
test eax, eax
jne 0x40833b
mov edx, dword [esp + 0x534]
lea eax, [esp + 0x12c]
push edx
push ebx
push 1
push eax
call fcn.0040ae44
add ebp, ebx
mov ebx, dword [esp + 0x30]
add esp, 0x10
cmp ebp, ebx
jl 0x4082e1
mov eax, dword [esp + 0x538]
test eax, eax
je 0x408339
mov dword [eax], ebx
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x51c
ret