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

Disassembly:
sub esp, 0x118
push ebx
push ebp
push esi
xor ebp, ebp
push edi
mov dword [esp + 0x10], ebp
mov dword [esp + 0x14], ebp
call dword [sym.imp.KERNEL32.dll_GetTickCount]
cmp dword [esp + 0x140], ebp
jne 0x5099c3
pop edi
pop esi
pop ebp
mov eax, 0xfffffffc
pop ebx
add esp, 0x118
ret
mov edi, dword [esp + 0x130]
cmp edi, ebp
je 0x5099d1
mov ebp, dword [edi + 0x18]
mov ebx, dword [esp + 0x12c]
lea eax, [esp + 0x1c]
lea ecx, [esp + 0x24]
push eax
push 0
push 0
lea eax, [ebx + 1]
mov esi, 1
push ecx
push eax
mov dword [esp + 0x3c], ebx
mov dword [esp + 0x38], esi
mov dword [esp + 0x30], 0
mov dword [esp + 0x34], 0x2710
call sub.WS2_32.dll_select
test eax, eax
jne 0x509a4b
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x13c]
add eax, 0xa
cmp eax, ecx
mov dword [esp + 0x14], eax
ja 0x509b8f
test edi, edi
je 0x509b7b
mov eax, dword [edi + 8]
test eax, eax
je 0x509c25
cmp dword [ebp + 4], esi
je 0x509c25
jmp 0x509b7b
cmp eax, 0xffffffff
je 0x509bb0
lea edx, [esp + 0x24]
push edx
push ebx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x509c34
mov eax, dword [esp + 0x134]
mov ecx, dword [esp + 0x138]
cmp eax, ecx
jge 0x509a80
mov dword [esp + 0x138], eax
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x140]
mov eax, dword [esp + 0x138]
push 0
add ecx, edx
push eax
push ecx
push ebx
call sub.WS2_32.dll_recv
mov esi, eax
test esi, esi
je 0x509bd1
jge 0x509aed
lea eax, [esp + 0x18]
push eax
call fcn.0050c020
mov ecx, dword [esp + 0x1c]
mov edi, eax
push ecx
call fcn.00509840
mov ebx, eax
add esp, 8
cmp ebx, 0xffffd8cd
jne 0x509bf8
push edi
call fcn.00509240
mov edi, dword [esp + 0x134]
mov ebx, dword [esp + 0x130]
add esp, 4
jmp 0x509b74
mov edx, dword [esp + 0x10]
mov eax, dword [0x9727b0]
add edx, esi
test eax, eax
mov dword [esp + 0x10], edx
je 0x509b02
add dword [eax], esi
cmp dword [esp + 0x148], 1
jne 0x509b3d
test edi, edi
je 0x509b56
mov edx, dword [ebp + 0x10]
push edx
call fcn.0050a5d0
mov ecx, dword [ebp + 0x18]
mov eax, dword [ebp + 0x28]
add ecx, esi
add eax, esi
mov dword [ebp + 0x18], ecx
mov dword [ebp + 0x28], eax
mov edx, dword [edi + 0x30]
add edx, esi
mov dword [edi + 0x30], edx
mov eax, dword [ebp + 0x10]
push eax
call fcn.0050a5e0
add esp, 8
test edi, edi
je 0x509b56
mov eax, dword [edi + 8]
test eax, eax
je 0x509c25
cmp dword [ebp + 4], 1
je 0x509c25
mov eax, dword [esp + 0x144]
test eax, eax
je 0x509b6c
mov ecx, dword [eax]
dec ecx
mov dword [eax], ecx
je 0x509c25
mov dword [esp + 0x14], 0
sub dword [esp + 0x134], esi
mov eax, dword [esp + 0x134]
test eax, eax
jle 0x509c25
jmp 0x5099d8
mov eax, dword [esp + 0x14c]
test eax, eax
je 0x509ba0
mov ecx, dword [esp + 0x10]
mov dword [eax], ecx
pop edi
pop esi
pop ebp
mov eax, 0xfffffff6
pop ebx
add esp, 0x118
ret
mov eax, dword [esp + 0x14c]
test eax, eax
je 0x509bc1
mov edx, dword [esp + 0x10]
mov dword [eax], edx
pop edi
pop esi
pop ebp
mov eax, 0xfffffffb
pop ebx
add esp, 0x118
ret
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov eax, dword [esp + 0x14c]
test eax, eax
je 0x509be8
mov ecx, dword [esp + 0x10]
mov dword [eax], ecx
pop edi
pop esi
pop ebp
mov eax, 0xffffffea
pop ebx
add esp, 0x118
ret
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push edi
call fcn.00509240
mov eax, dword [esp + 0x150]
add esp, 4
test eax, eax
je 0x509c18
mov edx, dword [esp + 0x10]
mov dword [eax], edx
pop edi
pop esi
mov eax, ebx
pop ebp
pop ebx
add esp, 0x118
ret
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x118
ret
pop edi
pop esi
pop ebp
mov eax, 0xfffffff7
pop ebx
add esp, 0x118
ret