Function at 0x1010585
Capabilities:
Delete file
Get common file path
Move file
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x640
mov eax, dword [0x101d004]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
mov edx, dword [ebp + 0x18]
push ebx
mov ebx, dword [ebp + 0x10]
push esi
mov esi, dword [ebp + 8]
push edi
xor edi, edi
cmp eax, edi
mov dword [ebp - 0x638], ecx
mov dword [ebp - 0x63c], ebx
mov dword [ebp - 0x634], edx
je 0x10105dc
mov edx, dword [eax + 4]
cmp edx, edi
je 0x10105dc
cmp word [eax], di
jbe 0x10105dc
push edx
add ecx, 0x50
call fcn.010037df
mov ecx, dword [ebp - 0x638]
cmp esi, edi
je 0x10105f5
mov eax, dword [esi + 4]
cmp eax, edi
je 0x10105f5
cmp word [esi], di
jbe 0x10105f5
push eax
add ecx, 0x54
call fcn.010037df
cmp dword [ebp + 0x14], edi
je 0x10107f6
cmp dword [ebp - 0x634], edi
je 0x10107f6
cmp ebx, edi
je 0x10107f6
cmp dword [ebx + 4], edi
je 0x10107f6
cmp word [ebx], di
jbe 0x10107f6
mov esi, 0x208
push esi
lea eax, [ebp - 0x62e]
push edi
push eax
mov word [ebp - 0x630], di
call sub.msvcrt.dll_memset
mov eax, dword [0x1010808]
mov dword [ebp - 0xc], eax
mov eax, dword [0x101080c]
push esi
mov dword [ebp - 8], eax
lea eax, [ebp - 0x422]
push edi
push eax
mov word [ebp - 0x424], di
call sub.msvcrt.dll_memset
push esi
lea eax, [ebp - 0x216]
push edi
push eax
mov word [ebp - 0x218], di
call sub.msvcrt.dll_memset
add esp, 0x24
lea eax, [ebp - 0x630]
push eax
mov esi, 0x104
push esi
mov dword [ebp - 0x640], edi
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
test eax, eax
jbe 0x10107f6
lea eax, [ebp - 0x424]
push eax
push edi
lea eax, [ebp - 0xc]
push eax
lea eax, [ebp - 0x630]
push eax
call dword [sym.imp.KERNEL32.dll_GetTempFileNameW]
test eax, eax
je 0x10107f6
push edi
push 0x80
push 2
push edi
push edi
push 0xc0000000
lea eax, [ebp - 0x424]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x10107d0
push edi
lea eax, [ebp - 0x640]
push eax
push dword [ebp + 0x14]
push dword [ebp - 0x634]
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x10107c4
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or dword [ebp - 0x634], 0xffffffff
lea eax, [ebp - 0x424]
push eax
push esi
lea eax, [ebp - 0x218]
push eax
call fcn.0100dd24
mov esi, dword [sym.imp.KERNEL32.dll_lstrlenW]
lea eax, [ebp - 0x218]
push eax
call esi
mov ebx, eax
cmp ebx, 5
jle 0x10107d0
mov eax, dword [ebp - 0x63c]
push dword [eax + 4]
mov word [ebp + ebx*2 - 0x21e], di
call esi
sub eax, 3
cmp eax, edi
jle 0x10107d0
mov ecx, dword [ebp - 0x63c]
mov ecx, dword [ecx + 4]
lea eax, [ecx + eax*2]
push eax
mov eax, 0x101
sub eax, ebx
push eax
lea eax, [ebp - 0x218]
push eax
call fcn.0100fa3f
test eax, eax
jl 0x10107d0
push 1
lea eax, [ebp - 0x218]
push eax
lea eax, [ebp - 0x424]
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
test eax, eax
je 0x10107d0
mov esi, dword [ebp - 0x638]
add esi, 0x58
mov eax, dword [esi]
cmp dword [eax - 0xc], edi
jle 0x10107b0
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
lea eax, [ebp - 0x218]
push eax
mov ecx, esi
call fcn.01003625
mov ebx, dword [ebp - 0x634]
cmp ebx, 0xffffffff
je 0x10107d0
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x638]
mov eax, dword [eax + 0x58]
cmp dword [eax - 0xc], edi
jne 0x10107f6
mov esi, dword [sym.imp.KERNEL32.dll_DeleteFileW]
lea eax, [ebp - 0x218]
push eax
call esi
lea eax, [ebp - 0x424]
push eax
call esi
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.010023ad
leave
ret 0x14