Function at 0x402180
Capabilities:
Delete file

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4073e8
mov eax, dword fs:[0]
push eax
sub esp, 0x40
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 dword [ebp - 4], 0
lea eax, [ebp + 8]
cmp dword [ebp + 0x1c], 8
cmovae eax, dword [ebp + 8]
push eax
push str.task_5_begin_to_check_maintenance_condition._WorkPath___s
push 0x40d028
call fcn.004016f0
add esp, 0xc
lea edx, [ebp + 8]
lea ecx, [ebp - 0x40]
push str.LenovoBatteryGaugePackage.dll
call fcn.00405470
add esp, 4
mov byte [ebp - 4], 1
lea esi, [ebp - 0x40]
cmp dword [ebp - 0x2c], 8
cmovae esi, dword [ebp - 0x40]
call fcn.00402600
test al, al
jne 0x402434
push str.task_6_case_1:_Not_install_files_exist__:_run_script_to_install__pop_up_toast_to_let_user_enable_BG
push 0x40d028
call fcn.004016f0
add esp, 8
mov dword [ebp - 0x14], 7
xor eax, eax
mov dword [ebp - 0x18], 0
mov word [ebp - 0x28], ax
lea ecx, [ebp - 0x28]
push 0xffffffffffffffff
push eax
lea eax, [ebp + 8]
push eax
call fcn.00404cf0
sub esp, 0x18
mov byte [ebp - 4], 2
mov ecx, esp
mov dword [ecx + 0x14], 7
mov dword [ecx + 0x10], 0
cmp dword [ecx + 0x14], 8
jb 0x402254
mov eax, dword [ecx]
jmp 0x402256
mov eax, ecx
xor edx, edx
push 0xffffffffffffffff
mov word [eax], dx
lea eax, [ebp + 8]
push edx
push eax
call fcn.00404cf0
lea ecx, [ebp - 0x28]
call fcn.004047d0
xor ecx, ecx
add esp, 0x18
cmp word [str.Install.ps1], cx
mov eax, 0xb
cmove eax, ecx
lea ecx, [ebp - 0x28]
push eax
push str.Install.ps1
call fcn.00405050
cmp dword [ebp - 0x14], 8
lea eax, [ebp - 0x28]
push 0
cmovae eax, dword [ebp - 0x28]
push eax
call dword [sym.imp.api_ms_win_crt_filesystem_l1_1_0.dll__waccess_s]
add esp, 8
test eax, eax
jne 0x4023e0
push str.task_7______InstallBatteryGauge
push 0x40d028
call fcn.004016f0
sub esp, 0x10
mov ecx, esp
mov dword [ecx + 0x14], 7
mov dword [ecx + 0x10], 0
cmp dword [ecx + 0x14], 8
jb 0x4022dc
mov eax, dword [ecx]
jmp 0x4022de
mov eax, ecx
xor edx, edx
push 0xffffffffffffffff
mov word [eax], dx
lea eax, [ebp - 0x28]
push edx
push eax
call fcn.00404cf0
call fcn.004031e0
add esp, 0x18
push 0x7530
call dword [sym.imp.KERNEL32.dll_Sleep]
sub esp, 0x18
mov ecx, esp
mov dword [ecx + 0x14], 7
mov dword [ecx + 0x10], 0
cmp dword [ecx + 0x14], 8
jb 0x40231f
mov eax, dword [ecx]
jmp 0x402321
mov eax, ecx
xor edx, edx
push 0xffffffffffffffff
mov word [eax], dx
lea eax, [ebp - 0x40]
push edx
push eax
call fcn.00404cf0
call fcn.00403040
add esp, 0x18
test al, al
je 0x402419
lea ecx, [ebp - 0x44]
mov dword [ebp - 0x44], 0
call fcn.00402b20
test eax, eax
je 0x402419
call fcn.00402730
test al, al
je 0x4023ae
push str.task_8______show_BG_directly_because_its_Registry_status_is_shown
push 0x40d028
call fcn.004016f0
sub esp, 0x10
mov ecx, esp
mov dword [ebp - 0x4c], esp
push str.ShowBatteryGauge
call fcn.00404aa0
sub esp, 0x18
mov byte [ebp - 4], 3
lea eax, [ebp + 8]
mov ecx, esp
push eax
call fcn.00404b00
mov ecx, dword [ebp - 0x44]
mov byte [ebp - 4], 2
call fcn.00403690
mov ecx, dword [ebp - 0x44]
add esp, 0x30
call fcn.00402ca0
jmp 0x402419
push str.task_8______show_toast_to_let_user_enable_BG
push 0x40d028
call fcn.004016f0
sub esp, 0x10
lea eax, [ebp + 8]
mov ecx, esp
push eax
call fcn.00404b00
mov ecx, dword [ebp - 0x44]
call fcn.00403c10
mov ecx, dword [ebp - 0x44]
add esp, 0x18
call fcn.00402ca0
jmp 0x402419
push str.task_9______no_install.ps1__but_only_dll_exist__Try_to_delete_dll_to_force_VS_download_new_Addin
push 0x40d028
call fcn.004016f0
push 0
push esi
call dword [sym.imp.api_ms_win_crt_filesystem_l1_1_0.dll__waccess_s]
add esp, 0x10
test eax, eax
jne 0x402419
push esi
push str.task_10_______delete_dll_file:___s_
push 0x40d028
call fcn.004016f0
add esp, 0xc
push esi
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov eax, dword [ebp - 0x14]
cmp eax, 8
jb 0x40259e
inc eax
push eax
push dword [ebp - 0x28]
call fcn.00404e80
jmp 0x40259e
lea ecx, [ebp - 0x44]
mov dword [ebp - 0x44], 0
call fcn.00402b20
test eax, eax
je 0x40259e
push dword [ebp - 0x44]
push str.task_12_BG_has_already_been_installed..._hImpersonationToken0x_X
push 0x40d028
call fcn.004016f0
add esp, 0xc
call fcn.00402730
mov bl, al
call fcn.00402800
test bl, bl
je 0x4024fd
test al, al
je 0x402494
push str.task_15__case_2:_Install__display_:_exit_for_Win10_because_its_correct._But_for_Win11__need_to_show_toast
push 0x40d028
call fcn.004016f0
add esp, 8
call fcn.004028d0
jmp 0x40255a
push str.task_16__case_3:_Install__display_status_error_:_show_BG_icon_for_Win10._Show_toast_for_Win11
push 0x40d028
call fcn.004016f0
add esp, 8
call fcn.004028d0
test al, al
je 0x4024c8
call fcn.00402970
test al, al
je 0x40255e
xor ecx, ecx
call fcn.00402a60
jmp 0x40255e
sub esp, 0x18
mov ecx, esp
mov dword [ebp - 0x48], esp
push str.ShowBatteryGauge_updatestatus
call fcn.00404aa0
sub esp, 0x18
mov byte [ebp - 4], 4
lea eax, [ebp + 8]
mov ecx, esp
push eax
call fcn.00404b00
mov ecx, dword [ebp - 0x44]
mov byte [ebp - 4], 1
call fcn.00403690
add esp, 0x30
jmp 0x402577
test al, al
je 0x40251f
push str.task_18___case_4:_Install__display_status_error_:_update_registry
push 0x40d028
call fcn.004016f0
add esp, 8
mov ecx, 1
call fcn.00402a60
jmp 0x402577
push str.task_18__case_5:_Install__not_display_:_pop_up_toast_to_let_user_enable_BG
push 0x40d028
call fcn.004016f0
sub esp, 0x10
xor eax, eax
mov ecx, esp
push 0xffffffffffffffff
mov dword [ecx + 0x14], 7
mov dword [ecx + 0x10], 0
push eax
mov word [ecx], ax
lea eax, [ebp - 0x40]
push eax
call fcn.00404cf0
call fcn.00403040
add esp, 0x18
test al, al
je 0x402577
sub esp, 0x18
lea eax, [ebp + 8]
mov ecx, esp
push eax
call fcn.00404b00
mov ecx, dword [ebp - 0x44]
call fcn.00403c10
add esp, 0x18
mov esi, dword [ebp - 0x44]
push esi
push str.ImpersonateLoggedOnUserEnd_1_hImpersonationToken_d
push 0x40d028
call fcn.004016f0
add esp, 0xc
test esi, esi
je 0x40259e
call dword [sym.imp.ADVAPI32.dll_RevertToSelf]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x2c]
cmp eax, 8
jb 0x4025b0
inc eax
push eax
push dword [ebp - 0x40]
call fcn.00404e80
xor eax, eax
mov dword [ebp - 0x2c], 7
mov word [ebp - 0x40], ax
mov eax, dword [ebp + 0x1c]
mov dword [ebp - 0x30], 0
cmp eax, 8
jb 0x4025d6
inc eax
push eax
push dword [ebp + 8]
call fcn.00404e80
xor eax, eax
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