Function at 0x409126
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x64c
push ebx
push esi
push edi
mov edi, ecx
cmp dword [edi + 4], 0xffffffff
je 0x409141
mov ecx, dword [edi]
call fcn.00408a8b
mov ecx, dword [edi]
mov esi, dword [ebp + 8]
or dword [edi + 4], 0xffffffff
cmp esi, dword [ecx + 4]
jl 0x409159
mov eax, 0x10000
jmp 0x409375
cmp esi, dword [ecx + 0x10]
jge 0x40916c
call fcn.004084cd
jmp 0x40916c
mov ecx, dword [edi]
call fcn.00408504
mov eax, dword [edi]
cmp dword [eax + 0x10], esi
jl 0x409165
lea eax, [ebp - 0x440]
push eax
push esi
mov ecx, edi
call fcn.00408b93
test byte [ebp - 0x234], 0x10
je 0x4091bd
mov edx, dword [ebp + 0xc]
movzx eax, word [edx]
cmp eax, 0x2f
je 0x4091af
cmp eax, 0x5c
je 0x4091af
test ax, ax
je 0x4091a7
cmp word [edx + 2], 0x3a
je 0x4091af
lea ecx, [edi + 0x244]
jmp 0x4091b1
xor ecx, ecx
call fcn.00409054
xor eax, eax
jmp 0x409375
mov esi, dword [ebp + 0xc]
push 0x5c
movzx eax, word [esi]
mov ebx, esi
mov ecx, esi
mov dword [ebp + 0xc], 0x2f
pop edx
jmp 0x4091e7
cmp ax, word [ebp + 0xc]
je 0x4091de
cmp ax, dx
jne 0x4091e1
lea ebx, [ecx + 2]
add ecx, 2
movzx eax, word [ecx]
test ax, ax
jne 0x4091d3
push esi
lea eax, [ebp - 0x210]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
cmp ebx, esi
jne 0x409209
xor eax, eax
mov word [ebp - 0x210], ax
jmp 0x40923f
mov eax, ebx
sub eax, esi
sar eax, 1
xor ecx, ecx
mov word [ebp + eax*2 - 0x210], cx
mov ax, word [ebp - 0x210]
push 0x2f
pop ecx
cmp ax, cx
je 0x409267
push 0x5c
pop ecx
cmp ax, cx
je 0x409267
test ax, ax
je 0x40923f
cmp word [ebp - 0x20e], 0x3a
je 0x409267
push ebx
lea eax, [ebp - 0x210]
push eax
lea esi, [edi + 0x244]
push esi
lea eax, [ebp - 0x648]
push str._s_s_s
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x14
mov ecx, esi
jmp 0x409286
push ebx
lea eax, [ebp - 0x210]
push eax
lea eax, [ebp - 0x648]
push str._s_s
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x10
xor ecx, ecx
lea edx, [ebp - 0x210]
call fcn.00409054
xor esi, esi
push esi
push dword [ebp - 0x234]
lea eax, [ebp - 0x648]
push 2
push esi
push esi
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp + 8], eax
cmp eax, 0xffffffff
jne 0x4092c2
mov eax, 0x200
jmp 0x409375
mov edx, dword [edi + 0x23c]
mov ecx, dword [edi]
call fcn.004086e8
cmp dword [edi + 0x240], esi
jne 0x4092e8
push 0x4000
call fcn.0040b2da
pop ecx
mov dword [edi + 0x240], eax
mov edx, dword [edi + 0x240]
mov ecx, dword [edi]
lea eax, [ebp + 0xf]
push eax
push 0x4000
call fcn.00408836
mov ebx, eax
pop ecx
pop ecx
cmp ebx, 0xffffff96
je 0x40935e
test ebx, ebx
js 0x409330
jle 0x409326
push esi
lea eax, [ebp - 4]
push eax
push ebx
push dword [edi + 0x240]
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x409337
cmp byte [ebp + 0xf], 0
jne 0x40933e
test ebx, ebx
jne 0x4092e8
mov esi, 0x5000000
jmp 0x409363
mov esi, 0x400
jmp 0x409363
lea eax, [ebp - 0x220]
push eax
lea eax, [ebp - 0x230]
push eax
lea eax, [ebp - 0x228]
push eax
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_SetFileTime]
jmp 0x409363
mov esi, 0x1000
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [edi]
call fcn.00408a8b
mov eax, esi
pop edi
pop esi
pop ebx
leave
ret 0x10