Function at 0x40878e
Capabilities:
Delete file
Get common file path
Get file size
Read file on windows
Set file attributes
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x4c0
push ebx
push esi
push edi
mov esi, str._rename_
lea edi, [ebp - 0x24]
xor ebx, ebx
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsb byte es:[edi], byte [esi]
mov esi, 0x80
mov byte [ebp - 1], bl
push esi
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.DLL_SetFileAttributesA]
test eax, eax
je 0x408898
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.DLL_DeleteFileA]
test eax, eax
je 0x4087d5
mov al, 1
jmp 0x408a30
push 0x24
xor eax, eax
pop ecx
lea edi, [ebp - 0xb4]
mov dword [ebp - 0xb8], 0x94
rep stosd dword es:[edi], eax
lea eax, [ebp - 0xb8]
push eax
call dword [sym.imp.KERNEL32.DLL_GetVersionExA]
test eax, eax
je 0x408898
cmp dword [ebp - 0xa8], 2
jne 0x40883c
push str.kernel32.dll
call dword [sym.imp.KERNEL32.DLL_GetModuleHandleA]
push str.MoveFileExA
push eax
call dword [sym.imp.KERNEL32.DLL_GetProcAddress]
cmp eax, ebx
je 0x408a2d
push 4
push ebx
push dword [ebp + 8]
call eax
test eax, eax
setne byte [ebp - 1]
jmp 0x408a2d
lea eax, [ebp - 0x4c0]
push 0x104
push eax
call dword [sym.imp.KERNEL32.DLL_GetWindowsDirectoryA]
test eax, eax
je 0x408898
lea eax, [ebp - 0x4c0]
push eax
lea eax, [ebp - 0x3bc]
push eax
call fcn.004108e0
lea eax, [ebp - 0x3bc]
push str.WININIT.INI
push eax
call fcn.004108f0
add esp, 0x10
lea eax, [ebp - 0x3bc]
push ebx
push esi
push 4
push ebx
push ebx
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.DLL_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
jne 0x40889f
xor al, al
jmp 0x408a30
push ebx
push edi
call dword [sym.imp.KERNEL32.DLL_GetFileSize]
cmp eax, 0xffffffff
mov dword [ebp - 0x14], eax
je 0x408a26
lea esi, [eax + 1]
push esi
call fcn.004119f5
push esi
mov dword [ebp - 8], eax
call fcn.004119f5
push esi
push ebx
push dword [ebp - 8]
mov dword [ebp - 0x10], eax
call fcn.004109d0
push esi
mov esi, dword [ebp - 0x10]
push ebx
push esi
call fcn.004109d0
add esp, 0x20
lea eax, [ebp - 0x18]
push ebx
push eax
push dword [ebp - 0x14]
push dword [ebp - 8]
push edi
call dword [sym.imp.KERNEL32.DLL_ReadFile]
test eax, eax
je 0x408a0a
push dword [ebp - 8]
push esi
call fcn.004108e0
push esi
call fcn.00412370
lea eax, [ebp - 0x24]
push eax
push esi
call fcn.004122f0
mov dword [ebp - 0x14], eax
lea eax, [ebp - 0x2b8]
push str.NUL
push eax
call fcn.004108e0
push dword [ebp + 8]
lea eax, [ebp - 0x2b8]
push eax
call fcn.004108f0
mov esi, 0x420738
lea eax, [ebp - 0x2b8]
push esi
push eax
call fcn.004108f0
add esp, 0x2c
cmp dword [ebp - 0x14], ebx
jne 0x408972
push 2
push ebx
push ebx
push edi
call dword [sym.imp.KERNEL32.DLL_SetFilePointer]
cmp eax, 0xffffffff
je 0x408a0a
lea eax, [ebp - 0xc]
push ebx
push eax
push 0xc
push str._r_n_rename__r_n
jmp 0x408989
push esi
push dword [ebp - 0x14]
call fcn.004122f0
pop ecx
cmp eax, ebx
pop ecx
jne 0x4089ad
lea eax, [ebp - 0xc]
push ebx
push eax
push 2
push esi
mov esi, dword [sym.imp.KERNEL32.DLL_WriteFile]
push edi
call esi
lea eax, [ebp - 0xc]
push ebx
push eax
lea eax, [ebp - 0x2b8]
push eax
call fcn.00410a60
pop ecx
push eax
lea eax, [ebp - 0x2b8]
jmp 0x408a02
sub eax, dword [ebp - 0x10]
push ebx
push ebx
inc eax
inc eax
push eax
push edi
mov dword [ebp + 8], eax
call dword [sym.imp.KERNEL32.DLL_SetFilePointer]
cmp eax, 0xffffffff
je 0x408a0a
lea eax, [ebp - 0xc]
push ebx
push eax
lea eax, [ebp - 0x2b8]
push eax
call fcn.00410a60
mov esi, dword [sym.imp.KERNEL32.DLL_WriteFile]
pop ecx
push eax
lea eax, [ebp - 0x2b8]
push eax
push edi
call esi
lea eax, [ebp - 0xc]
push ebx
push eax
push dword [ebp - 8]
call fcn.00410a60
pop ecx
mov ecx, eax
mov eax, dword [ebp + 8]
sub ecx, eax
push ecx
mov ecx, dword [ebp - 8]
add eax, ecx
push eax
push edi
call esi
mov byte [ebp - 1], 1
cmp dword [ebp - 8], ebx
je 0x408a18
push dword [ebp - 8]
call fcn.004116b3
pop ecx
cmp dword [ebp - 0x10], ebx
je 0x408a26
push dword [ebp - 0x10]
call fcn.004116b3
pop ecx
push edi
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
mov al, byte [ebp - 1]
pop edi
pop esi
pop ebx
leave
ret