Function at 0x40c5d0
Capabilities:
Get socket status

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x35c
cmp dword [esp + 0x374], 0xffffffff
mov esi, dword [esp + 0x37c]
mov dword [esp + 0x28], 0
mov dword [esp + 0x2c], 0
sete dl
cmp dword [esp + 0x378], 0xffffffff
sete al
test dl, al
je 0x40c619
cmp dword [esp + 0x370], 0xffffffff
je 0x40ca00
xor ebx, ebx
test esi, esi
jle 0x40c62e
call fcn.004122c0
mov ebx, esi
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], edx
cmp dword [esp + 0x370], 0xffffffff
mov dword [esp + 0x24c], 0
mov dword [esp + 0x44], 0
je 0x40c9e0
cmp dword [esp + 0x374], 0xffffffff
mov eax, dword [esp + 0x370]
mov dword [esp + 0x44], 1
mov dword [esp + 0x24c], 1
mov dword [esp + 0x48], eax
mov dword [esp + 0x250], eax
mov edx, eax
je 0x40c6f6
mov eax, dword [esp + 0x374]
cmp dword [esp + 0x370], eax
mov edx, dword [esp + 0x370]
je 0x40c6c7
mov edx, dword [esp + 0x374]
cmovae edx, dword [esp + 0x370]
mov ecx, 2
mov eax, 1
mov edi, dword [esp + 0x374]
test eax, eax
mov dword [esp + 0x44], ecx
mov dword [esp + eax*4 + 0x48], edi
je 0x40ca32
mov eax, dword [esp + 0x250]
cmp dword [esp + 0x374], eax
je 0x40c6f6
mov eax, 2
mov ecx, 1
mov edi, dword [esp + 0x374]
mov dword [esp + 0x24c], eax
mov dword [esp + ecx*4 + 0x250], edi
cmp dword [esp + 0x378], 0xffffffff
mov dword [esp + 0x148], 0
je 0x40c9d0
mov ecx, dword [esp + 0x24c]
mov eax, dword [esp + 0x378]
mov dword [esp + 0x148], 1
test ecx, ecx
mov dword [esp + 0x14c], eax
je 0x40ca21
mov eax, dword [esp + 0x250]
cmp dword [esp + 0x378], eax
lea edi, [esp + 0x24c]
je 0x40c78a
xor eax, eax
lea edi, [esp + 0x24c]
mov ebp, dword [esp + 0x378]
jmp 0x40c766
cmp ebp, dword [edi + eax*4 + 4]
je 0x40c78a
add eax, 1
cmp eax, ecx
jne 0x40c760
cmp ecx, 0x3f
ja 0x40c78a
lea eax, [ecx + 1]
mov ebp, dword [esp + 0x378]
mov dword [esp + 0x24c], eax
mov dword [esp + ecx*4 + 0x250], ebp
cmp edx, dword [esp + 0x378]
mov ecx, 1
cmovb edx, dword [esp + 0x378]
lea ebp, [esp + 0x3c]
mov eax, 0
test esi, esi
cmovs ebp, eax
lea eax, [edx + 1]
mov dword [esp + 0x24], eax
jmp 0x40c88a
mov eax, ebx
mov edx, 0x10624dd3
imul edx
mov eax, ebx
sar eax, 0x1f
sar edx, 6
sub edx, eax
mov eax, ebx
mov dword [esp + 0x3c], edx
imul edx, edx, 0x3e8
sub eax, edx
imul eax, eax, 0x3e8
mov dword [esp + 0x40], eax
xor eax, eax
test ecx, ecx
mov ecx, dword [esp + 0x44]
lea edx, [esp + 0x148]
mov dword [esp + 0x10], ebp
mov dword [esp + 0xc], edi
cmove edx, eax
test ecx, ecx
lea ecx, [esp + 0x44]
mov dword [esp + 8], edx
cmovne eax, ecx
mov dword [esp + 4], eax
mov eax, dword [esp + 0x24]
mov dword [esp], eax
call dword [sym.imp.WSOCK32.DLL_select]
sub esp, 0x14
cmp eax, 0xffffffff
jne 0x40c8b0
call dword [sym.imp.WSOCK32.DLL_WSAGetLastError]
test eax, eax
je 0x40c852
mov edx, dword [0x545078]
test edx, edx
jne 0x40ca0f
cmp eax, 0x2714
jne 0x40ca0f
test esi, esi
jle 0x40c883
call fcn.004122c0
mov ebx, dword [esp + 0x2c]
mov ecx, dword [esp + 0x28]
mov dword [esp], eax
mov dword [esp + 4], edx
mov dword [esp + 0xc], ebx
mov dword [esp + 8], ecx
mov ebx, esi
call fcn.004122f0
sub ebx, eax
test ebx, ebx
jle 0x40c9c0
mov ecx, dword [esp + 0x148]
cmp esi, 0
jg 0x40c7c0
jne 0x40c7eb
mov dword [esp + 0x3c], 0
mov dword [esp + 0x40], 0
jmp 0x40c7eb
test eax, eax
js 0x40ca0f
je 0x40c9c0
xor ebx, ebx
cmp dword [esp + 0x370], 0xffffffff
je 0x40c90b
lea eax, [esp + 0x44]
xor ebx, ebx
mov dword [esp + 4], eax
mov eax, dword [esp + 0x370]
mov dword [esp], eax
call sub.WSOCK32.DLL___WSAFDIsSet
sub esp, 8
test eax, eax
mov eax, dword [esp + 0x370]
setne bl
mov dword [esp + 4], edi
mov dword [esp], eax
call sub.WSOCK32.DLL___WSAFDIsSet
mov edx, ebx
sub esp, 8
or edx, 4
test eax, eax
cmovne ebx, edx
cmp dword [esp + 0x374], 0xffffffff
je 0x40c959
lea eax, [esp + 0x44]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x374]
mov dword [esp], eax
call sub.WSOCK32.DLL___WSAFDIsSet
mov edx, ebx
sub esp, 8
or edx, 8
test eax, eax
mov eax, dword [esp + 0x374]
cmovne ebx, edx
mov dword [esp + 4], edi
mov dword [esp], eax
call sub.WSOCK32.DLL___WSAFDIsSet
mov edx, ebx
sub esp, 8
or edx, 4
test eax, eax
cmovne ebx, edx
cmp dword [esp + 0x378], 0xffffffff
je 0x40c9aa
lea eax, [esp + 0x148]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x378]
mov dword [esp], eax
call sub.WSOCK32.DLL___WSAFDIsSet
mov edx, ebx
sub esp, 8
or edx, 2
test eax, eax
mov eax, dword [esp + 0x378]
cmovne ebx, edx
mov dword [esp + 4], edi
mov dword [esp], eax
call sub.WSOCK32.DLL___WSAFDIsSet
mov edx, ebx
sub esp, 8
or edx, 4
test eax, eax
cmovne ebx, edx
add esp, 0x35c
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
add esp, 0x35c
xor ebx, ebx
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
xor ecx, ecx
lea edi, [esp + 0x24c]
jmp 0x40c79e
xor eax, eax
cmp dword [esp + 0x374], 0xffffffff
mov edx, 0xffffffff
mov ecx, 1
jne 0x40c6b0
jmp 0x40c6f6
test esi, esi
je 0x40c9c0
mov eax, esi
call fcn.0040c570
mov ebx, eax
jmp 0x40c9aa
add esp, 0x35c
mov ebx, 0xffffffff
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, 1
lea edi, [esp + 0x24c]
jmp 0x40c775
mov eax, 1
xor ecx, ecx
jmp 0x40c6e1