Function at 0x4035d3
Capabilities:
Check if file exists
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x410f02
mov eax, dword fs:[0]
push eax
sub esp, 0x690
mov eax, dword [0x418030]
xor eax, esp
mov dword [esp + 0x688], eax
push ebx
push esi
push edi
mov eax, dword [0x418030]
xor eax, esp
push eax
lea eax, [esp + 0x6a0]
mov dword fs:[0], eax
mov eax, dword [ebp + 0xc]
push eax
lea eax, [esp + 0x288]
mov edi, ecx
push 0x413dc8
push eax
mov dword [esp + 0x48], edi
call fcn.00403989
xor ebx, ebx
xor esi, esi
add esp, 0xc
cmp dword [ebp + 8], 0x1e
mov dword [esp + 0x38], eax
mov dword [esp + 0x28], esi
mov dword [esp + 0x24], ebx
mov dword [esp + 0x20], edi
jbe 0x40393b
jmp 0x403656
mov edi, dword [esp + 0x20]
push dword [edi]
call fcn.0040348b
pop ecx
test eax, eax
je 0x40393b
movzx ecx, word [edi + 0x1a]
movzx eax, word [edi + 0x1c]
add eax, ecx
mov ecx, dword [edi + 0x12]
lea eax, [eax + ecx + 0x1e]
mov ecx, dword [ebp + 8]
sub ecx, esi
cmp eax, ecx
mov dword [esp + 0x34], eax
jg 0x40393b
mov eax, dword [edi + 0x16]
or dword [esp + 0x18], 0xffffffff
or dword [esp + 0x1c], 0xffffffff
mov dword [esp + 0x14], ebx
mov dword [esp + 0x30], ebx
cmp eax, 0x100000
jbe 0x403745
xor eax, eax
push 0x206
mov word [esp + 0x490], ax
lea eax, [esp + 0x492]
push ebx
push eax
call fcn.00407350
add esp, 0xc
lea esi, [esp + 0x48c]
call fcn.004034d5
push ebx
push 0x4000100
push 2
push ebx
push ebx
push 0x10000000
mov eax, esi
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [esp + 0x18], eax
cmp eax, 0xffffffff
je 0x4038fb
push ebx
push ebx
push dword [edi + 0x16]
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push dword [esp + 0x18]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push ebx
push ebx
push ebx
push 4
push ebx
push dword [esp + 0x2c]
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov dword [esp + 0x1c], eax
cmp eax, 0xffffffff
je 0x4038fb
push ebx
push ebx
push ebx
push 0xf001f
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [esp + 0x30], 1
jmp 0x40374c
push eax
call fcn.00405d5a
pop ecx
mov dword [esp + 0x14], eax
cmp eax, ebx
je 0x4038e9
mov ecx, dword [edi + 0x12]
mov eax, dword [esp + 0x34]
mov edx, dword [edi + 0x16]
sub eax, ecx
add eax, edi
mov dword [esp + 0x2c], ebx
cmp ecx, edx
je 0x40378f
mov ebx, dword [esp + 0x14]
lea esi, [esp + 0x2c]
push esi
push ecx
push eax
mov edi, edx
call fcn.00405778
mov esi, dword [esp + 0x38]
mov edi, dword [esp + 0x2c]
add esp, 0xc
xor ebx, ebx
jmp 0x4037a1
mov esi, dword [edi + 0xe]
push ecx
push eax
push edx
push dword [esp + 0x20]
call fcn.00405e65
add esp, 0x10
cmp dword [edi + 0xe], esi
jne 0x4038e9
movzx eax, word [edi + 0x1a]
push eax
lea eax, [edi + 0x1e]
push eax
lea esi, [esp + 0x68]
call fcn.00403963
mov dword [esp + 0x6a8], ebx
xor eax, eax
mov dword [esp + 0x5c], 7
mov dword [esp + 0x58], ebx
mov word [esp + 0x48], ax
lea eax, [esp + 0x44]
push eax
mov eax, esi
mov byte [esp + 0x6ac], 1
call fcn.004058a4
cmp dword [esp + 0x60], 8
mov eax, dword [esp + 0x4c]
pop ecx
jae 0x4037fa
lea eax, [esp + 0x48]
push eax
mov eax, dword [esp + 0x3c]
mov esi, 0x104
mov ecx, esi
sub ecx, eax
push 0x413dd0
push ecx
lea eax, [esp + eax*2 + 0x290]
push eax
call fcn.00405e47
lea edx, [esp + 0x294]
call fcn.004034a9
xor eax, eax
push 0x206
mov word [esp + 0x90], ax
lea eax, [esp + 0x92]
push ebx
push eax
call fcn.00407350
add esp, 0x1c
lea eax, [esp + 0x284]
push eax
lea eax, [esp + 0x80]
push esi
push eax
call fcn.004064fe
add esp, 0xc
lea eax, [esp + 0x7c]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
lea eax, [esp + 0x7c]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x403886
lea eax, [esp + 0x7c]
push eax
push ebx
call dword [sym.imp.SHELL32.dll_SHCreateDirectory]
push ebx
push 0x80
push 2
push ebx
push ebx
push 0x40000000
lea eax, [esp + 0x29c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x4038c5
push ebx
lea eax, [esp + 0x44]
push eax
push dword [edi + 0x16]
push dword [esp + 0x20]
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
inc dword [esp + 0x24]
push ebx
push 1
lea esi, [esp + 0x4c]
call fcn.004012b1
or dword [esp + 0x6a8], 0xffffffff
push ebx
push 1
lea ecx, [esp + 0x68]
call fcn.00403336
cmp dword [esp + 0x30], ebx
je 0x4038fb
push dword [esp + 0x14]
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
jmp 0x403905
push dword [esp + 0x14]
call fcn.00406250
pop ecx
push dword [esp + 0x1c]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
push dword [esp + 0x18]
call esi
mov esi, dword [esp + 0x28]
add esi, dword [esp + 0x34]
mov eax, dword [esp + 0x3c]
add eax, esi
mov dword [esp + 0x20], eax
mov eax, dword [ebp + 8]
sub eax, esi
mov dword [esp + 0x28], esi
cmp eax, 0x1e
ja 0x403652
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x6a0]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x688]
xor ecx, esp
call fcn.00405d65
mov esp, ebp
pop ebp
ret