Function at 0x140031580
Capabilities:
Check if file exists
Get common file path

Disassembly:
mov rax, rsp
push rbp
push rdi
push r12
lea rbp, [rax - 0x3a8]
sub rsp, 0x490
mov qword [rsp + 0x58], 0xfffffffffffffffe
mov qword [rax + 0x10], rbx
mov qword [rax + 0x18], rsi
mov rax, qword [0x14026fdb0]
xor rax, rsp
mov qword [rbp + 0x380], rax
mov rsi, rcx
xor r8d, r8d
lea rdx, str.Tool_RemoveReg_CAPTShareModule
lea rcx, [rsp + 0x48]
call fcn.140001190
nop
call fcn.140059f20
mov r12, qword [rax + 8]
xor edi, edi
mov qword [rsp + 0x40], rdi
mov word [rbp + 0x170], di
xor edx, edx
mov r8d, 0x206
lea rcx, [rbp + 0x172]
call fcn.14019d7c0
mov word [rsp + 0x60], di
xor edx, edx
mov r8d, 0x206
lea rcx, [rsp + 0x62]
call fcn.14019d7c0
call fcn.140056384
mov r11, rax
mov ecx, edi
test rax, rax
setne cl
test ecx, ecx
jne 0x140031630
mov ecx, 0x80004005
call fcn.140004550
int3
mov rax, qword [rax]
mov rcx, r11
call qword [rax + 0x18]
add rax, 0x18
mov qword [rsp + 0x30], rax
lea rdx, [0x1402209ac]
test rdx, 0xffffffffffff0000
jne 0x140031673
movzx ebx, dx
mov ecx, ebx
call fcn.140056158
test rax, rax
je 0x140031681
mov r8d, ebx
mov rdx, rax
lea rcx, [rsp + 0x30]
call fcn.140005730
jmp 0x140031681
xor r8d, r8d
lea rcx, [rsp + 0x30]
call fcn.1400059f0
nop
mov r8, qword [r12 + 0x808]
lea rdx, str._sSMD.DLL
lea rcx, [rsp + 0x30]
call fcn.14000bfe0
mov edx, 0x104
lea rcx, [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
lea rcx, [rsp + 0x60]
call qword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
mov rbx, qword [rsp + 0x30]
cmp dword [rbx - 8], 1
jle 0x1400316d2
mov edx, dword [rbx - 0x10]
lea rcx, [rsp + 0x30]
call fcn.140005c50
mov rbx, qword [rsp + 0x30]
mov r9, rbx
lea r8, [rsp + 0x60]
lea rdx, [0x14021c280]
lea rcx, [rbp + 0x170]
call qword [sym.imp.USER32.dll_wsprintfW]
lea rcx, [rbp + 0x170]
call qword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x14003174c
mov r9d, 1
lea r8, str.return___08x
lea edx, [r9 + 1]
lea rcx, [rsp + 0x48]
call fcn.140001370
nop
lea rdx, [rbx - 0x18]
or ebx, 0xffffffff
lock xadd dword [rdx + 0x10], ebx
dec ebx
test ebx, ebx
jg 0x140031738
mov rcx, qword [rdx]
mov r8, qword [rcx]
call qword [rreloc.OLEAUT32.dll_VariantClear + 8]
nop
lea rcx, [rsp + 0x48]
call fcn.140001320
mov eax, 1
jmp 0x140031850
call fcn.140056384
mov r11, rax
mov ecx, edi
test rax, rax
setne cl
test ecx, ecx
jne 0x14003176b
mov ecx, 0x80004005
call fcn.140004550
int3
mov rax, qword [rax]
mov rcx, r11
call qword [rax + 0x18]
add rax, 0x18
mov qword [rsp + 0x38], rax
mov r9, qword [r12 + 0x808]
lea r8, str.SOFTWARECANON_
lea rdx, [0x14021c280]
lea rcx, [rsp + 0x38]
call fcn.14000bfe0
lea r11, [rsp + 0x40]
mov qword [rsp + 0x20], r11
mov r9d, 0x2011f
xor r8d, r8d
mov rbx, qword [rsp + 0x38]
mov rdx, rbx
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x1400317df
mov rcx, qword [rsp + 0x40]
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov rdx, rbx
mov rcx, rsi
call fcn.140031240
mov edi, eax
jmp 0x1400317ee
cmp eax, 2
je 0x1400317e9
cmp eax, 3
jne 0x1400317ee
mov edi, 1
mov r9d, edi
lea r8, str.return___08x
mov edx, 2
lea rcx, [rsp + 0x48]
call fcn.140001370
nop
lea rdx, [rbx - 0x18]
or ebx, 0xffffffff
mov eax, ebx
lock xadd dword [rdx + 0x10], eax
dec eax
test eax, eax
jg 0x140031826
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
nop
mov rdx, qword [rsp + 0x30]
add rdx, 0xffffffffffffffe8
lock xadd dword [rdx + 0x10], ebx
dec ebx
test ebx, ebx
jg 0x140031844
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
nop
lea rcx, [rsp + 0x48]
call fcn.140001320
mov eax, edi
mov rcx, qword [rbp + 0x380]
xor rcx, rsp
call fcn.140198b40
lea r11, [rsp + 0x490]
mov rbx, qword [r11 + 0x28]
mov rsi, qword [r11 + 0x30]
mov rsp, r11
pop r12
pop rdi
pop rbp
ret