Function at 0x4154b0
Capabilities:
Shutdown system

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4e2d5d
mov eax, dword fs:[0]
push eax
sub esp, 0x5c
mov eax, dword [0x522104]
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 [str.sfxsh]
mov ecx, str.C:BUILDworke0dd96435fde7cb0projects_avastinstupStubs_srcSfxHlp.cpp
mov eax, dword [0x522bb0]
movq qword [ebp - 0x4c], xmm0
mov dword [ebp - 0x44], eax
call fcn.0040b8a0
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.00416d90
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 0x41554f
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 0x415681
lea eax, [ebp - 0x20]
push eax
push str.SeShutdownPrivilege
push 0
call dword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueW]
test eax, eax
je 0x415678
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 0x415678
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x514
je 0x415678
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 0x4156b9
call dword [sym.imp.KERNEL32.dll_GetLastError]
movq xmm0, qword [str.sfxsh]
mov ecx, str.C:BUILDworke0dd96435fde7cb0projects_avastinstupStubs_srcSfxHlp.cpp
mov edx, dword [0x522bb0]
mov esi, eax
movq qword [ebp - 0x4c], xmm0
mov dword [ebp - 0x44], edx
call fcn.0040b8a0
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.0040bd70
mov dword [ebp - 4], 0
mov ecx, dword [ebp - 0x18]
test ecx, ecx
je 0x41563a
push esi
push str.Reboot:_InitiateSystemShutdownEx_returned_0x_08X
lea eax, [ebp - 0x4c]
push eax
push 7
call fcn.00414430
mov edi, dword [ebp - 0x14]
test edi, edi
je 0x4156b9
or ebx, 0xffffffff
mov eax, ebx
lock xadd dword [edi + 4], eax
jne 0x4156b9
mov eax, dword [edi]
mov esi, dword [eax]
mov ecx, esi
call dword [0x4ee33c]
mov ecx, edi
call esi
lock xadd dword [edi + 8], ebx
dec ebx
jne 0x4156b9
mov eax, dword [edi]
mov esi, dword [eax + 4]
mov ecx, esi
call dword [0x4ee33c]
mov ecx, edi
call esi
jmp 0x4156b9
push dword [ebp - 0x34]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
movq xmm0, qword [str.sfxsh]
mov ecx, str.C:BUILDworke0dd96435fde7cb0projects_avastinstupStubs_srcSfxHlp.cpp
mov eax, dword [0x522bb0]
movq qword [ebp - 0x64], xmm0
mov dword [ebp - 0x5c], eax
call fcn.0040b8a0
mov dword [ebp - 0x54], edx
lea edx, [ebp - 0x64]
push ecx
mov dword [ebp - 0x58], eax
mov dword [ebp - 0x50], 0x111
call fcn.004171a0
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.004a4c5b
mov esp, ebp
pop ebp
ret