Function at 0x4178a0
Capabilities:
Create directory
Shutdown system

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x12c
mov eax, dword [0x828208]
xor eax, esp
mov dword [esp + 0x128], eax
push edi
push dword [0x85bac4]
push dword [0x867ad0]
push str.Before_HandlePdkOutput_ErrorCode:_08x__Status:_08x_n
push 0x848ae0
call fcn.0040adc0
push ecx
call fcn.0040b3d0
add esp, 0x14
mov edi, eax
push dword [0x85bac4]
push dword [0x867ad0]
push str.After_HandlePdkOutput_ErrorCode:_08x__Status:_08x_n
push 0x848ae0
call fcn.0040adc0
add esp, 0x10
call fcn.0040ab20
cmp byte [0x86c131], 0
jne 0x417927
call fcn.0042cd80
mov eax, edi
pop edi
mov ecx, dword [esp + 0x128]
xor ecx, esp
call fcn.0048980e
mov esp, ebp
pop ebp
ret
mov ecx, dword [0x85bac4]
test cx, cx
je 0x4179f6
test cl, 1
je 0x4179f6
test cl, 0x20
je 0x417949
call fcn.0041f9b0
push 0
lea eax, [esp + 0x10]
mov dword [esp + 0x10], 0
push 0
push eax
mov byte [esp + 0x17], 0
call fcn.0042cbe0
add esp, 0xc
test eax, eax
jne 0x4179d1
mov eax, dword [esp + 0xc]
push 0x78
push 0x70
mov eax, dword [eax + 4]
mov eax, dword [eax + 0x18]
call eax
add esp, 8
test eax, eax
jne 0x41799b
mov eax, dword [esp + 0xc]
lea ecx, [esp + 0xb]
push ecx
push 0x71
mov eax, dword [eax + 4]
mov eax, dword [eax]
call eax
add esp, 8
test eax, eax
jne 0x4179d1
mov eax, dword [esp + 0xc]
push 0x78
push 0x70
mov eax, dword [eax + 4]
mov eax, dword [eax + 0x18]
call eax
add esp, 8
test eax, eax
jne 0x4179f6
mov eax, dword [esp + 0xc]
mov ecx, dword [eax + 4]
mov al, byte [esp + 0xb]
or al, 0x40
movzx eax, al
push eax
mov eax, dword [ecx + 0x18]
push 0x71
call eax
add esp, 8
test eax, eax
je 0x4179f6
push ecx
mov ecx, 0x848ae0
call fcn.0040a360
add esp, 4
push str.Error:_Failed_to_set_RBU_flag_n
push 0x848ae0
call fcn.0040abf0
add esp, 8
call fcn.0040ab20
call fcn.0042cd80
cmp byte [0x848ae4], 0
jne 0x417b64
cmp dword [0x84b8b4], 0
je 0x417b64
xor edx, edx
lea ecx, [esp + 0x28]
call fcn.00408440
lea ecx, [esp + 0x28]
call fcn.00417760
cmp byte [0x848b10], 0
je 0x417a59
cmp byte [0x848ae3], 0
jne 0x417a59
push 0
lea eax, [esp + 0x2c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
mov ecx, str._statusreport
call fcn.00409460
call fcn.0040b890
jmp 0x417a97
mov eax, dword [0x86bdfc]
cmp eax, 1
jne 0x417a87
mov eax, dword [0x8483c4]
test byte [eax + 4], 0x40
je 0x417a97
mov edx, dword [0x867ce8]
mov ecx, 0x848ae0
call fcn.00406920
xor ecx, ecx
call fcn.00409460
jmp 0x417a97
test eax, eax
jne 0x417a97
xor edx, edx
mov ecx, 0x848ae0
call fcn.00406920
lea eax, [esp + 0x10]
push eax
push str.SeShutdownPrivilege
push 0
call dword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueA]
test eax, eax
je 0x417b49
lea eax, [esp + 0xc]
push eax
push 0xf01ff
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x417b49
mov eax, dword [esp + 0x10]
push 0
push 0
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x1c]
push 0
mov dword [esp + 0x2c], eax
lea eax, [esp + 0x24]
push eax
push 0
push dword [esp + 0x20]
mov dword [esp + 0x30], 1
mov dword [esp + 0x3c], 2
call dword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
test eax, eax
je 0x417b49
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x417b49
cmp byte [0x837fae], al
je 0x417bdf
push str.NtShutdownSystem
push str.NTDLL.DLL
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x837da0], eax
test eax, eax
je 0x417b49
push 1
call eax
test eax, eax
je 0x417bf1
cmp byte [0x848ae9], 0
je 0x417b64
push str.Error:_Flash_reboot_request_failed_n
push 0x848ae0
call fcn.0040abf0
add esp, 8
mov eax, dword [0x86c1b8]
test eax, eax
je 0x417b7f
push eax
mov eax, dword [eax]
call eax
add esp, 4
mov dword [0x86c1b8], 0
xor edx, edx
lea ecx, [esp + 0x28]
call fcn.00408440
lea ecx, [esp + 0x28]
call fcn.00417760
cmp byte [0x848b10], 0
je 0x417c01
cmp byte [0x848ae3], 0
jne 0x417c01
cmp dword [0x85bac4], 0
je 0x417c01
push 0
lea eax, [esp + 0x2c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
mov ecx, str._statusreport
call fcn.00409460
call fcn.0040b890
mov eax, edi
pop edi
mov ecx, dword [esp + 0x128]
xor ecx, esp
call fcn.0048980e
mov esp, ebp
pop ebp
ret
push 0
push 0x12
call dword [sym.imp.USER32.dll_ExitWindowsEx]
test eax, eax
je 0x417b49
push 0x7530
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x417b64
cmp dword [0x86bdfc], 1
jne 0x417c2c
mov eax, dword [0x8483c4]
test byte [eax + 4], 0x40
je 0x417c2c
mov edx, dword [0x867ce8]
mov ecx, 0x848ae0
call fcn.00406920
xor ecx, ecx
call fcn.00409460
mov ecx, dword [esp + 0x12c]
mov eax, edi
pop edi
xor ecx, esp
call fcn.0048980e
mov esp, ebp
pop ebp
ret