Function at 0x415090
Capabilities:
Shutdown system

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4de6ed
mov eax, dword fs:[0]
push eax
sub esp, 0x5c
mov eax, dword [0x51c100]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
movq xmm0, qword [0x522e58]
mov ecx, str.C:BUILDworke0dd96435fde7cb0projects_avastinstupStubs_srcSfxHlp.cpp
mov eax, dword [0x522e60]
movq qword [ebp - 0x4c], xmm0
mov dword [ebp - 0x44], eax
call fcn.0040b560
mov dword [ebp - 0x3c], edx
lea ecx, [ebp - 0x4c]
mov edx, str.Reboot:_Restarting_windows...
mov dword [ebp - 0x40], eax
mov dword [ebp - 0x38], 0xeb
call fcn.00416710
lea eax, [ebp - 0x34]
mov dword [ebp - 0x34], 0
push eax
push 0
push 0x28
call dword [sym.imp.KERNEL32.dll_GetCurrentThread]
push eax
call dword [sym.imp.ADVAPI32.dll_OpenThreadToken]
test eax, eax
jne 0x41512f
lea eax, [ebp - 0x34]
push eax
push 0x28
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x415261
lea eax, [ebp - 0x20]
push eax
push str.SeShutdownPrivilege
push 0
call dword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueW]
test eax, eax
je 0x415258
mov eax, dword [ebp - 0x20]
mov ecx, dword [ebp - 0x1c]
push 0
push 0
push 0x10
mov dword [ebp - 0x2c], eax
lea eax, [ebp - 0x30]
push eax
push 0
push dword [ebp - 0x34]
mov dword [ebp - 0x30], 1
mov dword [ebp - 0x28], ecx
mov dword [ebp - 0x24], 2
call dword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
test eax, eax
je 0x415258
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x514
je 0x415258
push dword [ebp - 0x34]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x80040002
push 1
push 0
push 0
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_InitiateSystemShutdownExW]
test eax, eax
jne 0x41529d
call dword [sym.imp.KERNEL32.dll_GetLastError]
movq xmm0, qword [0x522e58]
mov ecx, str.C:BUILDworke0dd96435fde7cb0projects_avastinstupStubs_srcSfxHlp.cpp
mov edx, dword [0x522e60]
mov esi, eax
movq qword [ebp - 0x4c], xmm0
mov dword [ebp - 0x44], edx
call fcn.0040b560
xorps xmm0, xmm0
mov dword [ebp - 0x40], eax
lea ecx, [ebp - 0x18]
mov dword [ebp - 0x3c], edx
mov dword [ebp - 0x38], 0x10c
movlpd qword [ebp - 0x18], xmm0
call fcn.0040ba10
mov dword [ebp - 4], 0
mov ecx, dword [ebp - 0x18]
test ecx, ecx
je 0x41521a
push esi
push str.Reboot:_InitiateSystemShutdownEx_returned_0x_08X
lea eax, [ebp - 0x4c]
push eax
push 7
call fcn.00413fc0
mov edi, dword [ebp - 0x14]
test edi, edi
je 0x41529d
or ebx, 0xffffffff
mov eax, ebx
lock xadd dword [edi + 4], eax
jne 0x41529d
mov eax, dword [edi]
mov esi, dword [eax]
mov ecx, esi
call dword [0x4e933c]
mov ecx, edi
call esi
lock xadd dword [edi + 8], ebx
dec ebx
jne 0x41529d
mov eax, dword [edi]
mov esi, dword [eax + 4]
mov ecx, esi
call dword [0x4e933c]
mov ecx, edi
call esi
jmp 0x41529d
push dword [ebp - 0x34]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
movq xmm0, qword [0x522e58]
mov ecx, str.C:BUILDworke0dd96435fde7cb0projects_avastinstupStubs_srcSfxHlp.cpp
mov eax, dword [0x522e60]
movq qword [ebp - 0x64], xmm0
mov dword [ebp - 0x5c], eax
call fcn.0040b560
mov dword [ebp - 0x54], edx
lea edx, [ebp - 0x64]
push str.Reboot:_AdjustPrivilege_for_SE_SHUTDOWN_NAME_has_failed.
mov dword [ebp - 0x58], eax
mov dword [ebp - 0x50], 0x111
call fcn.00416b30
add esp, 4
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004a057b
mov esp, ebp
pop ebp
ret