Function at 0x401b57
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 word [ebp - 0x826], cx
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 0x401c2a
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov edi, dword [ebp - 0x82c]
cmp eax, 0xffffffff
jne 0x401bd9
push esi
push edi
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
jne 0x401bcf
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x401da8
mov dword [ebp - 0x838], 1
push edi
mov edi, 0x410
lea eax, [ebp - 0x824]
push edi
push eax
call fcn.00404fa7
lea eax, [ebp - 0x824]
push edi
push eax
call fcn.00405202
mov edi, eax
add esp, 0x14
cmp edi, 0x40e
jae 0x401c2a
push 0x5c
pop eax
mov word [ebp + edi*2 - 0x824], ax
inc edi
lea eax, [edi + edi]
cmp eax, 0x820
jae 0x401df5
xor ecx, ecx
mov word [ebp + eax - 0x824], cx
cmp ebx, 0xffff
jbe 0x401c61
mov eax, 0x410
sub eax, edi
push ebx
push eax
lea eax, [ebp - 0x824]
lea eax, [eax + edi*2]
push eax
call fcn.00404fa7
mov edi, 0x410
lea eax, [ebp - 0x824]
push edi
push eax
call fcn.00405202
add esp, 0x14
jmp 0x401cdd
push 0xa
movzx eax, bx
push eax
push esi
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov dword [0x41d2d0], eax
test eax, eax
je 0x401c7e
call fcn.00401ae6
jmp 0x401c80
mov eax, esi
test eax, eax
je 0x401da8
mov ecx, dword [0x41d2dc]
mov eax, 0x40f
sub eax, edi
cmp eax, ecx
jae 0x401ca1
mov ecx, eax
mov dword [0x41d2dc], ecx
mov edx, esi
test ecx, ecx
je 0x401cc0
mov ebx, dword [0x41d2d8]
movsx ax, byte [ebx + edx]
mov word [ebp + edi*2 - 0x824], ax
inc edi
inc edx
cmp edx, ecx
jb 0x401cad
add edi, edi
cmp edi, 0x820
jae 0x401df5
xor eax, eax
mov word [ebp + edi - 0x824], ax
call fcn.00401b2a
mov bx, word [ebp - 0x826]
test bx, bx
je 0x401d0c
push 0xa
movzx eax, bx
push eax
push esi
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov dword [0x41d2d0], eax
test eax, eax
je 0x401d06
call fcn.00401ae6
jmp 0x401d08
mov eax, esi
test eax, eax
jne 0x401d24
cmp dword [0x41d2d8], esi
je 0x401da8
cmp dword [0x41d2dc], esi
je 0x401da8
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 0x401d9a
mov dword [ebp - 0x834], 1
cmp dword [ebp - 0x830], esi
jne 0x401d76
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 [0x41d2dc]
push dword [0x41d2d8]
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 0x401da4
call fcn.00401b2a
test esi, esi
jne 0x401de2
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp dword [ebp - 0x834], 0
mov edi, eax
je 0x401dc6
lea eax, [ebp - 0x824]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
cmp dword [ebp - 0x838], 0
je 0x401ddb
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.004037ca
mov esp, ebp
pop ebp
ret
call fcn.004038fe
int3