Function at 0x140039380
Capabilities:
Create process on windows
Get common file path
Set registry value

Disassembly:
push rbp
push rdi
push r12
push r14
push r15
lea rbp, [rsp - 0x640]
sub rsp, 0x740
mov rax, qword [0x1400e00c0]
xor rax, rsp
mov qword [rbp + 0x630], rax
xorps xmm0, xmm0
mov dword [rbp - 0x80], 0x68
xor eax, eax
mov r14, rcx
lea rcx, [rbp - 0x10]
mov dword [rbp - 0x1c], eax
xor edx, edx
mov qword [rsp + 0x70], rax
mov r8d, 0x208
movups xmmword [rbp - 0x7c], xmm0
movups xmmword [rbp - 0x6c], xmm0
movups xmmword [rbp - 0x5c], xmm0
movups xmmword [rbp - 0x4c], xmm0
movups xmmword [rbp - 0x3c], xmm0
movups xmmword [rbp - 0x2c], xmm0
movups xmmword [rsp + 0x60], xmm0
call fcn.140072740
mov edx, 0x104
lea rcx, [rbp - 0x10]
call qword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
xor edx, edx
lea rcx, [rbp + 0x200]
mov r8d, 0x430
call fcn.140072740
lea r9, [rbp - 0x10]
mov edx, 0x218
lea r8, str.__scmd.exe___C__bcdedit__deletevalue_current_safeboot_
lea rcx, [rbp + 0x200]
call fcn.140041e70
xor r15d, r15d
lea rax, [rsp + 0x60]
mov qword [rsp + 0x48], rax
lea rdx, [rbp + 0x200]
lea rax, [rbp - 0x80]
xor r9d, r9d
mov qword [rsp + 0x40], rax
xor r8d, r8d
mov qword [rsp + 0x38], r15
xor ecx, ecx
mov qword [rsp + 0x30], r15
mov dword [rsp + 0x28], 0x8000000
mov dword [rsp + 0x20], r15d
call qword [sym.imp.KERNEL32.dll_CreateProcessW]
test eax, eax
jne 0x140039481
lea rcx, str.Couldnt_delete_safemode
call fcn.1400262b0
jmp 0x1400394a7
mov rcx, qword [rsp + 0x60]
mov edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, 2
mov qword [rsp + 0x778], rbx
lea r12d, [rdi - 1]
cmp byte [r14 + 0x45c], r15b
je 0x140039582
mov eax, dword [r14 + 0x458]
xor bl, bl
mov qword [rsp + 0x780], rsi
mov esi, edi
mov dword [rsp + 0x50], eax
mov qword [rsp + 0x58], r15
mov qword [rsp + 0x40], r15
lea rax, [rsp + 0x58]
mov qword [rsp + 0x38], rax
lea rdx, str.SOFTWAREMicrosoftWindowsCurrentVersionDriverSearching
mov qword [rsp + 0x30], r15
xor r9d, r9d
mov dword [rsp + 0x28], 0xf003f
xor r8d, r8d
mov rcx, 0xffffffff80000002
mov dword [rsp + 0x20], r15d
call qword [sym.imp.ADVAPI32.dll_RegCreateKeyExW]
test eax, eax
jne 0x140039561
mov rcx, qword [rsp + 0x58]
lea rax, [rsp + 0x50]
mov dword [rsp + 0x28], 4
lea rdx, str.SearchOrderConfig
mov r9d, 4
mov qword [rsp + 0x20], rax
xor r8d, r8d
call qword [sym.imp.ADVAPI32.dll_RegSetValueExW]
mov rcx, qword [rsp + 0x58]
test eax, eax
movzx ebx, bl
cmove ebx, r12d
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
sub rsi, r12
jne 0x1400394e1
mov rsi, qword [rsp + 0x780]
test bl, bl
jne 0x140039582
lea rcx, str.PrecheckSystem_:_Failed_to_set_key
call fcn.1400262b0
cmp byte [r14 + 0x464], r15b
je 0x14003963a
mov eax, dword [r14 + 0x460]
xor bl, bl
mov dword [rsp + 0x50], eax
mov qword [rsp + 0x58], r15
mov qword [rsp + 0x40], r15
lea rax, [rsp + 0x58]
mov qword [rsp + 0x38], rax
lea rdx, str.SOFTWAREMicrosoftWindowsCurrentVersionDriverSearching
mov qword [rsp + 0x30], r15
xor r9d, r9d
mov dword [rsp + 0x28], 0xf003f
xor r8d, r8d
mov rcx, 0xffffffff80000002
mov dword [rsp + 0x20], r15d
call qword [sym.imp.ADVAPI32.dll_RegCreateKeyExW]
test eax, eax
jne 0x140039621
mov rcx, qword [rsp + 0x58]
lea rax, [rsp + 0x50]
mov dword [rsp + 0x28], 4
lea rdx, str.DontSearchWindowsUpdate
mov r9d, 4
mov qword [rsp + 0x20], rax
xor r8d, r8d
call qword [sym.imp.ADVAPI32.dll_RegSetValueExW]
mov rcx, qword [rsp + 0x58]
test eax, eax
movzx ebx, bl
cmove ebx, r12d
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
sub rdi, r12
jne 0x1400395a1
test bl, bl
jne 0x14003963a
lea rcx, str.PrecheckSystem_:_Failed_to_set_key
call fcn.1400262b0
mov rbx, qword [rsp + 0x778]
mov rcx, qword [rbp + 0x630]
xor rcx, rsp
call fcn.140070140
add rsp, 0x740
pop r15
pop r14
pop r12
pop rdi
pop rbp
ret