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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x407431
mov eax, dword fs:[0]
push eax
sub esp, 0xa58
mov eax, dword [0x40d00c]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
push str.GetPackageWorkPath_1
push 0x40d028
call fcn.004016f0
add esp, 8
mov ecx, esi
push 0
push 0x408380
call fcn.00404bf0
xor eax, eax
mov dword [ebp - 0xa1c], 7
push eax
push 0x408380
lea ecx, [ebp - 0xa30]
mov dword [ebp - 0xa20], 0
mov word [ebp - 0xa30], ax
call fcn.00404bf0
lea eax, [ebp - 0xa64]
mov dword [ebp - 4], 0
push eax
push 0
push 0
push 0x408290
mov dword [ebp - 0xa64], 0
call dword [sym.imp.SHELL32.dll_SHGetKnownFolderPath]
test eax, eax
jne 0x402de9
push 0x800
push eax
lea eax, [ebp - 0xa18]
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
lea eax, [ebp - 0xa18]
push dword [ebp - 0xa64]
push str._sLenovoVantageAddinsLenovoBatteryGaugeAddin
push 0x3ff
push eax
call fcn.00405800
add esp, 0x10
cmp word [ebp - 0xa18], 0
jne 0x402dc2
xor ecx, ecx
lea eax, [ebp - 0xa18]
push ecx
push eax
jmp 0x402df0
lea ecx, [ebp - 0xa18]
lea edx, [ecx + 2]
nop dword [eax + eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x402dd0
sub ecx, edx
lea eax, [ebp - 0xa18]
sar ecx, 1
push ecx
push eax
jmp 0x402df0
push 0x3c
push str.C:ProgramDataLenovoVantageAddinsLenovoBatteryGaugeAddin
lea ecx, [ebp - 0xa30]
call fcn.00404bf0
push dword [ebp - 0xa64]
call dword [sym.imp.ole32.dll_CoTaskMemFree]
xor eax, eax
mov dword [ebp - 0xa34], 7
push eax
push 0x408380
lea ecx, [ebp - 0xa48]
mov dword [ebp - 0xa38], 0
mov word [ebp - 0xa48], ax
call fcn.00404bf0
push 0x208
lea eax, [ebp - 0x218]
mov byte [ebp - 4], 1
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
lea eax, [ebp - 0x218]
push 0x104
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
je 0x402ea2
cmp word [ebp - 0x218], 0
jne 0x402e75
xor ecx, ecx
jmp 0x402e8f
lea ecx, [ebp - 0x218]
lea edx, [ecx + 2]
nop
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x402e80
sub ecx, edx
sar ecx, 1
push ecx
lea eax, [ebp - 0x218]
push eax
lea ecx, [ebp - 0xa48]
call fcn.00404bf0
cmp dword [ebp - 0xa1c], 8
lea eax, [ebp - 0xa30]
push 0
cmovae eax, dword [ebp - 0xa30]
push eax
call dword [sym.imp.api_ms_win_crt_filesystem_l1_1_0.dll__waccess_s]
add esp, 8
test eax, eax
jne 0x402fc2
mov eax, dword [ebp - 0xa20]
cmp dword [ebp - 0xa38], eax
jle 0x402fc2
push eax
push ecx
lea eax, [ebp - 0xa60]
push eax
lea ecx, [ebp - 0xa48]
call fcn.00404900
mov byte [ebp - 4], 2
lea ecx, [ebp - 0xa60]
cmp dword [ebp - 0xa4c], 8
lea eax, [ebp - 0xa30]
cmovae ecx, dword [ebp - 0xa60]
cmp dword [ebp - 0xa1c], 8
push ecx
cmovae eax, dword [ebp - 0xa30]
push eax
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__wcsicmp]
add esp, 8
test eax, eax
jne 0x402faa
lea eax, [ebp - 0x218]
push 0x5c
push eax
call dword [sym.imp.VCRUNTIME140.dll_wcsrchr]
add esp, 8
test eax, eax
je 0x402f5c
lea ecx, [ebp - 0x10]
cmp eax, ecx
je 0x402f5c
xor ecx, ecx
mov word [eax + 2], cx
lea eax, [ebp - 0x218]
push eax
mov ecx, esi
call fcn.00404990
cmp dword [esi + 0x14], 8
jb 0x402f66
mov eax, dword [esi]
jmp 0x402f68
mov eax, esi
push eax
push str.GetPackageWorkPath_2_OK___strWorkPath_s
push 0x40d028
call fcn.004016f0
add esp, 0xc
cmp dword [esi + 0x14], 8
jb 0x402f83
mov esi, dword [esi]
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
cmp eax, 1
mov eax, dword [ebp - 0xa4c]
sete bl
cmp eax, 8
jb 0x402fd6
inc eax
push eax
push dword [ebp - 0xa60]
call fcn.00404e80
jmp 0x402fd6
mov eax, dword [ebp - 0xa4c]
cmp eax, 8
jb 0x402fc2
inc eax
push eax
push dword [ebp - 0xa60]
call fcn.00404e80
push str.GetPackageWorkPath_3_failed....
push 0x40d028
call fcn.004016f0
add esp, 8
xor bl, bl
mov eax, dword [ebp - 0xa34]
cmp eax, 8
jb 0x402fee
inc eax
push eax
push dword [ebp - 0xa48]
call fcn.00404e80
mov ecx, dword [ebp - 0xa1c]
xor eax, eax
mov dword [ebp - 0xa34], 7
mov dword [ebp - 0xa38], 0
mov word [ebp - 0xa48], ax
cmp ecx, 8
jb 0x403023
inc ecx
push ecx
push dword [ebp - 0xa30]
call fcn.00404e80
mov al, bl
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00406283
mov esp, ebp
pop ebp
ret