Function at 0x40ca40
Capabilities:
Get socket status

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x37c
mov ebx, dword [esp + 0x390]
mov dword [esp + 0x30], 0
mov dword [esp + 0x34], 0
test ebx, ebx
je 0x40ca8d
mov eax, dword [esp + 0x394]
test eax, eax
je 0x40ca8d
cmp dword [ebx], 0xffffffff
jne 0x40cab0
xor eax, eax
mov edx, dword [esp + 0x394]
jmp 0x40ca86
cmp dword [ebx + eax*8], 0xffffffff
jne 0x40cab0
add eax, 1
cmp edx, eax
jne 0x40ca80
mov ebp, dword [esp + 0x398]
test ebp, ebp
jne 0x40cc60
xor eax, eax
add esp, 0x37c
pop ebx
pop esi
pop edi
pop ebp
ret
mov edx, dword [esp + 0x398]
test edx, edx
jle 0x40cc80
call fcn.004122c0
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x398]
mov dword [esp + 0x34], edx
mov dword [esp + 0x38], eax
mov edi, dword [esp + 0x394]
lea eax, [ebx + 6]
mov dword [esp + 0x64], 0
mov dword [esp + 0x168], 0
mov dword [esp + 0x26c], 0
xor esi, esi
mov dword [esp + 0x44], eax
mov edx, eax
mov byte [esp + 0x4b], 0
lea edi, [ebx + edi*8 + 6]
mov dword [esp + 0x4c], 0
mov byte [esp + 0x4a], 0
mov dword [esp + 0x40], 0
mov byte [esp + 0x49], 0
xor ebp, ebp
mov dword [esp + 0x2c], edi
mov dword [esp + 0x3c], 0
xor edi, edi
lea esi, [esi]
xor eax, eax
mov word [edx], ax
mov eax, dword [edx - 6]
cmp eax, 0xffffffff
je 0x40cc90
movzx ebx, word [edx - 2]
test bl, 7
je 0x40cc90
test bl, 1
mov dword [esp + 0x24], edi
je 0x40cbb2
test edi, edi
je 0x40ce71
cmp eax, dword [esp + 0x68]
je 0x40cbb2
xor ecx, ecx
jmp 0x40cb8a
cmp eax, dword [esp + ecx*4 + 0x68]
je 0x40ce40
add ecx, 1
cmp ecx, edi
jne 0x40cb80
cmp edi, 0x3f
ja 0x40cf56
lea ecx, [edi + 1]
mov dword [esp + 0x24], ecx
mov dword [esp + edi*4 + 0x68], eax
mov edi, dword [esp + 0x24]
mov byte [esp + 0x4b], 1
mov dword [esp + 0x4c], edi
test bl, 4
mov ecx, esi
je 0x40cc00
test esi, esi
je 0x40ce57
cmp eax, dword [esp + 0x16c]
je 0x40cc00
xor ecx, ecx
jmp 0x40cbdd
cmp eax, dword [esp + ecx*4 + 0x16c]
je 0x40ce50
add ecx, 1
cmp ecx, esi
jne 0x40cbd0
cmp esi, 0x3f
ja 0x40cc00
lea edi, [esi + 1]
mov dword [esp + 0x40], edi
mov ecx, dword [esp + 0x40]
mov dword [esp + esi*4 + 0x16c], eax
mov byte [esp + 0x4a], 1
and ebx, 2
mov dword [esp + 0x28], ebp
je 0x40cc9a
test ebp, ebp
je 0x40ce64
cmp eax, dword [esp + 0x270]
je 0x40cc9a
xor ebx, ebx
jmp 0x40cc2f
cmp eax, dword [esp + ebx*4 + 0x270]
je 0x40ce31
add ebx, 1
cmp ebx, ebp
jne 0x40cc22
cmp ebp, 0x3f
ja 0x40cf6f
lea edi, [ebp + 1]
mov dword [esp + 0x3c], edi
mov dword [esp + ebp*4 + 0x270], eax
mov eax, dword [esp + 0x3c]
mov byte [esp + 0x49], 1
mov dword [esp + 0x28], eax
jmp 0x40cc9a
mov eax, dword [esp + 0x398]
call fcn.0040c570
add esp, 0x37c
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 0x38], 0
jmp 0x40cad7
mov ecx, esi
mov dword [esp + 0x24], edi
mov dword [esp + 0x28], ebp
add edx, 8
cmp edx, dword [esp + 0x2c]
mov ebp, dword [esp + 0x28]
mov esi, ecx
mov edi, dword [esp + 0x24]
jne 0x40cb40
cmp byte [esp + 0x49], 0
mov ebx, ebp
mov ebp, edi
jne 0x40cf5f
cmp byte [esp + 0x4a], 0
jne 0x40cf46
cmp byte [esp + 0x4b], 0
je 0x40ccda
mov eax, dword [esp + 0x4c]
mov dword [esp + 0x64], eax
test ebp, ebp
jne 0x40ccf0
test ecx, ecx
jne 0x40ccf0
test ebx, ebx
je 0x40ca8d
lea esi, [esi]
mov edi, dword [esp + 0x398]
lea esi, [esp + 0x5c]
mov eax, 0
test edi, edi
lea edi, [esp + 0x26c]
cmovs esi, eax
mov dword [esp + 0x24], esi
mov esi, dword [esp + 0x38]
jmp 0x40ce08
mov eax, esi
mov edx, 0x10624dd3
imul edx
mov eax, esi
sar eax, 0x1f
sar edx, 6
sub edx, eax
mov eax, esi
mov dword [esp + 0x5c], edx
imul edx, edx, 0x3e8
sub eax, edx
imul eax, eax, 0x3e8
mov dword [esp + 0x60], eax
xor eax, eax
test ebx, ebx
lea ebx, [esp + 0x64]
mov edx, eax
mov dword [esp], 0
cmovne edx, edi
test ecx, ecx
lea ecx, [esp + 0x168]
mov dword [esp + 0xc], edx
cmove ecx, eax
test ebp, ebp
mov ebp, dword [esp + 0x24]
cmovne eax, ebx
mov dword [esp + 8], ecx
mov dword [esp + 4], eax
mov dword [esp + 0x10], ebp
call dword [sym.imp.WSOCK32.DLL_select]
sub esp, 0x14
cmp eax, 0xffffffff
jne 0x40ce80
call dword [sym.imp.WSOCK32.DLL_WSAGetLastError]
test eax, eax
je 0x40cdb9
mov ebx, dword [0x545078]
test ebx, ebx
jne 0x40cf3c
cmp eax, 0x2714
jne 0x40cf3c
mov eax, dword [esp + 0x398]
test eax, eax
jle 0x40cdf6
call fcn.004122c0
mov esi, dword [esp + 0x30]
mov dword [esp], eax
mov dword [esp + 4], edx
mov dword [esp + 8], esi
mov esi, dword [esp + 0x34]
mov dword [esp + 0xc], esi
call fcn.004122f0
mov esi, dword [esp + 0x398]
sub esi, eax
test esi, esi
jle 0x40ca9c
mov ebx, dword [esp + 0x26c]
mov ecx, dword [esp + 0x168]
mov ebp, dword [esp + 0x64]
cmp dword [esp + 0x398], 0
jg 0x40cd20
jne 0x40cd4b
mov dword [esp + 0x5c], 0
mov dword [esp + 0x60], 0
jmp 0x40cd4b
mov dword [esp + 0x28], ebp
jmp 0x40cc9a
mov dword [esp + 0x24], edi
jmp 0x40cbb2
mov ecx, esi
jmp 0x40cc00
mov dword [esp + 0x40], 1
jmp 0x40cbf0
mov dword [esp + 0x3c], 1
jmp 0x40cc46
mov dword [esp + 0x24], 1
jmp 0x40cba1
test eax, eax
js 0x40cf3c
je 0x40ca9c
xor edi, edi
xor esi, esi
lea ebp, [esp + 0x168]
mov dword [esp + 0x24], edi
mov edi, dword [esp + 0x44]
jmp 0x40ceb8
cmp word [edi], 0
jne 0x40cf17
add esi, 1
add edi, 8
cmp dword [esp + 0x394], esi
je 0x40cf2b
mov eax, dword [edi - 6]
xor ecx, ecx
mov word [edi], cx
cmp eax, 0xffffffff
je 0x40cea9
mov dword [esp + 4], ebx
mov dword [esp], eax
call sub.WSOCK32.DLL___WSAFDIsSet
sub esp, 8
test eax, eax
je 0x40cedc
or word [edi], 1
mov dword [esp + 4], ebp
mov eax, dword [edi - 6]
mov dword [esp], eax
call sub.WSOCK32.DLL___WSAFDIsSet
sub esp, 8
test eax, eax
je 0x40cef6
or word [edi], 4
lea eax, [esp + 0x26c]
mov dword [esp + 4], eax
mov eax, dword [edi - 6]
mov dword [esp], eax
call sub.WSOCK32.DLL___WSAFDIsSet
sub esp, 8
test eax, eax
je 0x40cea3
or word [edi], 2
add dword [esp + 0x24], 1
add esi, 1
add edi, 8
cmp dword [esp + 0x394], esi
jne 0x40ceb8
mov edi, dword [esp + 0x24]
add esp, 0x37c
pop ebx
pop esi
mov eax, edi
pop edi
pop ebp
ret
mov eax, 0xffffffff
jmp 0x40ca9e
mov eax, dword [esp + 0x40]
mov dword [esp + 0x168], eax
jmp 0x40cccb
mov dword [esp + 0x24], ecx
jmp 0x40cbb2
mov eax, dword [esp + 0x3c]
mov dword [esp + 0x26c], eax
jmp 0x40ccc0
mov dword [esp + 0x28], ebx
jmp 0x40cc9a