Function at 0x10046370
Capabilities:
Check if file exists
Copy file
Delete file
Get common file path
Move file

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x1008
call fcn.10084a10
mov eax, dword [0x1017d4e4]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x10]
push ebx
mov ebx, dword [ebp + 8]
mov dword [ebp - 0x1008], eax
push esi
mov esi, dword [ebp + 0xc]
push edi
mov edi, ecx
test ebx, ebx
je 0x10046519
test esi, esi
je 0x10046519
push 0x800
lea eax, [ebp - 0x1004]
push 0
push eax
call fcn.100ce270
push 0x800
lea eax, [ebp - 0x804]
push 0
push eax
call fcn.100ce270
push 0x400
lea eax, [ebp - 0x1004]
push esi
push eax
call fcn.100eca15
add esp, 0x24
lea eax, [ebp - 0x1004]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
lea eax, [ebp - 0x1004]
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHCreateDirectory]
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x100464f1
push esi
push str.Dest_File_Exist:__s
call fcn.10042220
push esi
call fcn.10004cd0
add esp, 0xc
test eax, eax
jne 0x100464f1
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
push str.Delete_File__s_Failed__error___d
call fcn.10042220
add esp, 0xc
lea eax, [ebp - 0x804]
push eax
push 0
push 0x101441c8
lea eax, [ebp - 0x1004]
push eax
call dword [sym.imp.KERNEL32.dll_GetTempFileNameW]
lea eax, [ebp - 0x804]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
lea eax, [ebp - 0x804]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_MoveFileW]
test eax, eax
je 0x1004652e
lea eax, [ebp - 0x804]
push eax
push esi
push str.Rename_File__s_to__s_success
call fcn.10042220
add esp, 0xc
lea eax, [ebp - 0x804]
push 4
push 0
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
lea eax, [ebp - 0x804]
push eax
push str.delete_by_pending_file:_s
call fcn.10042220
mov eax, dword [ebp - 0x1008]
add esp, 8
test eax, eax
je 0x100464ca
mov dword [eax], 4
cmp dword [edi + 0x70], 0
jne 0x100464f1
push esi
mov ecx, edi
call fcn.10045b70
test eax, eax
je 0x100464f1
push esi
push str.check_file__s___need_reboot_now
call fcn.10042220
add esp, 8
mov dword [edi + 0x70], 1
push 0
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_CopyFileW]
test eax, eax
jne 0x100465a8
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
push ebx
push str.Copy_From__s_to__s_Failed_Error_Code___d
call fcn.10042220
add esp, 0x10
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.100845e8
mov esp, ebp
pop ebp
ret 0xc
push esi
push str.Rename_File__s_failed__replace_until_reboot
call fcn.10042220
add esp, 8
lea eax, [ebp - 0x804]
push 0
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_CopyFileW]
push 5
push esi
lea eax, [ebp - 0x804]
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
lea eax, [ebp - 0x804]
push eax
push ebx
push str.copy__s_to__s__replace_until_reboot
call fcn.10042220
mov eax, dword [ebp - 0x1008]
add esp, 0xc
test eax, eax
je 0x10046581
mov dword [eax], 5
cmp dword [edi + 0x70], 0
jne 0x100465a8
push esi
mov ecx, edi
call fcn.10045b70
test eax, eax
je 0x100465a8
push esi
push str.check_file__s___need_reboot_now
call fcn.10042220
add esp, 8
mov dword [edi + 0x70], 1
mov ecx, dword [ebp - 4]
mov eax, 1
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.100845e8
mov esp, ebp
pop ebp
ret 0xc