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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x340
mov eax, dword [0x6a50f0]
xor eax, ebp
mov dword [ebp - 8], eax
push 0
push 1
mov eax, dword [ebp + 0xc]
push eax
mov ecx, dword [ebp + 8]
push ecx
call dword [sym.imp.WSOCK32.dll_recv]
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 1
je 0x531c2c
cmp dword [ebp - 4], 0xffffffff
jne 0x531be7
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
push eax
call fcn.00531580
add esp, 4
test eax, eax
je 0x531bcb
mov dword [ebp - 0x32c], 0
xor edx, edx
mov dword [ebp - 0x328], edx
mov eax, dword [ebp + 0x10]
xor edx, edx
mov ecx, 0x3e8
div ecx
mov dword [ebp - 0x32c], eax
mov eax, dword [ebp + 0x10]
xor edx, edx
mov ecx, 0x3e8
div ecx
imul edx, edx, 0x3e8
mov dword [ebp - 0x328], edx
mov dword [ebp - 0x110], 0
mov dword [ebp - 0x218], 0
mov dword [ebp - 0x320], 0
mov dword [ebp - 0x330], 0
jmp 0x5319b8
mov edx, dword [ebp - 0x330]
add edx, 1
mov dword [ebp - 0x330], edx
mov eax, dword [ebp - 0x330]
cmp eax, dword [ebp - 0x320]
jae 0x5319dc
mov ecx, dword [ebp - 0x330]
mov edx, dword [ebp + ecx*4 - 0x31c]
cmp edx, dword [ebp + 8]
jne 0x5319da
jmp 0x5319dc
jmp 0x5319a9
mov eax, dword [ebp - 0x330]
cmp eax, dword [ebp - 0x320]
jne 0x531a12
cmp dword [ebp - 0x320], 0x40
jae 0x531a12
mov ecx, dword [ebp - 0x330]
mov edx, dword [ebp + 8]
mov dword [ebp + ecx*4 - 0x31c], edx
mov eax, dword [ebp - 0x320]
add eax, 1
mov dword [ebp - 0x320], eax
xor ecx, ecx
jne 0x53199d
mov dword [ebp - 0x334], 0
jmp 0x531a31
mov edx, dword [ebp - 0x334]
add edx, 1
mov dword [ebp - 0x334], edx
mov eax, dword [ebp - 0x334]
cmp eax, dword [ebp - 0x218]
jae 0x531a55
mov ecx, dword [ebp - 0x334]
mov edx, dword [ebp + ecx*4 - 0x214]
cmp edx, dword [ebp + 8]
jne 0x531a53
jmp 0x531a55
jmp 0x531a22
mov eax, dword [ebp - 0x334]
cmp eax, dword [ebp - 0x218]
jne 0x531a8b
cmp dword [ebp - 0x218], 0x40
jae 0x531a8b
mov ecx, dword [ebp - 0x334]
mov edx, dword [ebp + 8]
mov dword [ebp + ecx*4 - 0x214], edx
mov eax, dword [ebp - 0x218]
add eax, 1
mov dword [ebp - 0x218], eax
xor ecx, ecx
jne 0x531a16
lea edx, [ebp - 0x32c]
push edx
lea eax, [ebp - 0x218]
push eax
lea ecx, [ebp - 0x110]
push ecx
lea edx, [ebp - 0x320]
push edx
mov eax, dword [ebp + 8]
add eax, 1
push eax
call dword [sym.imp.WSOCK32.dll_select]
mov dword [ebp - 0x324], eax
cmp dword [ebp - 0x324], 0
jle 0x531b64
lea ecx, [ebp - 0x320]
push ecx
mov edx, dword [ebp + 8]
push edx
call sub.WSOCK32.dll___WSAFDIsSet
test eax, eax
je 0x531ae6
jmp 0x531903
lea eax, [ebp - 0x218]
push eax
mov ecx, dword [ebp + 8]
push ecx
call sub.WSOCK32.dll___WSAFDIsSet
test eax, eax
je 0x531b1f
mov edx, dword [ebp + 8]
push edx
call fcn.00531880
add esp, 4
push eax
push str.Exception_on_socket_fd:_Read_failed__SO_ERROR_d
mov eax, dword [ebp + 0x14]
push eax
call fcn.00531360
add esp, 0xc
jmp 0x531c2c
cmp dword [ebp + 0x14], 0
je 0x531b53
mov ecx, dword [ebp + 0x14]
cmp dword [ecx + 8], 0
je 0x531b53
push 0x13d
push str.Select_on_socket_fd_returned_no_data
push 0xd
mov edx, dword [ebp + 0x14]
mov eax, dword [edx]
push eax
mov ecx, dword [ebp + 0x14]
mov edx, dword [ecx + 8]
call edx
add esp, 0x10
mov dword [ebp - 0x338], eax
jmp 0x531b5d
mov dword [ebp - 0x338], 0xd
jmp 0x531c2c
cmp dword [ebp - 0x324], 0
jne 0x531baf
cmp dword [ebp + 0x14], 0
je 0x531ba1
mov eax, dword [ebp + 0x14]
cmp dword [eax + 8], 0
je 0x531ba1
push 0x144
push str.Timed_out_waiting_for_socket_to_have_data
push 0xd
mov ecx, dword [ebp + 0x14]
mov edx, dword [ecx]
push edx
mov eax, dword [ebp + 0x14]
mov ecx, dword [eax + 8]
call ecx
add esp, 0x10
mov dword [ebp - 0x33c], eax
jmp 0x531bab
mov dword [ebp - 0x33c], 0xd
jmp 0x531c2c
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
push eax
push str.Select_on_socket_fd_failed_with_error:__d
mov edx, dword [ebp + 0x14]
push edx
call fcn.00531360
add esp, 0xc
jmp 0x531c2c
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
push eax
push str.Recv_on_socket_fd_failed_with_error:__d
mov eax, dword [ebp + 0x14]
push eax
call fcn.00531360
add esp, 0xc
jmp 0x531c2c
cmp dword [ebp + 0x14], 0
je 0x531c1b
mov ecx, dword [ebp + 0x14]
cmp dword [ecx + 8], 0
je 0x531c1b
push 0x158
push str.Read_on_the_socket_fd_was_terminated_by_the_server_disconnecting
push 0xd
mov edx, dword [ebp + 0x14]
mov eax, dword [edx]
push eax
mov ecx, dword [ebp + 0x14]
mov edx, dword [ecx + 8]
call edx
add esp, 0x10
mov dword [ebp - 0x340], eax
jmp 0x531c25
mov dword [ebp - 0x340], 0xd
jmp 0x531c2c
xor eax, eax
cmp dword [ebp - 4], 1
sete al
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.00531ddb
mov esp, ebp
pop ebp
ret