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

Disassembly:
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x40e2db
push eax
mov dword fs:[0], esp
sub esp, 0x220
push ebx
push esi
mov esi, ecx
xor ebx, ebx
cmp dword [esi + 0x30], ebx
jne 0x40c6a1
cmp dword [esi + 0xc], ebx
je 0x40c6a1
push edi
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x25]
mov byte [esp + 0x24], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [esp + 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
mov eax, dword [esp + 0x10]
mov edx, dword [esp + 0x14]
lea ecx, [esi + 0x34]
mov edi, dword [sym.imp.MSVCRT.dll_sprintf]
mov dword [ecx], eax
and eax, 0xffff
mov dword [ecx + 4], edx
mov edx, dword [esp + 0x18]
mov dword [ecx + 8], edx
mov edx, dword [esp + 0x1c]
mov dword [ecx + 0xc], edx
mov ecx, dword [esp + 0x16]
mov edx, dword [esp + 0x12]
and ecx, 0xffff
and edx, 0xffff
push ecx
push edx
push eax
mov eax, dword [0x413794]
lea edx, [esp + 0x30]
mov ecx, dword [eax + 0x1630]
add ecx, 0x43
push ecx
push str._c:JdvrFile_04d_02d_02d
push edx
call edi
add esp, 0x18
lea eax, [esp + 0x24]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x40c525
test al, 0x10
jne 0x40c59b
mov ecx, dword [0x413794]
push ebp
lea eax, [esp + 0x28]
mov edx, dword [ecx + 0x1630]
add edx, 0x43
push edx
push str._c:JdvrFile
push eax
call edi
mov ebp, dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
add esp, 0xc
lea ecx, [esp + 0x28]
push ebx
push ecx
call ebp
mov edx, dword [esp + 0x1a]
mov eax, dword [esp + 0x16]
mov ecx, dword [esp + 0x14]
and edx, 0xffff
push edx
mov edx, dword [0x413794]
and eax, 0xffff
and ecx, 0xffff
push eax
mov eax, dword [edx + 0x1630]
add eax, 0x43
push ecx
push eax
lea ecx, [esp + 0x38]
push str._c:JdvrFile_04d_02d_02d
push ecx
call edi
add esp, 0x18
lea edx, [esp + 0x28]
push ebx
push edx
call ebp
pop ebp
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x1a]
mov edx, dword [esp + 0x18]
and eax, 0xffff
push eax
mov eax, dword [esi + 0x18]
and ecx, 0xffff
and edx, 0xffff
push ecx
inc eax
push edx
lea ecx, [esp + 0x30]
push eax
push ecx
lea edx, [esp + 0x13c]
push str._s_02d_02d_02d_02d.801
push edx
call edi
add esp, 0x1c
lea eax, [esp + 0x128]
push ebx
push 0x80
push 2
push ebx
push 3
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ecx, dword [esi + 0x24]
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [esi + 0x30], eax
lea edx, [esp + 0x20]
mov dword [ecx + 0xcc], ebx
mov eax, dword [esi + 0x24]
mov ecx, dword [esi + 0x30]
push ebx
push edx
add eax, 0xc0
push 0x10
push eax
push ecx
mov dword [esp + 0x34], ebx
call edi
mov eax, dword [esi + 0x24]
mov ecx, dword [esi + 0x30]
lea edx, [esp + 0x20]
push ebx
push edx
add eax, 0xc0
push 0x10
push eax
push ecx
call edi
lea ecx, [esp + 0xc]
call fcn.0040d2da
mov edx, dword [esi + 0x18]
lea eax, [esp + 0xc]
inc edx
mov dword [esp + 0x234], ebx
push edx
push 0x804a
push eax
mov dword [esi + 0x44], 1
call sub.MFC42.DLL_CString::Format_1
mov ecx, dword [esp + 0x18]
add esp, 0xc
push ecx
call fcn.00402fb0
mov edx, dword [esi + 0x18]
mov ecx, dword [esi + 0x2c]
shl edx, 5
add esp, 4
lea eax, [edx + ecx + 0x2d68]
push 1
push eax
call fcn.00408a70
lea ecx, [esp + 0xc]
mov dword [esp + 0x234], 0xffffffff
call sub.MFC42.DLL_CString::CString
pop edi
mov ecx, dword [esp + 0x228]
pop esi
pop ebx
mov dword fs:[0], ecx
add esp, 0x22c
ret