Function at 0x401ace
Capabilities:
Check if file exists
Create directory
Delete directory
Delete file
Get file attributes
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x838
mov eax, dword [0x41c004]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
xor esi, esi
mov dword [ebp - 0x828], ecx
mov ecx, dword [ebp + 0xc]
mov ebx, edx
mov dword [ebp - 0x82c], eax
mov dword [ebp - 0x830], ecx
mov dword [ebp - 0x834], esi
mov dword [ebp - 0x838], esi
push edi
mov edi, esi
test eax, eax
je 0x401ba0
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov edi, dword [ebp - 0x82c]
cmp eax, 0xffffffff
jne 0x401b4f
push esi
push edi
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
jne 0x401b45
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x401ced
mov dword [ebp - 0x838], 1
push edi
mov edi, 0x410
lea eax, [ebp - 0x824]
push edi
push eax
call fcn.00405270
lea eax, [ebp - 0x824]
push edi
push eax
call fcn.004054cb
mov edi, eax
add esp, 0x14
cmp edi, 0x40e
jae 0x401ba0
push 0x5c
pop eax
mov word [ebp + edi*2 - 0x824], ax
inc edi
lea eax, [edi + edi]
cmp eax, 0x820
jae 0x401d38
xor ecx, ecx
mov word [ebp + eax - 0x824], cx
cmp ebx, 0xffff
jbe 0x401bd7
mov eax, 0x410
sub eax, edi
push ebx
push eax
lea eax, [ebp - 0x824]
lea eax, [eax + edi*2]
push eax
call fcn.00405270
mov edi, 0x410
lea eax, [ebp - 0x824]
push edi
push eax
call fcn.004054cb
add esp, 0x14
jmp 0x401c3b
mov ecx, ebx
call fcn.00401a4c
test eax, eax
je 0x401ced
mov ecx, dword [0x41d2d4]
mov eax, 0x40f
sub eax, edi
cmp eax, ecx
jae 0x401bff
mov ecx, eax
mov dword [0x41d2d4], ecx
mov edx, esi
test ecx, ecx
je 0x401c1e
mov ebx, dword [0x41d2d0]
movsx ax, byte [ebx + edx]
mov word [ebp + edi*2 - 0x824], ax
inc edi
inc edx
cmp edx, ecx
jb 0x401c0b
add edi, edi
cmp edi, 0x820
jae 0x401d38
xor eax, eax
mov word [ebp + edi - 0x824], ax
call fcn.00401aa1
mov ebx, dword [ebp - 0x828]
test bx, bx
je 0x401c51
mov ecx, ebx
call fcn.00401a4c
test eax, eax
jne 0x401c69
cmp dword [0x41d2d0], esi
je 0x401ced
cmp dword [0x41d2d4], esi
je 0x401ced
xor eax, eax
cmp dword [ebp - 0x830], eax
push esi
sete al
push 0x80
lea eax, [eax*2 + 2]
push eax
push esi
push 1
push 0x40000000
lea eax, [ebp - 0x824]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
je 0x401cdf
mov dword [ebp - 0x834], 1
cmp dword [ebp - 0x830], esi
jne 0x401cbb
push 2
push esi
push esi
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push esi
lea eax, [ebp - 0x828]
push eax
push dword [0x41d2d4]
push dword [0x41d2d0]
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push edi
mov esi, eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test bx, bx
je 0x401ce9
call fcn.00401aa1
test esi, esi
jne 0x401d27
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp dword [ebp - 0x834], 0
mov edi, eax
je 0x401d0b
lea eax, [ebp - 0x824]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
cmp dword [ebp - 0x838], 0
je 0x401d20
push dword [ebp - 0x82c]
call dword [sym.imp.KERNEL32.dll_RemoveDirectoryW]
push edi
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov ecx, dword [ebp - 4]
mov eax, esi
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040331d
leave
ret
call fcn.0040344d
int3