Function at 0x1021c753
Capabilities:
Get socket status
Read file on windows
Receive data
Receive data on socket

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x128
mov eax, dword [0x10285008]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x14]
mov dword [ebp - 0x118], edx
mov dword [ebp - 0x11c], eax
push ebx
mov ebx, dword [ebp + 0x18]
push esi
push edi
mov edi, ecx
mov ecx, dword [ebp + 0xc]
mov dword [ebp - 0x120], ecx
cmp edx, 3
jne 0x1021c8a4
mov eax, dword [ebp + 8]
xor esi, esi
test eax, eax
je 0x1021c820
cmp eax, 0xffffffff
je 0x1021c820
xor edx, edx
mov dword [ebp - 0x110], edi
mov ecx, 0x3e8
mov dword [ebp - 0x114], 1
div ecx
mov dword [ebp - 0x128], eax
imul eax, edx, 0x3e8
mov dword [ebp - 0x124], eax
lea eax, [ebp - 0x128]
push eax
push esi
push esi
lea eax, [ebp - 0x114]
push eax
push 1
call dword [sym.imp.WS2_32.dll_select]
cmp eax, 1
jge 0x1021c81a
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test eax, eax
jne 0x1021c7ff
mov eax, 0x80004005
jmp 0x1021c97c
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test eax, eax
jle 0x1021c97c
movzx eax, ax
or eax, 0x80070000
jmp 0x1021c97c
mov ecx, dword [ebp - 0x120]
mov eax, dword [ebp + 0x10]
push esi
push ebx
mov dword [ebp - 0xc], eax
lea eax, [ebp - 0x118]
push eax
push dword [ebp - 0x11c]
lea eax, [ebp - 0xc]
mov dword [ebp - 8], ecx
push 1
push eax
push edi
mov dword [ebp - 0x118], esi
call dword [sym.imp.WS2_32.dll_WSARecv]
cmp eax, 0xffffffff
je 0x1021c857
xor eax, eax
jmp 0x1021c97c
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x3e5
jne 0x1021c7eb
lea eax, [ebp - 0x118]
push eax
xor eax, eax
cmp eax, dword [ebp + 8]
sbb eax, eax
neg eax
push eax
push dword [ebp - 0x11c]
push ebx
push edi
call dword [sym.imp.WS2_32.dll_WSAGetOverlappedResult]
test eax, eax
jne 0x1021c97a
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test eax, eax
je 0x1021c93d
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
jmp 0x1021c94a
push ebx
push eax
push dword [ebp + 0x10]
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x1021c978
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x1021c8ca
mov esi, 0x80004005
jmp 0x1021c8df
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x1021c8df
movzx esi, si
or esi, 0x80070000
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x1021c95b
cmp dword [ebp - 0x118], 2
jne 0x1021c91f
push dword [ebp + 8]
push dword [ebx + 0x10]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push edi
call dword [sym.imp.KERNEL32.dll_CancelIo]
xor esi, esi
push esi
push dword [ebp - 0x11c]
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
jne 0x1021c97a
jmp 0x1021c933
push 1
push dword [ebp - 0x11c]
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
jne 0x1021c978
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x1021c944
mov esi, 0x80004005
jmp 0x1021c97a
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x1021c97a
movzx esi, si
or esi, 0x80070000
jmp 0x1021c97a
cmp dword [ebp - 0x118], 2
je 0x1021c97a
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0x120]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ClearCommError]
jmp 0x1021c97a
xor esi, esi
mov eax, esi
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.10236010
mov esp, ebp
pop ebp
ret 0x14