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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x410d02
mov eax, dword fs:[0]
push eax
sub esp, 0x690
mov eax, dword [0x417030]
xor eax, esp
mov dword [esp + 0x688], eax
push ebx
push esi
push edi
mov eax, dword [0x417030]
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 0x412dc0
push eax
mov dword [esp + 0x48], edi
call fcn.0040378d
xor ebx, ebx
xor ecx, ecx
add esp, 0xc
cmp dword [ebp + 8], 0x1e
mov dword [esp + 0x38], eax
mov dword [esp + 0x28], ecx
mov dword [esp + 0x24], ebx
mov dword [esp + 0x14], edi
jbe 0x403765
jmp 0x403435
mov edi, dword [esp + 0x14]
mov eax, dword [edi]
cmp eax, 0x15145c61
je 0x403449
cmp eax, 0x4034b50
jne 0x403765
movzx edx, word [edi + 0x1a]
movzx eax, word [edi + 0x1c]
add eax, edx
mov edx, dword [edi + 0x12]
lea eax, [eax + edx + 0x1e]
mov edx, dword [ebp + 8]
sub edx, ecx
cmp eax, edx
mov dword [esp + 0x34], eax
jg 0x403765
mov eax, dword [edi + 0x16]
or dword [esp + 0x1c], 0xffffffff
or dword [esp + 0x20], 0xffffffff
mov dword [esp + 0x18], ebx
mov dword [esp + 0x30], ebx
cmp eax, 0x100000
jbe 0x403528
xor eax, eax
push 0x206
mov word [esp + 0x490], ax
lea eax, [esp + 0x492]
push ebx
push eax
call fcn.00407150
add esp, 0xc
lea esi, [esp + 0x48c]
call fcn.004032b4
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 + 0x1c], eax
cmp eax, 0xffffffff
je 0x403725
push ebx
push ebx
push dword [edi + 0x16]
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push dword [esp + 0x1c]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push ebx
push ebx
push ebx
push 4
push ebx
push dword [esp + 0x30]
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov dword [esp + 0x20], eax
cmp eax, 0xffffffff
je 0x403725
push ebx
push ebx
push ebx
push 0xf001f
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [esp + 0x30], 1
jmp 0x40352f
push eax
call fcn.00405b5e
pop ecx
mov dword [esp + 0x18], eax
cmp eax, ebx
je 0x403713
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 0x403572
mov ebx, dword [esp + 0x18]
lea esi, [esp + 0x2c]
push esi
push ecx
push eax
mov edi, edx
call fcn.0040557c
mov esi, dword [esp + 0x38]
mov edi, dword [esp + 0x20]
add esp, 0xc
xor ebx, ebx
jmp 0x403584
mov esi, dword [edi + 0xe]
push ecx
push eax
push edx
push dword [esp + 0x24]
call fcn.00405c69
add esp, 0x10
cmp dword [edi + 0xe], esi
jne 0x403713
movzx esi, word [edi + 0x1a]
push ebx
lea ecx, [esp + 0x64]
mov dword [esp + 0x7c], 0xf
call fcn.004031aa
push esi
lea eax, [edi + 0x1e]
push eax
lea ecx, [esp + 0x68]
call fcn.00402d50
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
lea eax, [esp + 0x64]
mov byte [esp + 0x6ac], 1
call fcn.004056a8
cmp dword [esp + 0x60], 8
mov eax, dword [esp + 0x4c]
pop ecx
jae 0x4035f1
lea eax, [esp + 0x48]
push eax
mov eax, dword [esp + 0x3c]
mov esi, 0x104
mov ecx, esi
sub ecx, eax
push 0x412dc8
push ecx
lea eax, [esp + eax*2 + 0x290]
push eax
call fcn.00405c4b
lea eax, [esp + 0x294]
add esp, 0x10
test eax, eax
je 0x403651
mov dword [esp + 0x14], ebx
mov eax, dword [esp + 0x14]
lea eax, [esp + eax*2 + 0x284]
movzx ecx, word [eax]
xor edx, edx
cmp dx, cx
je 0x403651
push 0x2f
pop edx
cmp dx, cx
jne 0x403647
push 0x5c
pop ecx
mov word [eax], cx
inc dword [esp + 0x14]
cmp dword [esp + 0x14], esi
jl 0x403624
xor eax, eax
push 0x206
mov word [esp + 0x80], ax
lea eax, [esp + 0x82]
push ebx
push eax
call fcn.00407150
add esp, 0xc
lea eax, [esp + 0x284]
push eax
lea eax, [esp + 0x80]
push esi
push eax
call fcn.00406302
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 0x4036b0
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 0x4036ef
push ebx
lea eax, [esp + 0x44]
push eax
push dword [edi + 0x16]
push dword [esp + 0x24]
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.004012e9
or dword [esp + 0x6a8], 0xffffffff
push ebx
push 1
lea ecx, [esp + 0x68]
call fcn.0040315f
cmp dword [esp + 0x30], ebx
je 0x403725
push dword [esp + 0x18]
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
jmp 0x40372f
push dword [esp + 0x18]
call fcn.00406054
pop ecx
push dword [esp + 0x20]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
push dword [esp + 0x1c]
call esi
mov ecx, dword [esp + 0x28]
add ecx, dword [esp + 0x34]
mov eax, dword [esp + 0x3c]
add eax, ecx
mov dword [esp + 0x14], eax
mov eax, dword [ebp + 8]
sub eax, ecx
mov dword [esp + 0x28], ecx
cmp eax, 0x1e
ja 0x403431
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.00405b69
mov esp, ebp
pop ebp
ret