Function at 0x140004064
Capabilities:
Shutdown system

Disassembly:
mov rax, rsp
push rbp
push rsi
push rdi
push r12
push r13
mov rbp, rsp
sub rsp, 0x50
mov qword [rbp - 0x10], 0xfffffffffffffffe
mov qword [rax + 8], rbx
mov rdi, rcx
mov rax, qword [0x14003a140]
lea r13, [0x14003a140]
mov rcx, r13
mov rax, qword [rax + 0x18]
call qword [0x140025fc8]
add rax, 0x18
mov qword [rbp + 0x38], rax
mov ebx, 1
mov r8d, ebx
mov rcx, rdi
call fcn.1400042fc
mov esi, eax
or r12d, 0xffffffff
test eax, eax
jns 0x140004111
cmp qword [rdi], 0
je 0x1400042b5
mov rdx, qword [0x14003a140]
mov rcx, r13
mov rax, qword [rdx + 0x18]
call qword [0x140025fc8]
add rax, 0x18
mov qword [rbp + 0x40], rax
lea rdx, str.In_order_to_complete_the_changes__a_restart_is_required.
lea rcx, [rbp + 0x40]
call fcn.140004dd8
mov rbx, qword [rbp + 0x40]
mov r8, rbx
lea edx, [r12 + 4]
mov rcx, qword [rdi]
call fcn.1400189f0
nop
jmp 0x140004291
mov dword [rsp + 0x28], 0x80020003
mov dword [rsp + 0x20], ebx
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.ADVAPI32.dll_InitiateSystemShutdownExW]
nop dword [rax + rax]
test eax, eax
jne 0x14000423a
call qword [sym.imp.KERNEL32.dll_GetLastError]
nop dword [rax + rax]
mov ebx, eax
lea rdx, [rbp + 0x38]
mov ecx, eax
call fcn.14001abf8
movzx esi, bx
or esi, 0x80070000
test ebx, ebx
cmovle esi, ebx
cmp qword [rdi], 0
je 0x14000423a
mov rax, qword [0x14003a140]
mov rcx, r13
mov rax, qword [rax + 0x18]
call qword [0x140025fc8]
add rax, 0x18
mov qword [rbp + 0x48], rax
mov r8d, esi
lea rdx, str.Failed_restart_attempt_with_HRESULT_X
lea rcx, [rbp + 0x48]
call fcn.140004dd8
mov rbx, qword [rbp + 0x48]
mov r8, rbx
mov edx, 3
mov rcx, qword [rdi]
call fcn.1400189f0
nop
lea rdx, [rbx - 0x18]
mov eax, r12d
lock xadd dword [rdx + 0x10], eax
add eax, r12d
test eax, eax
jg 0x1400041d3
mov rcx, qword [rdx]
mov rax, qword [rcx]
mov rax, qword [rax + 8]
call qword [0x140025fc8]
cmp qword [rdi], 0
je 0x14000423a
mov rax, qword [0x14003a140]
mov rcx, r13
mov rax, qword [rax + 0x18]
call qword [0x140025fc8]
add rax, 0x18
mov qword [rbp - 0x20], rax
mov rdx, qword [rbp + 0x38]
lea rcx, [rbp - 0x20]
call fcn.140004dd8
mov rbx, qword [rbp - 0x20]
mov r8, rbx
mov edx, 3
mov rcx, qword [rdi]
call fcn.1400189f0
nop
lea rdx, [rbx - 0x18]
mov eax, r12d
lock xadd dword [rdx + 0x10], eax
add eax, r12d
test eax, eax
jg 0x14000423a
mov rcx, qword [rdx]
mov rax, qword [rcx]
mov rax, qword [rax + 8]
call qword [0x140025fc8]
xor r8d, r8d
mov rcx, rdi
call fcn.1400042fc
mov ebx, eax
cmp qword [rdi], 0
je 0x1400042b5
mov rcx, qword [0x14003a140]
mov rax, qword [rcx + 0x18]
mov rcx, r13
call qword [0x140025fc8]
add rax, 0x18
mov qword [rbp - 0x18], rax
mov r8d, ebx
lea rdx, str.Failed_disabling_shutdown_privilege._HRESULT_X
lea rcx, [rbp - 0x18]
call fcn.140004dd8
mov rbx, qword [rbp - 0x18]
mov r8, rbx
mov edx, 3
mov rcx, qword [rdi]
call fcn.1400189f0
nop
lea rdx, [rbx - 0x18]
mov eax, r12d
lock xadd dword [rdx + 0x10], eax
add eax, r12d
test eax, eax
jg 0x1400042b5
mov rcx, qword [rdx]
mov rax, qword [rcx]
mov rax, qword [rax + 8]
call qword [0x140025fc8]
nop
mov rdx, qword [rbp + 0x38]
add rdx, 0xffffffffffffffe8
mov eax, r12d
lock xadd dword [rdx + 0x10], eax
add eax, r12d
test eax, eax
jg 0x1400042dc
mov rcx, qword [rdx]
mov rax, qword [rcx]
mov rax, qword [rax + 8]
call qword [0x140025fc8]
mov eax, esi
mov rbx, qword [rsp + 0x80]
add rsp, 0x50
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret