Function at 0x406cf0
Capabilities:
Check if file exists
Get file attributes
Set file attributes
Write file on windows

Disassembly:
sub esp, 0x354
mov eax, dword [0x40d020]
xor eax, esp
mov dword [esp + 0x350], eax
push ebx
push ebp
mov ebp, dword [esp + 0x364]
push esi
push edi
mov edi, ecx
or esi, 0xffffffff
cmp dword [edi + 4], esi
je 0x406d20
mov ebx, dword [edi]
call fcn.004064c0
mov ebx, dword [esp + 0x368]
mov dword [edi + 4], esi
mov esi, dword [edi]
cmp ebx, dword [esi + 4]
jl 0x406d3b
mov eax, 0x10000
jmp 0x40700d
cmp ebx, dword [esi + 0x10]
jge 0x406d45
call fcn.00405e00
mov eax, dword [edi]
cmp dword [eax + 0x10], ebx
jge 0x406da1
lea esp, [esp]
mov esi, dword [edi]
test esi, esi
je 0x406d9a
cmp dword [esi + 0x18], 0
je 0x406d9a
mov eax, dword [esi + 0x10]
add eax, 1
cmp eax, dword [esi + 4]
je 0x406d9a
mov ecx, dword [esi + 0x50]
add ecx, dword [esi + 0x4c]
mov edx, dword [esi + 0x48]
push 0
lea ecx, [ecx + edx + 0x2e]
add dword [esi + 0x14], ecx
mov dword [esi + 0x10], eax
push 0
lea edx, [esi + 0x78]
push edx
lea eax, [esi + 0x28]
push eax
mov eax, esi
call fcn.004059b0
add esp, 0x10
neg eax
sbb eax, eax
add eax, 1
mov dword [esi + 0x18], eax
mov ecx, dword [edi]
cmp dword [ecx + 0x10], ebx
jl 0x406d50
lea edx, [esp + 0x1c]
push edx
push ebx
mov ecx, edi
call fcn.00406650
test byte [esp + 0x124], 0x10
mov al, byte [ebp]
je 0x406df6
cmp al, 0x2f
je 0x406dcd
cmp al, 0x5c
je 0x406dcd
test al, al
je 0x406ddf
cmp byte [ebp + 1], 0x3a
jne 0x406ddf
push ebp
push 0
call fcn.00406bd0
add esp, 8
xor eax, eax
jmp 0x40700d
push ebp
add edi, 0x140
push edi
call fcn.00406bd0
add esp, 8
xor eax, eax
jmp 0x40700d
test al, al
mov ebx, ebp
mov ecx, ebp
je 0x406e15
mov edi, edi
cmp al, 0x2f
je 0x406e08
cmp al, 0x5c
jne 0x406e0b
lea ebx, [ecx + 1]
mov al, byte [ecx + 1]
add ecx, 1
test al, al
jne 0x406e00
lea edx, [esp + 0x14c]
mov eax, ebp
sub edx, ebp
mov cl, byte [eax]
mov byte [edx + eax], cl
add eax, 1
test cl, cl
jne 0x406e20
cmp ebx, ebp
jne 0x406ed6
mov byte [esp + 0x14c], cl
push ebx
lea ecx, [esp + 0x150]
push ecx
lea esi, [edi + 0x140]
push esi
lea edx, [esp + 0x260]
push str._s_s_s
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x14
lea eax, [esp + 0x14c]
push eax
push esi
call fcn.00406bd0
add esp, 8
lea ecx, [esp + 0x254]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
and eax, 0xfffffffa
push eax
lea edx, [esp + 0x258]
push edx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
mov eax, dword [esp + 0x124]
push 0
and eax, 0xfffffffa
push eax
push 2
push 0
push 0
mov dword [esp + 0x138], eax
push 0x40000000
lea eax, [esp + 0x26c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp ebx, 0xffffffff
jne 0x406f3a
mov eax, 0x200
jmp 0x40700d
mov eax, ebx
sub eax, ebp
mov byte [esp + eax + 0x14c], 0
mov al, byte [esp + 0x14c]
cmp al, 0x2f
je 0x406f07
cmp al, 0x5c
je 0x406f07
test al, al
je 0x406e3b
cmp byte [esp + 0x14d], 0x3a
jne 0x406e3b
push ebx
lea ecx, [esp + 0x150]
push ecx
lea edx, [esp + 0x25c]
push str._s_s
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
lea eax, [esp + 0x15c]
push eax
push 0
call fcn.00406bd0
add esp, 0x18
jmp 0x406e72
mov ecx, dword [edi + 0x138]
mov eax, dword [edi]
push ecx
call fcn.004060d0
add esp, 4
cmp dword [edi + 0x13c], 0
jne 0x406f67
push 0x4000
call fcn.0040775e
add esp, 4
mov dword [edi + 0x13c], eax
mov ebp, dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [esp + 0x14], 0
mov eax, dword [edi + 0x13c]
lea edx, [esp + 0x13]
push edx
push eax
mov eax, dword [edi]
mov ecx, 0x4000
call fcn.00406250
mov esi, eax
add esp, 8
cmp esi, 0xffffff96
je 0x406fc8
test esi, esi
jl 0x406fbe
jle 0x406fb3
mov edx, dword [edi + 0x13c]
push 0
lea ecx, [esp + 0x1c]
push ecx
push esi
push edx
push ebx
call ebp
test eax, eax
je 0x406fd2
cmp byte [esp + 0x13], 0
jne 0x406fdc
test esi, esi
jne 0x406f75
mov dword [esp + 0x14], 0x5000000
jmp 0x406ffb
mov dword [esp + 0x14], 0x1000
jmp 0x406ffb
mov dword [esp + 0x14], 0x400
jmp 0x406ffb
lea eax, [esp + 0x138]
push eax
lea ecx, [esp + 0x12c]
push ecx
lea edx, [esp + 0x138]
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_SetFileTime]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ebx, dword [edi]
call fcn.004064c0
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x360]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00407648
add esp, 0x354
ret 8