Function at 0x414dd0
Capabilities:
Shutdown system

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4e198d
mov eax, dword fs:[0]
push eax
sub esp, 0x5c
mov eax, dword [0x521104]
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 [0x521bb0]
movq qword [ebp - 0x4c], xmm0
mov dword [ebp - 0x44], eax
call fcn.0040b1c0
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.00416630
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 0x414e6f
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 0x414fa1
lea eax, [ebp - 0x20]
push eax
push str.SeShutdownPrivilege
push 0
call dword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueW]
test eax, eax
je 0x414f98
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 0x414f98
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x514
je 0x414f98
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 0x414fd9
call dword [sym.imp.KERNEL32.dll_GetLastError]
movq xmm0, qword [str.sfxsh]
mov ecx, str.C:BUILDworke0dd96435fde7cb0projects_avastinstupStubs_srcSfxHlp.cpp
mov edx, dword [0x521bb0]
mov esi, eax
movq qword [ebp - 0x4c], xmm0
mov dword [ebp - 0x44], edx
call fcn.0040b1c0
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.0040b690
mov dword [ebp - 4], 0
mov ecx, dword [ebp - 0x18]
test ecx, ecx
je 0x414f5a
push esi
push str.Reboot:_InitiateSystemShutdownEx_returned_0x_08X
lea eax, [ebp - 0x4c]
push eax
push 7
call fcn.00413d50
mov edi, dword [ebp - 0x14]
test edi, edi
je 0x414fd9
or ebx, 0xffffffff
mov eax, ebx
lock xadd dword [edi + 4], eax
jne 0x414fd9
mov eax, dword [edi]
mov esi, dword [eax]
mov ecx, esi
call dword [0x4ed33c]
mov ecx, edi
call esi
lock xadd dword [edi + 8], ebx
dec ebx
jne 0x414fd9
mov eax, dword [edi]
mov esi, dword [eax + 4]
mov ecx, esi
call dword [0x4ed33c]
mov ecx, edi
call esi
jmp 0x414fd9
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 [0x521bb0]
movq qword [ebp - 0x64], xmm0
mov dword [ebp - 0x5c], eax
call fcn.0040b1c0
mov dword [ebp - 0x54], edx
lea edx, [ebp - 0x64]
push ecx
mov dword [ebp - 0x58], eax
mov dword [ebp - 0x50], 0x111
call fcn.00416a40
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.004a389b
mov esp, ebp
pop ebp
ret