Function at 0x401811
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 0x4018a2
push dword [ebp + 0x10]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x40186d
push esi
push dword [ebp + 0x10]
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
test eax, eax
jne 0x401866
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x4019ef
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 0x4018a2
mov byte [ebp + esi - 0x114], 0x5c
inc esi
mov byte [ebp + esi - 0x114], 0
cmp dword [ebp + 0xc], 0xffff
jbe 0x4018cd
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 0x401938
movzx eax, word [ebp + 0xc]
push 0xa
push eax
push 0
call dword [sym.imp.KERNEL32.dll_FindResourceA]
test eax, eax
mov dword [0x406394], eax
je 0x4018ec
call fcn.0040179f
jmp 0x4018ee
xor eax, eax
test eax, eax
je 0x4019ef
mov eax, dword [0x4063a0]
mov ecx, 0x103
sub ecx, esi
cmp ecx, eax
jae 0x40190d
mov eax, ecx
mov dword [0x4063a0], eax
xor edi, edi
xor ecx, ecx
cmp eax, edi
jbe 0x40192b
mov edx, dword [0x40639c]
mov dl, byte [edx + ecx]
mov byte [ebp + esi - 0x114], dl
inc esi
inc ecx
cmp ecx, eax
jb 0x401915
mov byte [ebp + esi - 0x114], 0
call fcn.004017e4
cmp word [ebp + 8], di
je 0x401962
movzx eax, word [ebp + 8]
push 0xa
push eax
push edi
call dword [sym.imp.KERNEL32.dll_FindResourceA]
cmp eax, edi
mov dword [0x406394], eax
je 0x40195c
call fcn.0040179f
jmp 0x40195e
xor eax, eax
cmp eax, edi
jne 0x401979
cmp dword [0x40639c], edi
je 0x4019ef
cmp dword [0x4063a0], 0
je 0x4019ef
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 0x4019df
cmp dword [ebp + 0x14], edi
mov dword [ebp - 0xc], ebx
jne 0x4019bd
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 [0x4063a0]
push dword [0x40639c]
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 0x4019ea
call fcn.004017e4
cmp dword [ebp - 4], edi
jne 0x401a20
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp dword [ebp - 0xc], 0
mov esi, eax
je 0x401a0a
lea eax, [ebp - 0x114]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
cmp dword [ebp - 8], 0
je 0x401a19
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