Function at 0x140016bc0
Capabilities:
Shutdown system

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x18], rsi
mov qword [rsp + 0x20], rdi
push rbp
lea rbp, [rsp - 0x20]
sub rsp, 0x120
mov rax, qword [0x14006b020]
xor rax, rsp
mov qword [rbp + 0x10], rax
mov rbx, rdx
lea rsi, vtable.CTracePie.0
mov qword [rsp + 0x50], rsi
xor edi, edi
mov qword [rbp - 8], rdi
mov word [rbp], 0x100
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [rbp - 8], eax
call qword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov dword [rbp - 4], eax
lea r9d, [rdi + 0x3a]
lea r8, str.OsShutdown::PlatformShutdown
lea edx, [rdi + 0x78]
lea rcx, [rsp + 0x58]
call fcn.1400133b0
lea r9d, [rdi + 0x16]
lea r8, str.PIE_Common
lea edx, [rdi + 0x28]
lea rcx, [rbp - 0x30]
call fcn.1400133b0
cmp byte [rbp + 1], 1
jne 0x140016c60
lea r8, [0x14005a24c]
lea edx, [rdi + 5]
lea rcx, [rsp + 0x50]
call fcn.1400134a0
lea rax, vtable.CTracePieCommon.0
mov qword [rsp + 0x50], rax
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov rcx, rax
lea r8, [rsp + 0x30]
mov edx, 0x28
call qword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
jne 0x140016cc2
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r9d, eax
lea r8, str.Failed_to_get_current_process_token_handle__error_code:__d
mov edx, 2
lea rcx, [rsp + 0x50]
call fcn.1400134a0
mov rcx, qword [rsp + 0x30]
test rcx, rcx
je 0x140016cbd
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsp + 0x30], rdi
jmp 0x140016df1
mov dword [rsp + 0x44], 2
mov dword [rsp + 0x38], 1
lea r8, [rsp + 0x3c]
lea rdx, str.SeShutdownPrivilege
xor ecx, ecx
call qword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueW]
test eax, eax
jne 0x140016d09
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r9d, eax
lea r8, str.LookupPrivilegeValue_failed__error_code:__d
mov edx, 2
lea rcx, [rsp + 0x50]
call fcn.1400134a0
mov qword [rsp + 0x28], rdi
mov qword [rsp + 0x20], rdi
xor r9d, r9d
lea r8, [rsp + 0x38]
xor edx, edx
mov rcx, qword [rsp + 0x30]
call qword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
test eax, eax
jne 0x140016d65
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r9d, eax
lea r8, str.AdjustTokenPrivileges_failed__error_code:__d
mov edx, 2
lea rcx, [rsp + 0x50]
call fcn.1400134a0
mov rcx, qword [rsp + 0x30]
test rcx, rcx
je 0x140016d60
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsp + 0x30], rdi
jmp 0x140016df1
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x140016d9f
mov r9d, eax
lea r8, str.Not_all_priviledges_were_adjusted__error_code:__d
mov edx, 2
lea rcx, [rsp + 0x50]
call fcn.1400134a0
mov rcx, qword [rsp + 0x30]
test rcx, rcx
je 0x140016d9d
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsp + 0x30], rdi
jmp 0x140016df1
mov dword [rsp + 0x20], 1
xor r9d, r9d
lea r8d, [r9 + 0x78]
mov rdx, rbx
xor ecx, ecx
call qword [sym.imp.ADVAPI32.dll_InitiateSystemShutdownW]
test eax, eax
jne 0x140016e1d
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r9d, eax
lea r8, str.Failed_to_initiate_system_shutdown__error_code:__d
mov edx, 2
lea rcx, [rsp + 0x50]
call fcn.1400134a0
mov rcx, qword [rsp + 0x30]
test rcx, rcx
je 0x140016df1
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsp + 0x30], rdi
cmp byte [rbp + 1], 1
mov qword [rsp + 0x50], rsi
jne 0x140016e19
cmp byte [rbp], 0
jne 0x140016e19
lea r8, [0x14005a254]
mov edx, 5
lea rcx, [rsp + 0x50]
call fcn.1400134a0
nop
xor eax, eax
jmp 0x140016e82
mov dword [rsp + 0x44], edi
mov qword [rsp + 0x28], rdi
mov qword [rsp + 0x20], rdi
xor r9d, r9d
lea r8, [rsp + 0x38]
xor edx, edx
mov rcx, qword [rsp + 0x30]
call qword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
mov rcx, qword [rsp + 0x30]
test rcx, rcx
je 0x140016e55
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsp + 0x30], rdi
mov qword [rsp + 0x50], rsi
cmp byte [rbp + 1], 1
jne 0x140016e7d
cmp byte [rbp], 0
jne 0x140016e7d
lea r8, [0x14005a254]
mov edx, 5
lea rcx, [rsp + 0x50]
call fcn.1400134a0
nop
mov eax, 1
mov rcx, qword [rbp + 0x10]
xor rcx, rsp
call fcn.1400223c0
lea r11, [rsp + 0x120]
mov rbx, qword [r11 + 0x10]
mov rsi, qword [r11 + 0x20]
mov rdi, qword [r11 + 0x28]
mov rsp, r11
pop rbp
ret