Function at 0x140130580
Capabilities:
Check if file exists
Get common file path
Get file attributes
Get program files directory
Get system information on windows

Disassembly:
push rdi
push r13
push r14
mov eax, 0x100c0
call fcn.140181870
sub rsp, rax
mov qword [rsp + 0x68], 0xfffffffffffffffe
mov qword [rsp + 0x100e8], rbx
mov qword [rsp + 0x100f0], rbp
mov qword [rsp + 0x100f8], rsi
mov rax, qword [0x140210348]
xor rax, rsp
mov qword [rsp + 0x100b0], rax
mov rbx, rcx
mov rcx, qword [rcx + 8]
test rcx, rcx
je 0x1401305dd
mov rax, qword [rcx]
call qword [rax + 0x28]
jmp 0x140130bea
mov rax, qword [rbx + 0x10]
test rax, rax
je 0x140130bea
xor esi, esi
cmp dword [rax + 0x56c], esi
jbe 0x140130649
xor edi, edi
nop
nop
nop
lea rcx, [rax + 0x558]
mov edx, esi
call fcn.1400ba090
test eax, eax
je 0x140130633
mov rcx, qword [rbx + 0x10]
movzx eax, word [rdi + rcx + 0x620]
bt ax, 9
jb 0x140130633
test al, 8
je 0x140130633
test byte [rdi + rcx + 0x618], 1
je 0x140130651
add esi, 1
add rdi, 0xac
mov rax, qword [rbx + 0x10]
cmp esi, dword [rax + 0x56c]
jb 0x140130600
mov rax, qword [rbx + 0x10]
or dword [rax + 0x2c], 0x40
mov rax, qword [rbx + 0x10]
bt dword [rax + 0xa8], 0x11
jae 0x140130667
mov rcx, rbx
call fcn.140131190
mov rax, qword [rbx + 0x10]
test byte [rax + 0x2f], 1
je 0x140130679
mov rcx, rbx
call fcn.1401322b0
xor esi, esi
mov rax, qword [rbx + 0x10]
mov rdx, qword [rax + 0x1bd8]
lea r13, [0x14019cf88]
or rbp, 0xffffffffffffffff
lea r14d, [rsi + 1]
test rdx, rdx
je 0x14013085e
nop
mov rcx, rdx
test rdx, rdx
je 0x140130858
mov rdx, qword [rdx]
mov rcx, qword [rcx + 0x10]
test rcx, rcx
je 0x140130727
mov eax, dword [rcx + 0x1d8]
cmp eax, 8
je 0x1401306c8
cmp eax, 9
jne 0x140130714
cmp dword [rcx + 0x168], 0
je 0x140130714
mov eax, dword [rcx + 0x314]
bt eax, 0xc
jb 0x1401306fe
mov edi, dword [rcx + 0x318]
bt edi, 0x1d
jb 0x1401306fe
test byte [rcx + 0x31c], r14b
je 0x1401306f8
bt eax, 0xb
jb 0x1401306fe
test dil, 0x40
je 0x140130714
test r14b, al
jne 0x140130709
bt eax, 0xa
jae 0x140130714
mov rax, qword [rbx + 0x10]
or dword [rax + 0x2c], 0x20000
mov eax, dword [rcx + 0x318]
test r14b, al
je 0x140130727
bt eax, 0x14
cmovb esi, r14d
test rdx, rdx
jne 0x1401306a0
test esi, esi
je 0x14013085e
lea rax, [rsp + 0x50]
mov qword [rsp + 0x40], rax
lea rax, [rsp + 0x48]
mov qword [rsp + 0x58], rax
call fcn.14013d07c
mov rdx, rax
xor ecx, ecx
test rax, rax
setne cl
test ecx, ecx
jne 0x14013076b
mov ecx, 0x80004005
call fcn.140001c00
int3
mov rax, qword [rax]
mov rcx, rdx
call qword [rax + 0x18]
add rax, 0x18
mov qword [rsp + 0x50], rax
test r13, 0xffffffffffff0000
jne 0x1401307a8
movzx edi, r13w
mov ecx, edi
call fcn.14013d654
test rax, rax
je 0x1401307c8
mov r8d, edi
mov rdx, rax
lea rcx, [rsp + 0x50]
call fcn.1400020e0
jmp 0x1401307c8
xor eax, eax
mov rcx, rbp
mov rdi, r13
repne scasw ax, word [rdi]
not rcx
lea r8d, [rcx - 1]
mov rdx, r13
lea rcx, [rsp + 0x50]
call fcn.140002390
nop
call fcn.14013d07c
mov rdx, rax
xor ecx, ecx
test rax, rax
setne cl
test ecx, ecx
jne 0x1401307e7
mov ecx, 0x80004005
call fcn.140001c00
int3
mov rax, qword [rax]
mov rcx, rdx
call qword [rax + 0x18]
add rax, 0x18
mov qword [rsp + 0x48], rax
lea rdx, str.RAVBg64.exe
test rdx, 0xffffffffffff0000
jne 0x14013082a
movzx edi, dx
mov ecx, edi
call fcn.14013d654
test rax, rax
je 0x140130847
mov r8d, edi
mov rdx, rax
lea rcx, [rsp + 0x48]
call fcn.1400020e0
jmp 0x140130847
xor eax, eax
mov rcx, rbp
mov rdi, rdx
repne scasw ax, word [rdi]
not rcx
lea r8d, [rcx - 1]
lea rcx, [rsp + 0x48]
call fcn.140002390
nop
lea rdx, [rsp + 0x50]
lea rcx, [rsp + 0x48]
call fcn.140074e80
jmp 0x14013085e
call fcn.14013d908
int3
mov rax, qword [rbx]
mov rcx, rbx
call qword [rax + 0x88]
mov rdi, qword [rbx + 0x10]
bt dword [rdi + 0xd0], 0x1a
jae 0x1401308c5
add rdi, 0x558
je 0x1401308c5
movsxd rdx, dword [rdi + 0x28]
cmp edx, 0xffffffff
je 0x1401308a3
lea rax, [rdx + 2]
imul rax, rax, 0xac
cmp dword [rax + rdi], 0
je 0x1401308a3
mov rcx, rdi
call fcn.1400ba630
movsxd rdx, dword [rdi + 0x30]
cmp edx, 0xffffffff
je 0x1401308c5
lea rax, [rdx + 2]
imul rax, rax, 0xac
cmp dword [rax + rdi], 0
je 0x1401308c5
mov rcx, rdi
call fcn.1400ba630
xor edx, edx
xor ecx, ecx
call fcn.14007c320
xor edx, edx
mov ecx, r14d
call fcn.14007c320
mov dword [rsp + 0x80], 0
xor edx, edx
lea r8d, [rdx + 0x2c]
lea rcx, [rsp + 0x84]
call fcn.140160e90
lea rcx, [rsp + 0x80]
call qword [sym.imp.KERNEL32.dll_GetSystemInfo]
mov edx, 0x7fff
lea rcx, [rsp + 0xb0]
call qword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
test eax, eax
je 0x140130b4e
xor eax, eax
mov rcx, rbp
lea rdi, [rsp + 0xb0]
repne scasw ax, word [rdi]
not rcx
cmp word [rsp + rcx*2 + 0xac], 0x5c
jne 0x140130945
mov word [rsp + rcx*2 + 0xac], ax
cmp word [rsp + 0x80], 9
jne 0x14013096b
lea r8, str.RTKVAA64.EXE
mov edx, 0x7fff
lea rcx, [rsp + 0xb0]
call fcn.14015e670
jmp 0x140130984
lea r8, str.RTKVADDA.EXE
mov edx, 0x7fff
lea rcx, [rsp + 0xb0]
call fcn.14015e670
lea rax, [rsp + 0x40]
mov qword [rsp + 0x58], rax
call fcn.14013d07c
mov rdx, rax
xor ecx, ecx
test rax, rax
setne cl
test ecx, ecx
jne 0x1401309ad
mov ecx, 0x80004005
call fcn.140001c00
int3
mov rax, qword [rax]
mov rcx, rdx
call qword [rax + 0x18]
add rax, 0x18
mov qword [rsp + 0x40], rax
lea rcx, [rsp + 0xb0]
lea rax, [rsp + 0xb0]
test rax, 0xffffffffffff0000
jne 0x1401309f8
movzx edi, cx
mov ecx, edi
call fcn.14013d654
test rax, rax
je 0x140130a22
mov r8d, edi
mov rdx, rax
lea rcx, [rsp + 0x40]
call fcn.1400020e0
jmp 0x140130a22
xor eax, eax
mov rcx, rbp
lea rdi, [rsp + 0xb0]
repne scasw ax, word [rdi]
not rcx
lea r8d, [rcx - 1]
lea rdx, [rsp + 0xb0]
lea rcx, [rsp + 0x40]
call fcn.140002390
nop
mov rdi, r13
mov rax, qword [rsp + 0x40]
mov rsi, rax
mov rcx, r14
repe cmpsw word [rsi], word [rdi]
jne 0x140130a50
lea rdx, [rax - 0x18]
lock xadd dword [rdx + 0x10], ebp
add ebp, 0xffffffff
test ebp, ebp
jg 0x140130a80
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
jmp 0x140130a80
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x140130b12
mov rdx, qword [rsp + 0x40]
add rdx, 0xffffffffffffffe8
lock xadd dword [rdx + 0x10], ebp
add ebp, 0xffffffff
test ebp, ebp
jg 0x140130a80
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
xor edx, edx
mov r8d, 0xfffe
lea rcx, [rsp + 0xb0]
call fcn.140160e90
lea rdx, [rsp + 0xb0]
mov qword [rsp + 0x20], rdx
xor r9d, r9d
xor r8d, r8d
lea edx, [r9 + 0x26]
xor ecx, ecx
call qword [sym.imp.SHELL32.dll_SHGetFolderPathW]
test eax, eax
js 0x140130b30
lea r8, str.RealtekAudioAP
mov edx, 0x7fff
lea rcx, [rsp + 0xb0]
call fcn.14015e670
cmp word [rsp + 0x80], 9
jne 0x140130af7
lea r8, str.RTKVAA64.EXE
mov edx, 0x7fff
lea rcx, [rsp + 0xb0]
call fcn.14015e670
jmp 0x140130b30
lea r8, str.RTKVADDA.EXE
mov edx, 0x7fff
lea rcx, [rsp + 0xb0]
call fcn.14015e670
jmp 0x140130b30
mov rdx, qword [rsp + 0x40]
add rdx, 0xffffffffffffffe8
lock xadd dword [rdx + 0x10], ebp
add ebp, 0xffffffff
test ebp, ebp
jg 0x140130b30
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
lea rcx, [rsp + 0xb0]
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x140130b4e
mov rax, qword [rbx + 0x10]
or dword [rax + 0x2c], 0x20000000
mov rax, qword [rbx + 0x10]
bt dword [rax + 0xdc], 0xa
jae 0x140130bd7
mov dword [rsp + 0x58], 0
mov dword [rsp + 0x60], 0
mov rcx, qword [0x14021cc50]
test ecx, ecx
jle 0x140130bd7
lea rdx, [rsp + 0x70]
mov rax, qword [0x1401ac380]
mov qword [rdx], rax
mov rax, qword [0x1401ac388]
mov qword [rdx + 8], rax
test rcx, rcx
jle 0x140130bd1
lea rax, [rsp + 0x60]
mov qword [rsp + 0x30], rax
mov dword [rsp + 0x28], 4
lea rax, [rsp + 0x58]
mov qword [rsp + 0x20], rax
mov r9d, r14d
mov r8d, 0x21
lea rdx, [rsp + 0x70]
mov rcx, qword [0x14021cc48]
mov rcx, qword [rcx]
call fcn.14008b3c0
jmp 0x140130bd7
call fcn.14013d908
int3
mov rax, qword [rbx + 0x10]
bt dword [rax + 0x30], 0xd
jae 0x140130bea
mov rcx, rbx
call fcn.140134ba0
mov rcx, qword [rsp + 0x100b0]
xor rcx, rsp
call fcn.14015d000
lea r11, [rsp + 0x100c0]
mov rbx, qword [r11 + 0x28]
mov rbp, qword [r11 + 0x30]
mov rsi, qword [r11 + 0x38]
mov rsp, r11
pop r14
pop r13
pop rdi
ret