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

Disassembly:
mov rax, rsp
push rbp
lea rbp, [rax - 0x9b8]
sub rsp, 0xab0
mov qword [rsp + 0x20], 0xfffffffffffffffe
mov qword [rax + 0x10], rbx
mov qword [rax + 0x18], rsi
mov qword [rax + 0x20], rdi
mov rax, qword [0x140010008]
xor rax, rsp
mov qword [rbp + 0x9a0], rax
mov rdi, rcx
lea rdx, str.GetPackageWorkPath_1
lea rcx, [0x140010748]
call fcn.1400018a0
xor r8d, r8d
lea rdx, [0x140009668]
mov rcx, rdi
call fcn.140005860
mov qword [rsp + 0x48], 7
xor esi, esi
mov qword [rsp + 0x40], rsi
mov word [rsp + 0x30], si
xor r8d, r8d
lea rdx, [0x140009668]
lea rcx, [rsp + 0x30]
call fcn.140005860
nop
mov qword [rsp + 0x28], rsi
lea r9, [rsp + 0x28]
xor r8d, r8d
xor edx, edx
lea rcx, [0x140009530]
call qword [sym.imp.SHELL32.dll_SHGetKnownFolderPath]
or rbx, 0xffffffffffffffff
test eax, eax
jne 0x140003534
xor edx, edx
mov r8d, 0x800
lea rcx, [rbp + 0x1a0]
call sub.VCRUNTIME140.dll_memset
mov r9, qword [rsp + 0x28]
lea r8, str._sLenovoVantageAddinsLenovoBatteryGaugeAddin
mov edx, 0x3ff
lea rcx, [rbp + 0x1a0]
call fcn.140006430
cmp word [rbp + 0x1a0], si
jne 0x14000350d
mov r8d, esi
jmp 0x14000352b
lea rax, [rbp + 0x1a0]
mov r8, rbx
nop word [rax + rax]
inc r8
cmp word [rax + r8*2], 0
jne 0x140003520
lea rdx, [rbp + 0x1a0]
jmp 0x140003541
mov r8d, 0x3c
lea rdx, str.C:ProgramDataLenovoVantageAddinsLenovoBatteryGaugeAddin
lea rcx, [rsp + 0x30]
call fcn.140005860
mov rcx, qword [rsp + 0x28]
call qword [sym.imp.ole32.dll_CoTaskMemFree]
mov qword [rsp + 0x68], 7
mov qword [rsp + 0x60], rsi
mov word [rsp + 0x50], si
xor r8d, r8d
lea rdx, [0x140009668]
lea rcx, [rsp + 0x50]
call fcn.140005860
nop
xor edx, edx
mov r8d, 0x208
lea rcx, [rbp - 0x70]
call sub.VCRUNTIME140.dll_memset
mov r8d, 0x104
lea rdx, [rbp - 0x70]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
je 0x1400035d9
cmp word [rbp - 0x70], 0
jne 0x1400035b1
mov r8, rsi
jmp 0x1400035cb
lea rax, [rbp - 0x70]
mov r8, rbx
nop dword [rax + rax]
inc r8
cmp word [rax + r8*2], 0
jne 0x1400035c0
lea rdx, [rbp - 0x70]
lea rcx, [rsp + 0x50]
call fcn.140005860
lea rcx, [rsp + 0x30]
cmp qword [rsp + 0x48], 8
cmovae rcx, qword [rsp + 0x30]
xor edx, edx
call qword [sym.imp.api_ms_win_crt_filesystem_l1_1_0.dll__waccess_s]
test eax, eax
jne 0x1400036ea
movsxd rax, dword [rsp + 0x40]
cmp dword [rsp + 0x60], eax
jle 0x1400036ea
mov r9, rax
lea rdx, [rsp + 0x70]
lea rcx, [rsp + 0x50]
call fcn.1400055c0
nop
lea rdx, [rsp + 0x70]
cmp qword [rbp - 0x78], 8
cmovae rdx, qword [rsp + 0x70]
lea rcx, [rsp + 0x30]
cmp qword [rsp + 0x48], 8
cmovae rcx, qword [rsp + 0x30]
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__wcsicmp]
test eax, eax
jne 0x1400036e0
lea edx, [rax + 0x5c]
lea rcx, [rbp - 0x70]
call qword [sym.imp.VCRUNTIME140.dll_wcsrchr]
test rax, rax
je 0x140003699
lea rcx, [rbp + 0x198]
cmp rax, rcx
je 0x140003699
mov word [rax + 2], si
cmp word [rbp - 0x70], 0
jne 0x140003679
mov rbx, rsi
jmp 0x14000368a
lea rax, [rbp - 0x70]
nop dword [rax]
inc rbx
cmp word [rax + rbx*2], 0
jne 0x140003680
mov r8, rbx
lea rdx, [rbp - 0x70]
mov rcx, rdi
call fcn.140005860
cmp qword [rdi + 0x18], 8
jb 0x1400036a5
mov r8, qword [rdi]
jmp 0x1400036a8
mov r8, rdi
lea rdx, str.GetPackageWorkPath_2_OK___strWorkPath_s
lea rcx, [0x140010748]
call fcn.1400018a0
cmp qword [rdi + 0x18], 8
jb 0x1400036c5
mov rdi, qword [rdi]
mov rcx, rdi
call qword [sym.imp.SHLWAPI.dll_PathFileExistsW]
cmp eax, 1
sete bl
lea rcx, [rsp + 0x70]
call fcn.140005600
jmp 0x1400036ff
lea rcx, [rsp + 0x70]
call fcn.140005600
lea rdx, str.GetPackageWorkPath_3_failed....
lea rcx, [0x140010748]
call fcn.1400018a0
xor bl, bl
movabs rdi, 0x7fffffffffffffff
mov rax, qword [rsp + 0x68]
cmp rax, 8
jb 0x140003776
inc rax
mov rcx, qword [rsp + 0x50]
cmp rax, rdi
jbe 0x140003728
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
add rax, rax
cmp rax, 0x1000
jb 0x140003771
test byte [rsp + 0x50], 0x1f
je 0x140003741
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
mov rax, qword [rcx - 8]
cmp rax, rcx
jb 0x140003751
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
sub rcx, rax
cmp rcx, 8
jae 0x140003761
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
cmp rcx, 0x27
jbe 0x14000376e
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
mov rcx, rax
call fcn.1400073b0
mov qword [rsp + 0x68], 7
mov qword [rsp + 0x60], rsi
mov word [rsp + 0x50], si
mov rax, qword [rsp + 0x48]
cmp rax, 8
jb 0x1400037f6
inc rax
mov rcx, qword [rsp + 0x30]
cmp rax, rdi
jbe 0x1400037a8
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
add rax, rax
cmp rax, 0x1000
jb 0x1400037f1
test byte [rsp + 0x30], 0x1f
je 0x1400037c1
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
mov rax, qword [rcx - 8]
cmp rax, rcx
jb 0x1400037d1
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
sub rcx, rax
cmp rcx, 8
jae 0x1400037e1
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
cmp rcx, 0x27
jbe 0x1400037ee
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
mov rcx, rax
call fcn.1400073b0
movzx eax, bl
mov rcx, qword [rbp + 0x9a0]
xor rcx, rsp
call fcn.140007350
lea r11, [rsp + 0xab0]
mov rbx, qword [r11 + 0x18]
mov rsi, qword [r11 + 0x20]
mov rdi, qword [r11 + 0x28]
mov rsp, r11
pop rbp
ret