Function at 0x1400397a4
Capabilities:
Check if file exists
Get common file path
Get file attributes
Query or enumerate registry value
Set registry value

Disassembly:
mov qword [rsp + 0x18], rbx
push rbp
push rsi
push rdi
push r14
push r15
lea rbp, [rsp - 0x190]
sub rsp, 0x290
mov rax, qword [0x1400592a0]
xor rax, rsp
mov qword [rbp + 0x180], rax
xor ebx, ebx
mov r14, rdx
mov rsi, rcx
test rcx, rcx
je 0x140039a57
test rdx, rdx
je 0x140039a57
mov word [rcx], bx
lea edx, [rbx + 0x5c]
mov rcx, r14
call qword [sym.imp.api_ms_win_crt_private_l1_1_0.dll_wcsrchr]
nop dword [rax + rax]
mov rdi, rax
test rax, rax
jne 0x14003980c
mov rdi, r14
jmp 0x140039810
add rdi, 2
mov r15d, 0x104
lea rcx, [rsp + 0x70]
mov edx, r15d
call qword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
nop dword [rax + rax]
test eax, eax
jne 0x140039858
call qword [sym.imp.KERNEL32.dll_GetLastError]
nop dword [rax + rax]
test eax, eax
jne 0x140039845
mov eax, 0x57
jmp 0x14003984b
jle 0x140039a5c
movzx eax, ax
or eax, 0x80070000
jmp 0x140039a5c
lea r8, str.CatRootF750E6C3_38EE_11D1_85E5_00C04FC295EE_
mov rdx, r15
lea rcx, [rsp + 0x70]
call fcn.140010d0c
mov r8, rdi
lea rcx, [rsp + 0x70]
mov rdx, r15
call fcn.140010d0c
lea rcx, [rsp + 0x70]
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
nop dword [rax + rax]
mov r15d, 4
cmp eax, 0xffffffff
je 0x1400399fd
test al, 0x10
jne 0x1400399fd
mov r8, r14
mov qword [rsp + 0x58], rbx
lea rdx, str.____Another_version_of_catalog_file__S_was_previously_installed._r_n
mov dword [rsp + 0x50], 1
mov ecx, r15d
mov dword [rsp + 0x54], r15d
mov dword [rsp + 0x60], r15d
call fcn.140019b1c
mov qword [rsp + 0x40], rbx
lea rax, [rsp + 0x58]
mov qword [rsp + 0x38], rax
lea rdx, str.SoftwareMicrosoftMediaPlayerSetupCatalogIteration
mov qword [rsp + 0x30], rbx
xor r9d, r9d
mov dword [rsp + 0x28], 3
xor r8d, r8d
mov rcx, 0xffffffff80000000
mov dword [rsp + 0x20], ebx
call qword [sym.imp.ADVAPI32.dll_RegCreateKeyExW]
nop dword [rax + rax]
test eax, eax
jne 0x140039998
mov rcx, qword [rsp + 0x58]
lea rax, [rsp + 0x60]
mov qword [rsp + 0x28], rax
lea r9, [rsp + 0x54]
lea rax, [rsp + 0x50]
xor r8d, r8d
mov rdx, rdi
mov qword [rsp + 0x20], rax
call qword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
nop dword [rax + rax]
test eax, eax
jne 0x14003995e
cmp dword [rsp + 0x54], r15d
jne 0x14003995e
cmp dword [rsp + 0x50], 1
mov eax, ebx
setne al
mov dword [rsp + 0x50], eax
mov rcx, qword [rsp + 0x58]
lea rax, [rsp + 0x50]
mov dword [rsp + 0x28], r15d
mov r9d, r15d
xor r8d, r8d
mov qword [rsp + 0x20], rax
mov rdx, rdi
call qword [sym.imp.ADVAPI32.dll_RegSetValueExW]
nop dword [rax + rax]
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
nop dword [rax + rax]
cmp dword [rsp + 0x50], ebx
je 0x1400399fd
test rdi, rdi
je 0x140039a3c
mov ecx, 0x103
lea r9, [0x140050ed0]
mov r8d, ecx
sub r9, rsi
mov rdx, rsi
lea rax, [r8 + 0x7ffffefb]
test rax, rax
je 0x1400399df
movzx eax, word [r9 + rdx]
test ax, ax
je 0x1400399df
mov word [rdx], ax
add rdx, 2
sub r8, 1
jne 0x1400399bc
test r8, r8
lea rax, [rdx - 2]
mov r8, rdi
cmovne rax, rdx
mov rdx, rcx
mov rcx, rsi
mov word [rax], bx
call fcn.140010d0c
jmp 0x140039a41
test rdi, rdi
je 0x140039a3c
mov ecx, 0x103
sub rdi, rsi
lea rax, [rcx + 0x7ffffefb]
test rax, rax
je 0x140039a2c
movzx eax, word [rdi + rsi]
test ax, ax
je 0x140039a2c
mov word [rsi], ax
add rsi, 2
sub rcx, 1
jne 0x140039a0a
test rcx, rcx
lea rax, [rsi - 2]
cmovne rax, rsi
mov word [rax], bx
jmp 0x140039a41
mov ebx, 0x80004005
mov r8d, ebx
lea rdx, str.GetNameForCatalogOnSystem_returned_0x_x._r_n
mov ecx, r15d
call fcn.140019b1c
mov eax, ebx
jmp 0x140039a5c
mov eax, 0x8007000e
mov rcx, qword [rbp + 0x180]
xor rcx, rsp
call fcn.1400017f0
mov rbx, qword [rsp + 0x2d0]
add rsp, 0x290
pop r15
pop r14
pop rdi
pop rsi
pop rbp
ret