Function at 0x401e20
Capabilities:
Check if file exists
Copy file
Get common file path
Get file attributes
Move file
Set file attributes

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x800c
call fcn.0041c430
mov eax, dword [0x425004]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
mov ecx, 0x20
mov dword [ebp - 0x800c], 0
call fcn.004026d0
mov ebx, dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
mov edi, dword [sym.imp.KERNEL32.dll_CopyFileW]
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x402009
push 0x1000
lea eax, [ebp - 0x4008]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemWindowsDirectoryW]
push str.System32haspsrm_win32.dll
lea eax, [ebp - 0x4008]
push 0x1000
push eax
call fcn.0040cf95
add esp, 0xc
lea eax, [ebp - 0x2008]
push 0x4265a8
push 0x1000
push eax
call fcn.0040cf31
add esp, 0xc
lea eax, [ebp - 0x2008]
push str.haspsrm_win32.dll
push 0x1000
push eax
call fcn.0040cf95
add esp, 0xc
lea eax, [ebp - 0x2008]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x401ee8
test al, 1
je 0x401ee8
and eax, 0xfffffffe
push eax
lea eax, [ebp - 0x2008]
push eax
call ebx
lea eax, [ebp - 0x4008]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x401f0b
test al, 1
je 0x401f0b
and eax, 0xfffffffe
push eax
lea eax, [ebp - 0x4008]
push eax
call ebx
push 0
lea eax, [ebp - 0x4008]
push eax
lea eax, [ebp - 0x2008]
push eax
call edi
call esi
cmp dword [0x4263a4], 0
mov edi, eax
je 0x401f46
push edi
lea eax, [ebp - 0x4008]
push eax
lea eax, [ebp - 0x2008]
push eax
push str.Copying__s_n_To__s_n_LastError_d_n
call fcn.00401050
add esp, 0x10
test edi, edi
je 0x402003
lea eax, [ebp - 0x8008]
push eax
push 0x1000
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
lea eax, [ebp - 0x6008]
push eax
push 0
push str.haspLow
lea eax, [ebp - 0x8008]
push eax
call dword [sym.imp.KERNEL32.dll_GetTempFileNameW]
mov edi, dword [sym.imp.KERNEL32.dll_CopyFileW]
lea eax, [ebp - 0x6008]
push 0
push eax
lea eax, [ebp - 0x2008]
push eax
call edi
cmp dword [0x4263a4], 0
je 0x401fba
call esi
push eax
lea eax, [ebp - 0x6008]
push eax
lea eax, [ebp - 0x2008]
push eax
push str.Copying__s_n_To_temporary__s_n_LastError_d_n
call fcn.00401050
add esp, 0x10
push 5
lea eax, [ebp - 0x4008]
push eax
lea eax, [ebp - 0x6008]
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
cmp dword [0x4263a4], 0
je 0x401ff7
call esi
push eax
lea eax, [ebp - 0x4008]
push eax
lea eax, [ebp - 0x6008]
push eax
push str.MoveFileEx__s_n_To__s_n_LastError_d_n
call fcn.00401050
add esp, 0x10
mov dword [ebp - 0x800c], 1
jmp 0x402009
mov edi, dword [sym.imp.KERNEL32.dll_CopyFileW]
cmp dword [0x4263a0], 0
je 0x4021b7
mov ecx, 0x40
call fcn.004026d0
test eax, eax
je 0x4021b7
push 0x1000
lea eax, [ebp - 0x4008]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemWindowsDirectoryW]
push str.Sysnativehaspsrm_win64.dll
lea eax, [ebp - 0x4008]
push 0x1000
push eax
call fcn.0040cf95
add esp, 0xc
lea eax, [ebp - 0x2008]
push 0x4265a8
push 0x1000
push eax
call fcn.0040cf31
add esp, 0xc
lea eax, [ebp - 0x2008]
push str.haspsrm_win64.dll
push 0x1000
push eax
call fcn.0040cf95
add esp, 0xc
lea eax, [ebp - 0x2008]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x4020a8
test al, 1
je 0x4020a8
and eax, 0xfffffffe
push eax
lea eax, [ebp - 0x2008]
push eax
call ebx
lea eax, [ebp - 0x4008]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x4020cb
test al, 1
je 0x4020cb
and eax, 0xfffffffe
push eax
lea eax, [ebp - 0x4008]
push eax
call ebx
push 0
lea eax, [ebp - 0x4008]
push eax
lea eax, [ebp - 0x2008]
push eax
call edi
call esi
cmp dword [0x4263a4], 0
mov edi, eax
je 0x402106
push edi
lea eax, [ebp - 0x4008]
push eax
lea eax, [ebp - 0x2008]
push eax
push str.Copying__s_n_To__s_n_LastError_d_n
call fcn.00401050
add esp, 0x10
test edi, edi
je 0x4021b7
lea eax, [ebp - 0x8008]
push eax
push 0x1000
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
lea eax, [ebp - 0x6008]
push eax
push 0
push str.haspHigh
lea eax, [ebp - 0x8008]
push eax
call dword [sym.imp.KERNEL32.dll_GetTempFileNameW]
push 0
lea eax, [ebp - 0x6008]
push eax
lea eax, [ebp - 0x2008]
push eax
call dword [sym.imp.KERNEL32.dll_CopyFileW]
cmp dword [0x4263a4], 0
je 0x402178
call esi
push eax
lea eax, [ebp - 0x6008]
push eax
lea eax, [ebp - 0x2008]
push eax
push str.Copying__s_n_To_temporary__s_n_LastError_d_n
call fcn.00401050
add esp, 0x10
push 5
lea eax, [ebp - 0x4008]
push eax
lea eax, [ebp - 0x6008]
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
cmp dword [0x4263a4], 0
je 0x4021c0
call esi
push eax
lea eax, [ebp - 0x4008]
push eax
lea eax, [ebp - 0x6008]
push eax
push str.MoveFileEx__s_n_To__s_n_LastError_d_n
call fcn.00401050
add esp, 0x10
jmp 0x4021c0
cmp dword [ebp - 0x800c], 1
jne 0x4021e3
push str.Reboot_needed_to_complete_installation._n
call fcn.00401050
add esp, 4
mov eax, 8
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040292d
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
xor eax, eax
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040292d
mov esp, ebp
pop ebp
ret