Function at 0x4018e1
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, 0x114
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_lstrlenA]
push esi
xor esi, esi
cmp dword [ebp + 0x10], esi
push edi
mov edi, dword [sym.imp.KERNEL32.dll_lstrcpynA]
mov dword [ebp - 4], esi
mov dword [ebp - 0xc], esi
mov dword [ebp - 8], esi
je 0x401972
push dword [ebp + 0x10]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x40193d
push esi
push dword [ebp + 0x10]
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
test eax, eax
jne 0x401936
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x401abf
mov dword [ebp - 8], 1
push 0x104
push dword [ebp + 0x10]
lea eax, [ebp - 0x114]
push eax
call edi
lea eax, [ebp - 0x114]
push eax
call ebx
mov esi, eax
cmp esi, 0x102
jae 0x401972
mov byte [ebp + esi - 0x114], 0x5c
inc esi
mov byte [ebp + esi - 0x114], 0
cmp dword [ebp + 0xc], 0xffff
jbe 0x40199d
mov eax, 0x104
sub eax, esi
push eax
push dword [ebp + 0xc]
lea eax, [ebp + esi - 0x114]
push eax
call edi
lea eax, [ebp - 0x114]
push eax
call ebx
xor edi, edi
jmp 0x401a08
movzx eax, word [ebp + 0xc]
push 0xa
push eax
push 0
call dword [sym.imp.KERNEL32.dll_FindResourceA]
test eax, eax
mov dword [0x405384], eax
je 0x4019bc
call fcn.0040186f
jmp 0x4019be
xor eax, eax
test eax, eax
je 0x401abf
mov eax, dword [0x405390]
mov ecx, 0x103
sub ecx, esi
cmp ecx, eax
jae 0x4019dd
mov eax, ecx
mov dword [0x405390], eax
xor edi, edi
xor ecx, ecx
cmp eax, edi
jbe 0x4019fb
mov edx, dword [0x40538c]
mov dl, byte [edx + ecx]
mov byte [ebp + esi - 0x114], dl
inc esi
inc ecx
cmp ecx, eax
jb 0x4019e5
mov byte [ebp + esi - 0x114], 0
call fcn.004018b4
cmp word [ebp + 8], di
je 0x401a32
movzx eax, word [ebp + 8]
push 0xa
push eax
push edi
call dword [sym.imp.KERNEL32.dll_FindResourceA]
cmp eax, edi
mov dword [0x405384], eax
je 0x401a2c
call fcn.0040186f
jmp 0x401a2e
xor eax, eax
cmp eax, edi
jne 0x401a49
cmp dword [0x40538c], edi
je 0x401abf
cmp dword [0x405390], 0
je 0x401abf
xor edi, edi
xor eax, eax
cmp dword [ebp + 0x14], edi
push edi
sete al
push 0x80
xor ebx, ebx
inc ebx
lea eax, [eax + eax + 2]
push eax
push edi
push ebx
push 0x40000000
lea eax, [ebp - 0x114]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
je 0x401aaf
cmp dword [ebp + 0x14], edi
mov dword [ebp - 0xc], ebx
jne 0x401a8d
push 2
push edi
push edi
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push edi
lea eax, [ebp - 0x10]
push eax
push dword [0x405390]
push dword [0x40538c]
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
mov dword [ebp - 4], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp word [ebp + 8], di
je 0x401aba
call fcn.004018b4
cmp dword [ebp - 4], edi
jne 0x401af0
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp dword [ebp - 0xc], 0
mov esi, eax
je 0x401ada
lea eax, [ebp - 0x114]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
cmp dword [ebp - 8], 0
je 0x401ae9
push dword [ebp + 0x10]
call dword [sym.imp.KERNEL32.dll_RemoveDirectoryA]
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [ebp - 4]
pop edi
pop esi
pop ebx
leave
ret