Function at 0x140022058
Capabilities:
Check if file exists
Check mutex on windows
Get common file path
Identify system language via api
Set registry value

Disassembly:
mov rax, rsp
push rbp
push r12
push r13
lea rbp, [rax - 0x218]
sub rsp, 0x300
mov qword [rbp - 0x50], 0xfffffffffffffffe
mov qword [rax + 0x10], rbx
mov qword [rax + 0x18], rsi
mov qword [rax + 0x20], rdi
mov rax, qword [0x1402f2208]
xor rax, rsp
mov qword [rbp + 0x1f0], rax
mov rdi, rcx
xor r12d, r12d
mov qword [0x1402f5460], r12
mov qword [0x1402f5450], r12
lea r13d, [r12 + 1]
mov qword [0x1402f5468], r13
lea rax, [0x1402247d0]
mov qword [0x1402f5470], rax
lea rax, [0x1402f5450]
mov qword [0x1402e70b0], rax
lea rcx, str.NVCPLUI.EXE
call fcn.14001ed50
lea r8, str.GlobalInitializeSedona
mov edx, r13d
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateMutexW]
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
cmove rbx, r12
mov qword [rbp - 0x48], rbx
test rbx, rbx
jne 0x14002210f
xor eax, eax
jmp 0x140022528
lea rcx, [rsp + 0x60]
call fcn.14001f1d8
nop
lea rdx, [rsp + 0x60]
mov rcx, rdi
call fcn.140086844
mov esi, 0x104
mov edx, esi
lea rcx, [rbp - 0x20]
call qword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
lea r8, [0x14022ec24]
mov edx, esi
lea rcx, [rbp - 0x20]
call fcn.1401c28ec
lea r8, str.nvCpl.cpl
mov edx, esi
lea rcx, [rbp - 0x20]
call fcn.1401c28ec
lea rcx, [rbp - 0x20]
call qword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x1400221de
lea rax, [rsp + 0x54]
mov qword [rsp + 0x40], rax
lea rax, [rbp - 0x40]
mov qword [rsp + 0x38], rax
mov qword [rsp + 0x30], r12
mov dword [rsp + 0x28], 2
mov dword [rsp + 0x20], r12d
xor r9d, r9d
xor r8d, r8d
lea rdx, str.SOFTWARENVIDIA_CorporationGlobalNvCplApiPolicies
mov rcx, 0xffffffff80000002
call qword [sym.imp.ADVAPI32.dll_RegCreateKeyExW]
test eax, eax
jne 0x1400221de
mov dword [rsp + 0x50], r13d
mov dword [rsp + 0x28], 4
lea rax, [rsp + 0x50]
mov qword [rsp + 0x20], rax
mov r9d, 4
xor r8d, r8d
lea rdx, str.CplGroupUIPolicy
mov rcx, qword [rbp - 0x40]
call qword [sym.imp.ADVAPI32.dll_RegSetValueExW]
mov word [rsp + 0x54], r12w
mov dword [rsp + 0x50], r12d
xor r8d, r8d
lea rdx, [rsp + 0x50]
lea rcx, str.UserDefinedLocale
call fcn.140001510
test eax, eax
jne 0x140022221
lea rcx, [rsp + 0x54]
call fcn.1400015b4
test eax, eax
jne 0x140022217
call qword [sym.imp.KERNEL32.dll_GetUserDefaultUILanguage]
jmp 0x14002221c
movzx eax, word [rsp + 0x54]
movzx ecx, ax
jmp 0x140022225
mov ecx, dword [rsp + 0x50]
call fcn.140001958
mov esi, eax
mov ecx, eax
call qword [sym.imp.KERNEL32.dll_SetThreadLocale]
call fcn.140056888
test eax, eax
je 0x140022246
movzx ecx, si
call qword [sym.imp.KERNEL32.dll_SetThreadUILanguage]
mov rcx, rdi
call fcn.140020f8c
test al, al
jne 0x140022259
mov dword [rdi + 0x240], r12d
lea rdx, [rsp + 0x60]
mov rcx, rdi
call fcn.140021fdc
test al, al
jne 0x14002228c
lea rcx, [rsp + 0x60]
call fcn.1400876d0
nop
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x140022108
call qword [sym.imp.COMCTL32.dll_InitCommonControls]
call fcn.14008c6ac
call fcn.1400126b4
mov rcx, rdi
call fcn.140088190
call fcn.14008c510
test eax, eax
jne 0x1400222c9
or r8d, 0xffffffff
xor edx, edx
lea ecx, [rax + 0x64]
call fcn.14006bef4
nop
lea rcx, [rsp + 0x60]
call fcn.1400876d0
nop
jmp 0x140022275
call fcn.14006efb0
mov rcx, qword [rax + 0x80]
mov qword [rcx + 0x48], r12
xor ecx, ecx
call fcn.14008bc20
lea rdx, [0x14022eb48]
mov rcx, rdi
call fcn.140089b94
mov edx, 7
mov rcx, rdi
call fcn.140086794
mov ecx, pe_nt_image_headers64
call fcn.14005ce38
mov rsi, rax
mov qword [rbp - 0x40], rax
test rax, rax
je 0x140022345
lea rax, str.CSedonaPropPageView
mov qword [rsp + 0x20], rax
lea r9, str.CMainFrame
lea r8, str.CSedonaDoc
mov edx, 0x80
mov rcx, rsi
call fcn.1400886c0
lea r11, vtable.CSedonaSingleDocTemplate.0
mov qword [rsi], r11
jmp 0x140022348
mov rsi, r12
mov rdx, rsi
mov rcx, rdi
call fcn.14008a88c
mov r8d, r13d
mov edx, 4
lea rsi, [0x140301150]
mov rcx, rsi
call fcn.14001ee9c
test eax, eax
jns 0x14002237e
lea rcx, [rsp + 0x60]
call fcn.1400876d0
nop
jmp 0x140022275
cmp dword [rsp + 0x6c], r12d
jne 0x140022508
cmp dword [rsp + 0x70], r12d
jne 0x140022508
mov eax, dword [rsp + 0x78]
cmp eax, 7
jne 0x140022404
lea rax, str.APPID
mov qword [rbp - 0x40], rax
lea rax, str.F8F43C49_895D_4163_8784_03A735FCD286
mov qword [rbp - 0x38], rax
mov qword [rbp - 0x30], r12
mov qword [rbp - 0x28], r12
lea r9, [rbp - 0x40]
xor r8d, r8d
lea edx, [r8 + 0x67]
mov rcx, qword [0x1402f5078]
call fcn.14000d2f8
mov r11, qword [0x1402f5970]
test r11, r11
je 0x1400223e5
call r11
test eax, eax
js 0x1400223f4
xor r8d, r8d
mov edx, r13d
mov rcx, rsi
call fcn.140020660
nop
lea rcx, [rsp + 0x60]
call fcn.1400876d0
nop
jmp 0x140022275
cmp eax, 6
jne 0x140022477
lea rax, str.APPID
mov qword [rbp - 0x40], rax
lea rax, str.F8F43C49_895D_4163_8784_03A735FCD286
mov qword [rbp - 0x38], rax
mov qword [rbp - 0x30], r12
mov qword [rbp - 0x28], r12
lea r9, [rbp - 0x40]
mov r8d, r13d
mov edx, 0x67
mov rcx, qword [0x1402f5078]
call fcn.14000d2f8
xor r8d, r8d
mov edx, r13d
mov rcx, rsi
call fcn.1400205a0
test eax, eax
js 0x140022467
mov rax, qword [0x1402f5968]
test rax, rax
je 0x140022467
mov rcx, qword [0x1403010f8]
call rax
nop
lea rcx, [rsp + 0x60]
call fcn.1400876d0
nop
jmp 0x140022275
mov rcx, rdi
cmp eax, r13d
jne 0x1400224a4
mov rax, qword [rdi]
xor r8d, r8d
mov rdx, qword [rbp - 0x80]
call qword [rax + 0x140]
test rax, rax
jne 0x1400224c2
lea rcx, [rsp + 0x60]
call fcn.1400876d0
nop
jmp 0x140022275
lea rdx, [rsp + 0x60]
call fcn.14008a67c
test eax, eax
jne 0x1400224c2
lea rcx, [rsp + 0x60]
call fcn.1400876d0
nop
jmp 0x140022275
mov rcx, rdi
call fcn.14001fc90
mov rcx, qword [rdi + 0x40]
mov rax, qword [rcx]
call qword [rax + 0x2d0]
mov r8, qword [rax]
lea rdx, [rbp - 0x40]
mov rcx, rax
call qword [r8 + 0x238]
mov rdx, rax
movzx r9d, r12w
xor r8d, r8d
mov rcx, rdi
call fcn.140020958
nop
lea rcx, [rsp + 0x60]
call fcn.1400876d0
nop
jmp 0x140022513
lea rcx, [rsp + 0x60]
call fcn.1400876d0
nop
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, r13d
mov rcx, qword [rbp + 0x1f0]
xor rcx, rsp
call fcn.1401c0410
lea r11, [rsp + 0x300]
mov rbx, qword [r11 + 0x28]
mov rsi, qword [r11 + 0x30]
mov rdi, qword [r11 + 0x38]
mov rsp, r11
pop r13
pop r12
pop rbp
ret