Function at 0x405040
Capabilities:
Check if file exists

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4ee30c
mov eax, dword fs:[0]
push eax
mov eax, 0x10d0
call fcn.004ed710
mov eax, dword [0x53e008]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
push 0x800
lea eax, [ebp - 0x1010]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
push 0x400
lea eax, [ebp - 0x1010]
push eax
push 0x50ce1c
push str.powershell.exe
call dword [sym.imp.api_ms_win_crt_environment_l1_1_0.dll__wsearchenv_s]
add esp, 0x1c
lea eax, [ebp - 0x1010]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x4050ba
xor al, al
jmp 0x405300
push 0x800
lea eax, [ebp - 0x810]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
lea eax, [ebp - 0x810]
push 0x400
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea eax, [ebp - 0x810]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
xor eax, eax
mov dword [ebp - 0x1030], 0
mov word [ebp - 0x1040], ax
lea eax, [ebp - 0x810]
mov dword [ebp - 0x102c], 0
lea edx, [eax + 2]
mov dword [ebp - 0x1030], 0
mov dword [ebp - 0x102c], 7
nop dword [eax + eax]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x405130
sub eax, edx
lea ecx, [ebp - 0x1040]
sar eax, 1
push eax
lea eax, [ebp - 0x810]
push eax
call fcn.004037f0
mov dword [ebp - 4], 0
lea eax, [ebp - 0x810]
push str.Safe2345AppExts.msix
push eax
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
xor eax, eax
mov dword [ebp - 0x1018], 0
lea ecx, [ebp - 0x810]
mov dword [ebp - 0x1014], 0
mov dword [ebp - 0x1018], 0
lea edx, [ecx + 2]
mov dword [ebp - 0x1014], 7
mov word [ebp - 0x1028], ax
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x4051a5
sub ecx, edx
lea eax, [ebp - 0x810]
sar ecx, 1
push ecx
push eax
lea ecx, [ebp - 0x1028]
call fcn.004037f0
mov byte [ebp - 4], 1
lea eax, [ebp - 0x10d8]
push 0x98
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 4
lea ecx, [ebp - 0x10d8]
call fcn.0040c5d0
mov byte [ebp - 4], 2
mov edx, 0x50ced4
lea ecx, [ebp - 0x10d8]
call fcn.0040cf80
lea edx, [ebp - 0x1010]
mov ecx, eax
call fcn.0040cf80
mov edx, 0x50cecc
mov ecx, eax
call fcn.0040cf80
mov edx, str.Add_AppxPackage
mov ecx, eax
call fcn.0040cf80
mov edx, 0x50ce74
mov ecx, eax
call fcn.0040cf80
cmp dword [ebp - 0x1014], 8
lea edx, [ebp - 0x1028]
push dword [ebp - 0x1018]
cmovae edx, dword [ebp - 0x1028]
mov ecx, eax
call fcn.0040ddb0
mov edx, 0x50cea0
mov ecx, eax
call fcn.0040cf80
mov edx, 0x50ce78
mov ecx, eax
call fcn.0040cf80
mov edx, 0x50ce74
mov ecx, eax
call fcn.0040cf80
cmp dword [ebp - 0x102c], 8
lea edx, [ebp - 0x1040]
push dword [ebp - 0x1030]
cmovae edx, dword [ebp - 0x1040]
mov ecx, eax
call fcn.0040ddb0
add esp, 8
mov edx, 0x50ce74
mov ecx, eax
call fcn.0040cf80
push 5
sub esp, 0x18
lea ecx, [ebp - 0x10d8]
mov eax, esp
mov dword [ebp - 0x10dc], esp
push eax
call fcn.0040c4e0
mov byte [ebp - 4], 3
mov byte [ebp - 4], 2
call fcn.00404f60
mov bl, al
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x10d8]
call fcn.00405320
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x1028]
call fcn.00403780
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x1040]
call fcn.00403780
mov al, bl
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004ec151
mov esp, ebp
pop ebp
ret