Function at 0x401777
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 0x401808
push dword [ebp + 0x10]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x4017d3
push esi
push dword [ebp + 0x10]
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
test eax, eax
jne 0x4017cc
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x401955
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 0x401808
mov byte [ebp + esi - 0x114], 0x5c
inc esi
mov byte [ebp + esi - 0x114], 0
cmp dword [ebp + 0xc], 0xffff
jbe 0x401833
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 0x40189e
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 0x401852
call fcn.00401705
jmp 0x401854
xor eax, eax
test eax, eax
je 0x401955
mov eax, dword [0x405390]
mov ecx, 0x103
sub ecx, esi
cmp ecx, eax
jae 0x401873
mov eax, ecx
mov dword [0x405390], eax
xor edi, edi
xor ecx, ecx
cmp eax, edi
jbe 0x401891
mov edx, dword [0x40538c]
mov dl, byte [edx + ecx]
mov byte [ebp + esi - 0x114], dl
inc esi
inc ecx
cmp ecx, eax
jb 0x40187b
mov byte [ebp + esi - 0x114], 0
call fcn.0040174a
cmp word [ebp + 8], di
je 0x4018c8
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 0x4018c2
call fcn.00401705
jmp 0x4018c4
xor eax, eax
cmp eax, edi
jne 0x4018df
cmp dword [0x40538c], edi
je 0x401955
cmp dword [0x405390], 0
je 0x401955
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 0x401945
cmp dword [ebp + 0x14], edi
mov dword [ebp - 0xc], ebx
jne 0x401923
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 0x401950
call fcn.0040174a
cmp dword [ebp - 4], edi
jne 0x401986
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp dword [ebp - 0xc], 0
mov esi, eax
je 0x401970
lea eax, [ebp - 0x114]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
cmp dword [ebp - 8], 0
je 0x40197f
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