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

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rsi
mov qword [rsp + 0x20], rdi
push rbp
push r14
push r15
lea rbp, [rsp - 0x9b0]
sub rsp, 0xab0
mov rax, qword [0x140011010]
xor rax, rsp
mov qword [rbp + 0x9a0], rax
mov r14, rcx
xor r15d, r15d
lea rdx, str.GetPackageWorkPath_1
lea rcx, vtable.CBGSimpleLogger.0
call fcn.140001900
mov rax, r14
cmp qword [r14 + 0x18], 8
jb 0x14000433a
mov rax, qword [r14]
mov qword [r14 + 0x10], r15
mov word [rax], r15w
xorps xmm0, xmm0
movups xmmword [rsp + 0x28], xmm0
mov qword [rsp + 0x38], r15
mov qword [rsp + 0x40], r15
xor r8d, r8d
lea rdx, [0x14000b6e0]
lea rcx, [rsp + 0x28]
call fcn.140007b10
nop
mov qword [rsp + 0x20], r15
lea r9, [rsp + 0x20]
xor r8d, r8d
xor edx, edx
lea rcx, [0x14000b560]
call qword [sym.imp.SHELL32.dll_SHGetKnownFolderPath]
mov rsi, 0xffffffffffffffff
test eax, eax
jne 0x14000441e
xor edx, edx
mov r8d, 0x800
lea rcx, [rbp + 0x1a0]
call sub.VCRUNTIME140.dll_memset
mov r9, qword [rsp + 0x20]
lea r8, str._sLenovoVantageAddinsLenovoBatteryGaugeAddin
mov edx, 0x3ff
lea rcx, [rbp + 0x1a0]
call fcn.140008120
lea rax, [rbp + 0x1a0]
mov rdx, rsi
nop
inc rdx
cmp word [rax + rdx*2], 0
jne 0x1400043d0
mov rax, qword [rsp + 0x40]
cmp rdx, rax
ja 0x140004415
lea rdi, [rsp + 0x28]
cmp rax, 8
cmovae rdi, qword [rsp + 0x28]
mov qword [rsp + 0x38], rdx
lea rbx, [rdx + rdx]
mov r8, rbx
lea rdx, [rbp + 0x1a0]
mov rcx, rdi
call sub.VCRUNTIME140.dll_memmove
mov word [rdi + rbx], r15w
jmp 0x140004473
lea r9, [rbp + 0x1a0]
jmp 0x140004469
mov rax, qword [rsp + 0x40]
cmp rax, 0x3c
jb 0x14000445d
lea rbx, [rsp + 0x28]
cmp rax, 8
cmovae rbx, qword [rsp + 0x28]
mov qword [rsp + 0x38], 0x3c
mov r8d, 0x78
lea rdx, str.C:ProgramDataLenovoVantageAddinsLenovoBatteryGaugeAddin
mov rcx, rbx
call sub.VCRUNTIME140.dll_memmove
mov word [rbx + 0x78], r15w
jmp 0x140004473
lea r9, str.C:ProgramDataLenovoVantageAddinsLenovoBatteryGaugeAddin
mov edx, 0x3c
lea rcx, [rsp + 0x28]
call fcn.140007c50
mov rcx, qword [rsp + 0x20]
call qword [sym.imp.ole32.dll_CoTaskMemFree]
xorps xmm0, xmm0
movups xmmword [rsp + 0x48], xmm0
mov qword [rsp + 0x58], r15
mov qword [rsp + 0x60], r15
xor r8d, r8d
lea rdx, [0x14000b6e0]
lea rcx, [rsp + 0x48]
call fcn.140007b10
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 0x140004523
lea rax, [rbp - 0x70]
mov rdx, rsi
inc rdx
cmp word [rax + rdx*2], 0
jne 0x1400044d3
mov rax, qword [rsp + 0x60]
cmp rdx, rax
ja 0x140004515
lea rdi, [rsp + 0x48]
cmp rax, 8
cmovae rdi, qword [rsp + 0x48]
mov qword [rsp + 0x58], rdx
lea rbx, [rdx + rdx]
mov r8, rbx
lea rdx, [rbp - 0x70]
mov rcx, rdi
call sub.VCRUNTIME140.dll_memmove
mov word [rdi + rbx], r15w
jmp 0x140004523
lea r9, [rbp - 0x70]
lea rcx, [rsp + 0x48]
call fcn.140007c50
lea rcx, [rsp + 0x28]
cmp qword [rsp + 0x40], 8
cmovae rcx, qword [rsp + 0x28]
xor edx, edx
call qword [sym.imp.api_ms_win_crt_filesystem_l1_1_0.dll__waccess_s]
test eax, eax
jne 0x1400046f0
mov rax, qword [rsp + 0x38]
cmp dword [rsp + 0x58], eax
jle 0x1400046f0
xorps xmm0, xmm0
movups xmmword [rsp + 0x68], xmm0
xorps xmm1, xmm1
movdqu xmmword [rsp + 0x78], xmm1
movsxd r8, eax
cmp qword [rsp + 0x58], r8
cmovb r8, qword [rsp + 0x58]
lea rdx, [rsp + 0x48]
cmp qword [rsp + 0x60], 8
cmovae rdx, qword [rsp + 0x48]
lea rcx, [rsp + 0x68]
call fcn.140007b10
nop
lea rdx, [rsp + 0x68]
cmp qword [rbp - 0x80], 8
cmovae rdx, qword [rsp + 0x68]
lea rcx, [rsp + 0x28]
cmp qword [rsp + 0x40], 8
cmovae rcx, qword [rsp + 0x28]
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__wcsicmp]
test eax, eax
jne 0x1400046ac
lea edx, [rax + 0x5c]
lea rcx, [rbp - 0x70]
call qword [sym.imp.VCRUNTIME140.dll_wcsrchr]
test rax, rax
je 0x140004630
lea rcx, [rbp + 0x198]
cmp rax, rcx
je 0x140004630
mov word [rax + 2], r15w
lea rax, [rbp - 0x70]
inc rsi
cmp word [rax + rsi*2], 0
jne 0x1400045e4
mov rax, qword [r14 + 0x18]
cmp rsi, rax
ja 0x140004621
mov rdi, r14
cmp rax, 8
jb 0x140004603
mov rdi, qword [r14]
mov qword [r14 + 0x10], rsi
lea rbx, [rsi + rsi]
mov r8, rbx
lea rdx, [rbp - 0x70]
mov rcx, rdi
call sub.VCRUNTIME140.dll_memmove
mov word [rdi + rbx], r15w
jmp 0x140004630
lea r9, [rbp - 0x70]
mov rdx, rsi
mov rcx, r14
call fcn.140007c50
mov r8, r14
cmp qword [r14 + 0x18], 8
jb 0x14000463d
mov r8, qword [r14]
lea rdx, str.GetPackageWorkPath_2_OK___strWorkPath_s
lea rcx, vtable.CBGSimpleLogger.0
call fcn.140001900
cmp qword [r14 + 0x18], 8
jb 0x14000465a
mov r14, qword [r14]
mov rcx, r14
call qword [sym.imp.SHLWAPI.dll_PathFileExistsW]
cmp eax, 1
sete bl
mov rdx, qword [rbp - 0x80]
cmp rdx, 8
jb 0x140004705
lea rdx, [rdx*2 + 2]
mov rcx, qword [rsp + 0x68]
mov rax, rcx
cmp rdx, 0x1000
jb 0x1400046a5
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x1400046e4
call fcn.140008cb0
jmp 0x140004705
mov rdx, qword [rbp - 0x80]
cmp rdx, 8
jb 0x1400046f0
lea rdx, [rdx*2 + 2]
mov rcx, qword [rsp + 0x68]
mov rax, rcx
cmp rdx, 0x1000
jb 0x1400046eb
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x1400046eb
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.140008cb0
lea rdx, str.GetPackageWorkPath_3_failed....
lea rcx, vtable.CBGSimpleLogger.0
call fcn.140001900
xor bl, bl
mov rdx, qword [rsp + 0x60]
cmp rdx, 8
jb 0x14000474a
lea rdx, [rdx*2 + 2]
mov rcx, qword [rsp + 0x48]
mov rax, rcx
cmp rdx, 0x1000
jb 0x140004745
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x140004745
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.140008cb0
mov qword [rsp + 0x58], r15
mov qword [rsp + 0x60], 7
mov word [rsp + 0x48], r15w
mov rdx, qword [rsp + 0x40]
cmp rdx, 8
jb 0x1400047a3
lea rdx, [rdx*2 + 2]
mov rcx, qword [rsp + 0x28]
mov rax, rcx
cmp rdx, 0x1000
jb 0x14000479e
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x14000479e
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.140008cb0
movzx eax, bl
mov rcx, qword [rbp + 0x9a0]
xor rcx, rsp
call fcn.140008c90
lea r11, [rsp + 0xab0]
mov rbx, qword [r11 + 0x28]
mov rsi, qword [r11 + 0x30]
mov rdi, qword [r11 + 0x38]
mov rsp, r11
pop r15
pop r14
pop rbp
ret