Function at 0x4089e0
Capabilities:
Delete file
Set file attributes
Write file on windows

Disassembly:
sub esp, 0x420
mov eax, dword [0x5b0c20]
xor eax, esp
mov dword [esp + 0x41c], eax
mov eax, dword [esp + 0x424]
push ebx
push ebp
lea ecx, [eax + 2]
push eax
mov dword [esp + 0xc], 0
xor ebx, ebx
mov dword [esp + 0x14], ecx
call fcn.00407e40
push eax
push ecx
lea eax, [esp + 0x20]
push 0x5516e0
push eax
call fcn.00525f70
add esp, 0x14
push 0x26
lea ecx, [esp + 0x18]
push ecx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
test eax, eax
je 0x408a48
lea edx, [esp + 0x14]
push edx
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov dword [esp + 8], eax
push 0
push 0xa0000026
push 2
push 0
push 7
push 0xc0000000
lea eax, [esp + 0x2c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebp, eax
cmp ebp, 0xffffffff
jne 0x408aaa
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea ecx, [esp + 0x18]
push ecx
lea edx, [esp + 0x224]
push str.Could_not_create__s_file__error__d_n
push edx
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x10
push 0
push 0x54ffac
lea eax, [esp + 0x224]
push eax
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
jmp 0x408bda
push 0
push 0
push 0
push ebp
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
test eax, eax
je 0x408af9
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea ecx, [esp + 0x18]
push ecx
lea edx, [esp + 0x224]
push str.Could_not_set_pointer_in__s_file__error__d_n
push edx
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x10
push 0
push 0x54ffac
lea eax, [esp + 0x224]
push eax
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
jmp 0x408bda
push 0x1000
call fcn.00401bb0
mov ebx, eax
add esp, 4
test ebx, ebx
je 0x408bda
mov eax, dword [esp + 0x430]
push esi
push edi
mov esi, eax
mov ecx, 0x200
mov edi, ebx
rep movsd dword es:[edi], dword [esi]
mov esi, eax
push 0
lea edi, [ebx + 0x800]
mov ecx, 0x200
rep movsd dword es:[edi], dword [esi]
lea ecx, [esp + 0x18]
push ecx
push 0x1000
push ebx
push ebp
call dword [sym.imp.KERNEL32.dll_WriteFile]
pop edi
pop esi
test eax, eax
jne 0x408b88
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea edx, [esp + 0x18]
push edx
lea eax, [esp + 0x224]
push str.Could_not_write__s_file__error__d_n
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x10
push 0
push 0x54ffac
lea ecx, [esp + 0x224]
push ecx
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
jmp 0x408bda
cmp dword [esp + 0xc], 0x1000
je 0x408bd2
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov eax, dword [esp + 0x10]
lea edx, [esp + 0x18]
push edx
push eax
lea ecx, [esp + 0x228]
push str.Written_only__d_bytes_to__s_file__error__d_n
push ecx
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x14
push 0
push 0x54ffac
lea edx, [esp + 0x224]
push edx
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
jmp 0x408bda
mov dword [esp + 8], 1
cmp dword [0x5b28f4], 0
jne 0x408bf2
mov eax, dword [esp + 0x10]
push 0
push eax
call fcn.00413f90
add esp, 8
test ebx, ebx
je 0x408bff
push ebx
call fcn.00401bc0
add esp, 4
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esp + 0x424]
mov eax, dword [esp + 8]
pop ebp
pop ebx
xor ecx, esp
call fcn.00524d83
add esp, 0x420
ret