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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x124
mov eax, dword [0x405004]
xor eax, esp
mov dword [esp + 0x120], eax
push ebx
mov eax, ecx
mov dword [esp + 8], edx
mov dword [esp + 0xc], eax
push esi
push edi
test eax, eax
jns 0x401e78
cmp dword [0x405388], 2
jl 0x401e5e
push eax
push str.ERROR:_invalid_fd_in_check_fd__d_n
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.00401010
add esp, 0xc
or esi, 0xffffffff
mov eax, esi
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x120]
xor ecx, esp
call fcn.00402056
mov esp, ebp
pop ebp
ret
mov ebx, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
lea ecx, [eax + 1]
mov dword [esp + 0x24], eax
mov dword [esp + 0x20], 1
mov dword [esp + 0xc], ecx
lea eax, [esp + 0x18]
mov dword [esp + 0x18], 5
push eax
push 0
push 0
lea eax, [esp + 0x2c]
mov dword [esp + 0x28], 0
push eax
push ecx
call dword [sym.imp.WS2_32.dll_select]
mov edi, eax
mov esi, edi
test edi, edi
jns 0x401f8e
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov eax, dword [eax]
cmp eax, 4
jne 0x401efc
cmp dword [0x405388], 2
mov ecx, dword [esp + 0xc]
jl 0x401e91
push str.socket_check_fd
push str._s:_EINTR_n
push 2
call ebx
add esp, 4
push eax
call fcn.00401010
mov ecx, dword [esp + 0x18]
add esp, 0xc
jmp 0x401e91
cmp eax, 0xb
jne 0x401f3f
cmp dword [0x405388], 2
jl 0x401f94
push str.socket_check_fd
push str._s:_EAGAIN_n
push 2
call ebx
add esp, 4
push eax
call fcn.00401010
add esp, 0xc
mov eax, esi
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x120]
xor ecx, esp
call fcn.00402056
mov esp, ebp
pop ebp
ret
cmp dword [0x405388], 2
jl 0x401f74
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
push dword [eax]
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_strerror]
add esp, 4
push eax
push str.socket_check_fd
push str._s:_select_failed:__s_n
push 2
call ebx
add esp, 4
push eax
call fcn.00401010
add esp, 0x10
or esi, 0xffffffff
mov eax, esi
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x120]
xor ecx, esp
call fcn.00402056
mov esp, ebp
pop ebp
ret
je 0x402017
mov esi, edi
test edi, edi
jle 0x40203f
mov esi, dword [esp + 0x14]
push 0
push 0x20000
push dword [esp + 0x18]
push esi
call dword [sym.imp.WS2_32.dll_recv]
test eax, eax
jne 0x401ff6
cmp dword [0x405388], 3
jl 0x401fdc
push esi
push str.socket_receive_timeout
push str._s:_fd_d_recv_returned_0_n
push 2
call ebx
add esp, 4
push eax
call fcn.00401010
add esp, 0x10
mov eax, 0xffffff94
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x120]
xor ecx, esp
call fcn.00402056
mov esp, ebp
pop ebp
ret
jns 0x402041
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov eax, dword [eax]
neg eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x120]
xor ecx, esp
call fcn.00402056
mov esp, ebp
pop ebp
ret
cmp dword [0x405388], 2
jl 0x40203a
push str.socket_check_fd
push str._s:_timeout_n
push 2
call ebx
add esp, 4
push eax
call fcn.00401010
add esp, 0xc
mov esi, 0xffffff76
mov eax, esi
mov ecx, dword [esp + 0x12c]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00402056
mov esp, ebp
pop ebp
ret