Function at 0x40a820
Capabilities:
Get socket status
Print debug messages
Receive data
Receive data on socket

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x19134
call fcn.00440990
mov eax, dword [0x47a2f4]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
mov esi, ecx
mov eax, 0x38e38e39
push edi
xor ecx, ecx
mov dword [ebp - 0x19124], esi
mov dword [ebp - 0x1912c], ecx
mov edx, dword [esi + 4]
mov edi, dword [esi]
sub edx, edi
imul edx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add eax, edx
test eax, eax
jle 0x40aa7c
push ebx
xor ebx, ebx
nop dword [eax]
cmp dword [ebx + edi + 0x40], 1
jne 0x40aa66
mov eax, dword [ebx + edi + 0x3c]
cmp eax, 0xffffffff
je 0x40aa66
mov dword [ebp - 0x1911c], eax
lea eax, [ebp - 0x19134]
push eax
push 0
push 0
lea eax, [ebp - 0x19120]
mov dword [ebp - 0x19134], 3
push eax
push 0
mov dword [ebp - 0x19130], 0
mov dword [ebp - 0x19120], 1
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
je 0x40aa16
js 0x40aa70
mov eax, dword [esi]
lea ecx, [ebp - 0x19120]
push ecx
push dword [eax + ebx + 0x3c]
call dword [sym.imp.WS2_32.dll___WSAFDIsSet]
test eax, eax
je 0x40aa16
mov eax, dword [esi]
lea ecx, [ebp - 0x19128]
push 0
push 4
push ecx
mov dword [ebp - 0x19128], 0
push dword [eax + ebx + 0x3c]
call dword [sym.imp.WS2_32.dll_recv]
test eax, eax
jg 0x40a955
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
je 0x40aa16
push str.socket_is_close._n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
mov eax, dword [esi]
push dword [eax + ebx + 0x3c]
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, dword [esi]
mov dword [eax + ebx + 0x3c], 0xffffffff
mov eax, dword [esi]
mov dword [eax + ebx + 0x40], 0
jmp 0x40aa16
mov edi, dword [ebp - 0x19128]
lea eax, [edi - 1]
cmp eax, 0x19017
ja 0x40aa16
push 0x19018
lea eax, [ebp - 0x1901c]
push 0
push eax
call fcn.004421a0
add esp, 0xc
xor esi, esi
mov eax, dword [ebp - 0x19124]
push 0
push edi
mov ecx, dword [eax]
lea eax, [ebp - 0x1901c]
add eax, esi
push eax
push dword [ecx + ebx + 0x3c]
call dword [sym.imp.WS2_32.dll_recv]
test eax, eax
jg 0x40aa54
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
je 0x40aa56
push str.socket_is_close._n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
mov edi, dword [ebp - 0x19124]
mov eax, dword [edi]
push dword [eax + ebx + 0x3c]
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, dword [edi]
mov dword [eax + ebx + 0x3c], 0xffffffff
mov eax, dword [edi]
mov dword [eax + ebx + 0x40], 0
mov edi, dword [ebp - 0x19128]
mov eax, dword [ebp - 0x19124]
mov eax, dword [eax]
mov ecx, dword [eax + ebx + 0x44]
test ecx, ecx
je 0x40aa10
cmp esi, edi
jne 0x40aa10
mov eax, dword [ecx]
lea edx, [ebp - 0x1901c]
push esi
push edx
call dword [eax + 4]
mov esi, dword [ebp - 0x19124]
mov ecx, dword [esi + 4]
mov eax, 0x38e38e39
mov edi, dword [esi]
add ebx, 0x48
inc dword [ebp - 0x1912c]
sub ecx, edi
imul ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp dword [ebp - 0x1912c], eax
jl 0x40a870
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0043fe70
mov esp, ebp
pop ebp
ret
add esi, eax
mov edi, dword [ebp - 0x19128]
cmp esi, edi
jl 0x40a981
jmp 0x40a9ef
push 1
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x40aa16
push str.select_failed._n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
pop ebx
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop esi
call fcn.0043fe70
mov esp, ebp
pop ebp
ret