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

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x150
push ebx
push esi
xor esi, esi
push edi
push dword [0x1009ee8]
mov dword [ebp - 4], esi
push esi
mov dword [ebp - 0x10], esi
mov dword [ebp - 0xc], esi
mov dword [ebp - 8], esi
mov dword [ebp - 0x20], 0x800
mov dword [ebp - 0x1c], esi
mov dword [ebp - 0x30], esi
mov dword [ebp - 0x14], esi
mov dword [ebp - 0x3c], 5
mov dword [ebp - 0x38], esi
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
push esi
push 0x10094a0
mov dword [ebp - 0x18], eax
mov dword [0x1009430], esi
call sub.msvcrt.dll__setjmp3
test eax, eax
pop ecx
pop ecx
jne 0x1006054
mov edi, dword [ebp + 0xc]
push 0x1001304
push edi
call dword [sym.imp.msvcrt.dll__mbscmp]
test eax, eax
pop ecx
pop ecx
jne 0x1005dcc
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x20
mov dword [ebp - 4], eax
jmp 0x1005de6
push 0x20
push dword [ebp + 0x14]
push edi
call dword [sym.imp.msvcrt.dll__fsopen]
mov dword [ebp - 4], eax
mov eax, dword [sym.imp.msvcrt.dll_fclose]
add esp, 0xc
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 4]
cmp eax, esi
jne 0x1005e10
push edi
push 0x2764
push 2
call fcn.010064fd
add esp, 0xc
call dword [sym.imp.msvcrt.dll__errno]
push dword [eax]
push edi
call sub.MSWSOCK.dll_s_perror
jmp 0x1006054
mov dword [0x1009428], eax
mov eax, dword [ebp - 0x10]
mov dword [0x100942c], eax
call fcn.010055cd
test eax, eax
jne 0x1006054
cmp dword [ebp + 0x10], esi
je 0x1005e69
push dword [ebp + 0x10]
call fcn.01004ba0
mov edi, eax
cmp edi, esi
je 0x1006054
push edi
push dword [ebp + 8]
push 0x1001580
push esi
call fcn.01005499
add esp, 0x10
push edi
push esi
mov ebx, eax
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
cmp ebx, 1
jmp 0x1005e7d
push dword [ebp + 8]
push 0x1001338
push esi
call fcn.01005499
add esp, 0xc
cmp eax, 1
jne 0x1006054
xor edi, edi
inc edi
push 0x100157c
mov dword [ebp - 0x14], edi
call fcn.01005044
cmp eax, 0xffffffff
mov dword [ebp - 0x24], eax
je 0x1006054
mov dword [ebp - 0x28], esi
call dword [sym.imp.msvcrt.dll__errno]
mov dword [eax], esi
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x10]
mov dword [ebp - 0x40], eax
call dword [sym.imp.msvcrt.dll_clock]
mov dword [ebp - 0x34], eax
mov eax, dword [0x1009ee4]
cmp eax, edi
je 0x1005ed7
cmp eax, 2
jle 0x1006054
cmp eax, 4
jg 0x1006054
mov ebx, dword [sym.imp.msvcrt.dll_putchar]
jmp 0x1005fd3
xor edi, edi
mov ecx, dword [ebp - 0x3c]
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x48], ecx
mov ecx, dword [ebp - 0x38]
mov dword [ebp - 0x44], ecx
lea ecx, [ebp - 0x48]
push ecx
push esi
mov dword [ebp - 0x14c], eax
push esi
xor eax, eax
lea ecx, [ebp - 0x150]
inc eax
push ecx
push eax
mov dword [ebp - 0x150], eax
call dword [sym.imp.WS2_32.dll_select]
cmp eax, esi
mov ecx, dword [0x1009430]
mov dword [ebp - 0x4c], eax
jne 0x1005f2d
cmp ecx, esi
jne 0x1005fdf
jmp 0x1005f2f
jl 0x1005f35
inc edi
cmp edi, 0xc
jl 0x1005ee4
cmp ecx, esi
jne 0x1005fdf
cmp eax, esi
jle 0x1005fdf
lea eax, [ebp - 0x150]
push eax
push dword [ebp - 0x24]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x1005fdf
push esi
push dword [0x1009ee8]
push dword [ebp - 0x18]
push dword [ebp - 0x24]
call dword [sym.imp.WS2_32.dll_recv]
mov edi, eax
cmp edi, esi
mov dword [ebp - 0x2c], edi
jle 0x1005fdf
push edi
push dword [ebp - 0x18]
push dword [ebp - 0x40]
call dword [sym.imp.msvcrt.dll__write]
add esp, 0xc
cmp eax, esi
mov dword [ebp - 0x28], eax
jl 0x1005fdf
mov eax, edi
cdq
add dword [ebp - 0xc], eax
adc dword [ebp - 8], edx
jmp 0x1005fcb
mov eax, dword [ebp - 8]
cmp eax, dword [ebp - 0x1c]
jl 0x1005fd3
jg 0x1005fac
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp - 0x20]
jb 0x1005fd3
add dword [ebp - 0x20], 0x800
push 0x23
adc dword [ebp - 0x1c], esi
call ebx
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x20
push eax
call dword [sym.imp.msvcrt.dll_fflush]
pop ecx
pop ecx
cmp dword [0x1009f80], esi
jne 0x1005f9a
cmp dword [0x1009430], esi
je 0x1005ee2
cmp dword [0x1009430], esi
jne 0x1006054
cmp dword [0x1009f80], esi
je 0x1006010
cmp dword [ebp - 8], esi
jl 0x1006010
jg 0x1005ffb
cmp dword [ebp - 0xc], esi
jbe 0x1006010
push 0xa
call ebx
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x20
push eax
call dword [sym.imp.msvcrt.dll_fflush]
pop ecx
pop ecx
cmp dword [ebp - 0x2c], esi
jge 0x1006035
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x2765
call fcn.01006573
push dword [ebp + 0xc]
call dword [sym.imp.msvcrt.dll__unlink]
pop ecx
call fcn.010036c8
cmp dword [ebp - 0x28], esi
jge 0x1006054
call dword [sym.imp.msvcrt.dll__errno]
push dword [eax]
push dword [ebp + 0xc]
call sub.MSWSOCK.dll_s_perror
push dword [ebp + 0xc]
call dword [sym.imp.msvcrt.dll__unlink]
pop ecx
call dword [sym.imp.msvcrt.dll_clock]
cmp dword [0x1009430], esi
mov edi, eax
je 0x1006094
push 0x1001574
call fcn.0100538b
cmp eax, 4
pop ecx
jne 0x100607b
push esi
push esi
call fcn.01004ea6
push dword [ebp + 0xc]
call dword [sym.imp.msvcrt.dll__unlink]
pop ecx
push esi
push 0x1009430
mov dword [ebp - 0x14], esi
call dword [sym.imp.KERNEL32.dll_InterlockedExchange]
mov eax, dword [0x1008384]
cmp eax, 0xffffffff
je 0x10060ac
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
or dword [0x1008384], 0xffffffff
cmp dword [ebp - 4], esi
je 0x10060bd
cmp dword [ebp - 0x10], esi
je 0x10060bd
push dword [ebp - 4]
call dword [ebp - 0x10]
pop ecx
cmp dword [ebp - 0x14], esi
mov dword [0x1009428], esi
mov dword [0x100942c], esi
je 0x10060d6
push 1
push esi
call fcn.01004ea6
cmp dword [ebp - 8], esi
jl 0x1006100
jg 0x10060e2
cmp dword [ebp - 0xc], esi
jbe 0x1006100
cmp dword [0x100a3b0], esi
je 0x1006100
cmp dword [ebp - 0x30], esi
jne 0x1006100
push edi
push dword [ebp - 0x34]
push dword [ebp - 8]
push dword [ebp - 0xc]
push 2
call fcn.01004cf4
push dword [ebp - 0x18]
push esi
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
pop edi
pop esi
xor eax, eax
pop ebx
leave
ret 0x10