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

Disassembly:
sub esp, 0x11c
push ebx
push ebp
push esi
mov esi, dword [esp + 0x12c]
cmp esi, 0xffffffff
push edi
jne 0x407ac3
or eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x11c
ret
mov eax, dword [esp + 0x134]
xor ebx, ebx
cmp eax, ebx
jne 0x407ade
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x11c
ret
mov edi, dword [esp + 0x140]
mov ebp, 3
mov dword [esp + 0x10], ebx
cmp edi, ebx
mov dword [esp + 0x2c], esi
mov dword [esp + 0x28], 1
jl 0x407b43
mov eax, 0x10624dd3
mov ecx, 0x3e8
imul edi
sar edx, 6
mov eax, edx
mov dword [esp + 0x1c], ebx
shr eax, 0x1f
add edx, eax
mov eax, edi
mov dword [esp + 0x18], 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 + 0x18]
shl edx, 3
push eax
mov dword [esp + 0x20], edx
push ebx
push ebx
lea edx, [esi + 1]
push ecx
push edx
jmp 0x407b4f
push ebx
push ebx
lea eax, [esp + 0x30]
push ebx
lea ecx, [esi + 1]
push eax
push ecx
call sub.WS2_32.dll_select
cmp eax, ebx
je 0x407bc6
cmp eax, 0xffffffff
je 0x407bb2
mov edx, dword [esp + 0x10]
push ebx
push ebp
lea eax, [esp + edx + 0x28]
push eax
push esi
call sub.WS2_32.dll_recv
cmp eax, ebx
je 0x407d70
cmp eax, 0xffffffff
je 0x407bb2
mov ecx, dword [esp + 0x10]
sub ebp, eax
add ecx, eax
cmp ebp, ebx
mov dword [esp + 0x10], ecx
jg 0x407aee
mov cl, byte [esp + 0x22]
mov al, byte [esp + 0x21]
mov dl, byte [esp + 0x20]
and cl, al
and cl, dl
cmp cl, 0xff
je 0x407bd6
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x11c
ret
call sub.WS2_32.dll_WSAGetLastError
cmp eax, ebx
je 0x407b8f
cmp eax, 0x5b4
jne 0x407eb4
pop edi
pop esi
pop ebp
mov eax, 0x3908
pop ebx
add esp, 0x11c
ret
lea eax, [edi + edi*4]
mov dword [esp + 0x14], ebx
mov ebp, 4
mov dword [esp + 0x10], ebx
lea edi, [eax + eax*4]
shl edi, 2
cmp edi, ebx
mov dword [esp + 0x2c], esi
mov dword [esp + 0x28], 1
jl 0x407c41
mov eax, 0x10624dd3
mov ecx, 0x3e8
imul edi
sar edx, 6
mov eax, edx
mov dword [esp + 0x1c], ebx
shr eax, 0x1f
add edx, eax
mov eax, edi
mov dword [esp + 0x18], 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 + 0x18]
shl edx, 3
push eax
mov dword [esp + 0x20], edx
push ebx
push ebx
lea edx, [esi + 1]
push ecx
push edx
jmp 0x407c4d
push ebx
push ebx
lea eax, [esp + 0x30]
push ebx
lea ecx, [esi + 1]
push eax
push ecx
call sub.WS2_32.dll_select
cmp eax, ebx
je 0x407d60
cmp eax, 0xffffffff
je 0x407c93
mov edx, dword [esp + 0x10]
push ebx
push ebp
lea eax, [esp + edx + 0x1c]
push eax
push esi
call sub.WS2_32.dll_recv
cmp eax, ebx
je 0x407d70
cmp eax, 0xffffffff
je 0x407c93
mov ecx, dword [esp + 0x10]
sub ebp, eax
add ecx, eax
cmp ebp, ebx
mov dword [esp + 0x10], ecx
jg 0x407bec
jmp 0x407ca0
call sub.WS2_32.dll_WSAGetLastError
cmp eax, ebx
jne 0x407eb4
cmp dword [esp + 0x14], ebx
jg 0x407cb4
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x11c
ret
mov dword [esp + 0x24], ebx
mov ebp, 4
mov dword [esp + 0x10], ebx
cmp edi, ebx
mov dword [esp + 0x2c], esi
mov dword [esp + 0x28], 1
jl 0x407d16
mov eax, 0x10624dd3
mov dword [esp + 0x1c], ebx
imul edi
sar edx, 6
mov ecx, edx
mov eax, edi
shr ecx, 0x1f
add edx, ecx
mov ecx, 0x3e8
mov dword [esp + 0x18], 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 + 0x18]
shl edx, 3
push eax
mov dword [esp + 0x20], edx
push ebx
push ebx
lea edx, [esi + 1]
push ecx
push edx
jmp 0x407d22
push ebx
push ebx
lea eax, [esp + 0x30]
push ebx
lea ecx, [esi + 1]
push eax
push ecx
call sub.WS2_32.dll_select
cmp eax, ebx
je 0x407d60
cmp eax, 0xffffffff
je 0x407d80
mov edx, dword [esp + 0x10]
push ebx
push ebp
lea eax, [esp + edx + 0x2c]
push eax
push esi
call sub.WS2_32.dll_recv
cmp eax, ebx
je 0x407d70
cmp eax, 0xffffffff
je 0x407d80
mov ecx, dword [esp + 0x10]
sub ebp, eax
add ecx, eax
cmp ebp, ebx
mov dword [esp + 0x10], ecx
jg 0x407cc1
jmp 0x407d8d
pop edi
pop esi
pop ebp
mov eax, 0x5b4
pop ebx
add esp, 0x11c
ret
pop edi
pop esi
pop ebp
mov eax, 0x2746
pop ebx
add esp, 0x11c
ret
call sub.WS2_32.dll_WSAGetLastError
cmp eax, ebx
jne 0x407eb4
cmp byte [esp + 0x13c], bl
je 0x407dab
mov ecx, dword [esp + 0x14]
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
jmp 0x407db8
mov edx, dword [esp + 0x14]
push edx
call fcn.0040a5c5
add esp, 4
mov ebp, dword [esp + 0x134]
cmp eax, ebx
mov dword [ebp], eax
jne 0x407dd6
pop edi
pop esi
pop ebp
mov eax, 0x4e22
pop ebx
add esp, 0x11c
ret
mov ecx, dword [esp + 0x14]
push edi
push ecx
push eax
push esi
call fcn.00407ec0
mov esi, eax
add esp, 0x10
cmp esi, ebx
je 0x407e33
cmp byte [esp + 0x13c], bl
je 0x407e17
mov edx, dword [ebp]
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov eax, esi
pop edi
mov dword [ebp], ebx
pop esi
pop ebp
pop ebx
add esp, 0x11c
ret
mov eax, dword [ebp]
push eax
call fcn.0040a19f
add esp, 4
mov eax, esi
mov dword [ebp], ebx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x11c
ret
mov eax, dword [esp + 0x24]
mov esi, dword [esp + 0x14]
cmp eax, ebx
je 0x407ea5
xor ecx, ecx
xor eax, eax
cmp esi, ebx
jle 0x407e56
mov edi, dword [ebp]
xor edx, edx
mov dl, byte [edi + eax]
add ecx, edx
inc eax
cmp eax, esi
jl 0x407e4a
cmp ecx, dword [esp + 0x24]
je 0x407ea5
cmp byte [esp + 0x13c], bl
je 0x407e88
mov eax, dword [ebp]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
pop edi
mov dword [ebp], ebx
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x11c
ret
mov ecx, dword [ebp]
push ecx
call fcn.0040a19f
add esp, 4
mov dword [ebp], ebx
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x11c
ret
mov eax, dword [esp + 0x138]
cmp eax, ebx
je 0x407eb2
mov dword [eax], esi
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x11c
ret