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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x348
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 0x40a462
cmp dword [ebp - 4], 0xffffffff
jne 0x40a41d
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
push eax
call fcn.00409d80
add esp, 4
test eax, eax
je 0x40a401
mov dword [ebp - 0x334], 0
xor edx, edx
mov dword [ebp - 0x330], edx
mov dword [ebp - 0x114], 0x2ee
mov eax, dword [ebp - 0x114]
xor edx, edx
mov ecx, 0x3e8
div ecx
mov dword [ebp - 0x334], eax
mov eax, dword [ebp - 0x114]
xor edx, edx
mov ecx, 0x3e8
div ecx
imul edx, edx, 0x3e8
mov dword [ebp - 0x330], edx
mov dword [ebp - 0x110], 0
mov dword [ebp - 0x220], 0
mov dword [ebp - 0x328], 0
mov dword [ebp - 0x338], 0
jmp 0x40a1ee
mov edx, dword [ebp - 0x338]
add edx, 1
mov dword [ebp - 0x338], edx
mov eax, dword [ebp - 0x338]
cmp eax, dword [ebp - 0x328]
jae 0x40a212
mov ecx, dword [ebp - 0x338]
mov edx, dword [ebp + ecx*4 - 0x324]
cmp edx, dword [ebp + 8]
jne 0x40a210
jmp 0x40a212
jmp 0x40a1df
mov eax, dword [ebp - 0x338]
cmp eax, dword [ebp - 0x328]
jne 0x40a248
cmp dword [ebp - 0x328], 0x40
jae 0x40a248
mov ecx, dword [ebp - 0x338]
mov edx, dword [ebp + 8]
mov dword [ebp + ecx*4 - 0x324], edx
mov eax, dword [ebp - 0x328]
add eax, 1
mov dword [ebp - 0x328], eax
xor ecx, ecx
jne 0x40a1d3
mov dword [ebp - 0x33c], 0
jmp 0x40a267
mov edx, dword [ebp - 0x33c]
add edx, 1
mov dword [ebp - 0x33c], edx
mov eax, dword [ebp - 0x33c]
cmp eax, dword [ebp - 0x220]
jae 0x40a28b
mov ecx, dword [ebp - 0x33c]
mov edx, dword [ebp + ecx*4 - 0x21c]
cmp edx, dword [ebp + 8]
jne 0x40a289
jmp 0x40a28b
jmp 0x40a258
mov eax, dword [ebp - 0x33c]
cmp eax, dword [ebp - 0x220]
jne 0x40a2c1
cmp dword [ebp - 0x220], 0x40
jae 0x40a2c1
mov ecx, dword [ebp - 0x33c]
mov edx, dword [ebp + 8]
mov dword [ebp + ecx*4 - 0x21c], edx
mov eax, dword [ebp - 0x220]
add eax, 1
mov dword [ebp - 0x220], eax
xor ecx, ecx
jne 0x40a24c
lea edx, [ebp - 0x334]
push edx
lea eax, [ebp - 0x220]
push eax
lea ecx, [ebp - 0x110]
push ecx
lea edx, [ebp - 0x328]
push edx
mov eax, dword [ebp + 8]
add eax, 1
push eax
call dword [sym.imp.WSOCK32.dll_select]
mov dword [ebp - 0x32c], eax
cmp dword [ebp - 0x32c], 0
jle 0x40a39a
lea ecx, [ebp - 0x328]
push ecx
mov edx, dword [ebp + 8]
push edx
call sub.WSOCK32.dll___WSAFDIsSet
test eax, eax
je 0x40a31c
jmp 0x40a129
lea eax, [ebp - 0x220]
push eax
mov ecx, dword [ebp + 8]
push ecx
call sub.WSOCK32.dll___WSAFDIsSet
test eax, eax
je 0x40a355
mov edx, dword [ebp + 8]
push edx
call fcn.0040a070
add esp, 4
push eax
push str.Exception_on_socket_fd:_Read_failed__SO_ERROR_d
mov eax, dword [ebp + 0x10]
push eax
call fcn.00409c90
add esp, 0xc
jmp 0x40a462
cmp dword [ebp + 0x10], 0
je 0x40a389
mov ecx, dword [ebp + 0x10]
cmp dword [ecx + 8], 0
je 0x40a389
push 0x16b
push str.Select_on_socket_fd_returned_no_data
push 9
mov edx, dword [ebp + 0x10]
mov eax, dword [edx]
push eax
mov ecx, dword [ebp + 0x10]
mov edx, dword [ecx + 8]
call edx
add esp, 0x10
mov dword [ebp - 0x340], eax
jmp 0x40a393
mov dword [ebp - 0x340], 9
jmp 0x40a462
cmp dword [ebp - 0x32c], 0
jne 0x40a3e5
cmp dword [ebp + 0x10], 0
je 0x40a3d7
mov eax, dword [ebp + 0x10]
cmp dword [eax + 8], 0
je 0x40a3d7
push 0x172
push str.Timed_out_waiting_for_socket_to_have_data
push 9
mov ecx, dword [ebp + 0x10]
mov edx, dword [ecx]
push edx
mov eax, dword [ebp + 0x10]
mov ecx, dword [eax + 8]
call ecx
add esp, 0x10
mov dword [ebp - 0x344], eax
jmp 0x40a3e1
mov dword [ebp - 0x344], 9
jmp 0x40a462
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
push eax
push str.Select_on_socket_fd_failed_with_error:__d
mov edx, dword [ebp + 0x10]
push edx
call fcn.00409c90
add esp, 0xc
jmp 0x40a462
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
push eax
push str.Recv_on_socket_fd_failed_with_error:__d
mov eax, dword [ebp + 0x10]
push eax
call fcn.00409c90
add esp, 0xc
jmp 0x40a462
cmp dword [ebp + 0x10], 0
je 0x40a451
mov ecx, dword [ebp + 0x10]
cmp dword [ecx + 8], 0
je 0x40a451
push 0x186
push str.Read_on_the_socket_fd_was_terminated_by_the_server_disconnecting
push 9
mov edx, dword [ebp + 0x10]
mov eax, dword [edx]
push eax
mov ecx, dword [ebp + 0x10]
mov edx, dword [ecx + 8]
call edx
add esp, 0x10
mov dword [ebp - 0x348], eax
jmp 0x40a45b
mov dword [ebp - 0x348], 9
jmp 0x40a462
xor eax, eax
cmp dword [ebp - 4], 1
sete al
mov esp, ebp
pop ebp
ret