Function at 0x46d180
Capabilities:
Shutdown system

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x4cfb16
mov eax, dword fs:[0]
push eax
sub esp, 0x128
mov eax, dword [0x4f5568]
xor eax, esp
mov dword [esp + 0x120], eax
push ebx
push esi
push edi
mov eax, dword [0x4f5568]
xor eax, esp
push eax
lea eax, [esp + 0x138]
mov dword fs:[0], eax
mov edi, ecx
mov eax, dword [ebp + 8]
movzx ebx, ax
lea eax, [edi + 0x324]
mov dword [esp + 0x14], eax
mov esi, dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push eax
mov dword [esp + 0x1c], 0x28
call esi
lea eax, [edi + 8]
mov dword [esp + 0x140], 0
mov dword [esp + 0x1c], eax
push eax
mov dword [esp + 0x24], 0x29
call esi
mov byte [esp + 0x140], 1
mov eax, dword [edi + 0x110]
mov esi, dword [eax]
cmp esi, eax
je 0x46d220
cmp word [esi + 8], bx
je 0x46d23e
mov esi, dword [esi]
cmp esi, eax
jne 0x46d214
mov eax, dword [edi + 0x118]
mov esi, dword [eax]
cmp esi, eax
je 0x46d2b0
cmp word [esi + 8], bx
je 0x46d266
mov esi, dword [esi]
cmp esi, eax
jne 0x46d230
jmp 0x46d2b0
push str.vncserver.cpp_:_removing_unauthorised_client_n
push 9
push 0x4f6c50
call fcn.00414f90
mov ecx, dword [esi + 4]
mov eax, dword [esi]
mov dword [ecx], eax
mov ecx, dword [esi]
mov eax, dword [esi + 4]
mov dword [ecx + 4], eax
dec dword [edi + 0x114]
jmp 0x46d28c
push str.vncserver.cpp_:_removing_authorised_client_n
push 9
push 0x4f6c50
call fcn.00414f90
mov ecx, dword [esi + 4]
mov eax, dword [esi]
mov dword [ecx], eax
mov ecx, dword [esi]
mov eax, dword [esi + 4]
mov dword [ecx + 4], eax
dec dword [edi + 0x11c]
add esp, 0xc
push esi
call fcn.004ad35b
mov eax, 0x1ff
add esp, 4
cmp bx, ax
ja 0x46d2b0
movsx eax, bx
mov dword [edi + eax*4 + 0x120], 0
mov esi, dword [edi + 0x33c]
lea ebx, [esi + 4]
push ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [esi + 0x1c]
test eax, eax
je 0x46d317
mov ecx, dword [eax + 0x54]
mov dword [esi + 0x1c], ecx
test ecx, ecx
jne 0x46d2d6
mov dword [esi + 0x20], ecx
jmp 0x46d2dd
mov dword [ecx + 0x58], 0
push 0
push 1
push dword [eax + 0x50]
mov dword [eax + 0x5c], 0
call dword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
test eax, eax
jne 0x46d317
call dword [sym.imp.KERNEL32.dll_GetLastError]
push ebx
mov esi, eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push 0x4f1d54
lea eax, [esp + 0x14]
mov dword [esp + 0x14], esi
push eax
call fcn.004b6aeb
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
call ebx
lea eax, [edi + 8]
mov byte [esp + 0x140], 0
push eax
call ebx
cmp dword [edi + 0x11c], 0
jne 0x46d433
cmp dword [edi + 0x78], 0
je 0x46d433
push str.vncserver.cpp_:_deleting_desktop_server_n
push 0
push 0x4f6c50
call fcn.00414f90
mov eax, dword [edi]
add esp, 0xc
mov ecx, edi
call dword [eax + 0x2b4]
test eax, eax
jne 0x46d401
cmp byte [edi + 0x60], al
jne 0x46d401
mov eax, dword [edi]
mov ecx, edi
call dword [eax + 0x1d4]
cmp eax, 1
je 0x46d3fc
cmp byte [edi + 0x84c], 0
jne 0x46d3fc
mov eax, dword [edi]
mov ecx, edi
call dword [eax + 0x1d4]
cmp eax, 1
jle 0x46d401
lea ecx, [esp + 0x24]
call fcn.0046fff0
mov ecx, 0x4d9f42
lea eax, [esp + 0x24]
lea ecx, [ecx]
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x46d3d0
test dl, dl
je 0x46d3cc
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x46d3d0
add eax, 2
add ecx, 2
test dl, dl
jne 0x46d3b0
xor eax, eax
jmp 0x46d3d5
sbb eax, eax
or eax, 1
test eax, eax
je 0x46d401
push 0
push 0
call dword [sym.imp.USER32.dll_ExitWindowsEx]
test eax, eax
jne 0x46d401
push str.vncserver.cpp_:_client_disconnect___failed_to_logoff_user__n
push eax
push 0x4f6c50
call fcn.00414f90
add esp, 0xc
jmp 0x46d401
call fcn.004707a0
mov esi, dword [edi + 0x78]
test esi, esi
je 0x46d418
mov ecx, esi
call fcn.0043bdf0
push esi
call fcn.004ad35b
add esp, 4
push str.vncserver.cpp_:_desktop_deleted_n
push 0
push 0x4f6c50
mov dword [edi + 0x78], 0
call fcn.00414f90
add esp, 0xc
mov eax, dword [edi]
mov ecx, edi
push 0
push 0
push 0x8004
call dword [eax + 0xa0]
push str.vncserver.cpp_:_RemoveClient___done_n
push 9
push 0x4f6c50
call fcn.00414f90
add esp, 0xc
mov dword [esp + 0x140], 0xffffffff
lea eax, [edi + 0x324]
push eax
call ebx
mov ecx, dword [esp + 0x138]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x120]
xor ecx, esp
call fcn.004aca59
mov esp, ebp
pop ebp
ret 4