Function at 0x406435
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x4240
call fcn.0040dcd0
mov eax, dword [0x452024]
xor eax, ebp
mov dword [ebp - 4], eax
cmp dword [ebp + 0x14], 3
mov eax, dword [ebp + 0xc]
push ebx
push esi
push edi
mov edi, ecx
mov dword [ebp - 0x4240], edi
mov dword [ebp - 0x423c], eax
je 0x406484
cmp dword [ebp + 0x14], 2
je 0x40651d
cmp dword [ebp + 0x14], 1
je 0x40651d
mov eax, 0x10000
jmp 0x40673b
mov eax, dword [edi + 4]
mov esi, dword [ebp + 8]
cmp esi, eax
je 0x4064e1
cmp eax, 0xffffffff
je 0x40649a
mov ebx, dword [edi]
call fcn.00405dc3
mov eax, dword [edi]
or dword [edi + 4], 0xffffffff
cmp esi, dword [eax + 4]
jge 0x40647a
cmp esi, dword [eax + 0x10]
jge 0x4064b4
mov esi, eax
call fcn.004057f9
mov esi, dword [ebp + 8]
mov eax, dword [edi]
cmp dword [eax + 0x10], esi
jge 0x4064cc
mov esi, dword [edi]
call fcn.0040582b
mov eax, dword [edi]
mov ecx, dword [ebp + 8]
cmp dword [eax + 0x10], ecx
jl 0x4064bb
mov edi, dword [edi]
call fcn.00405b75
mov ecx, dword [ebp - 0x4240]
mov eax, dword [ebp + 8]
mov dword [ecx + 4], eax
mov edi, ecx
push dword [ebp - 0x423c]
mov ecx, dword [ebp + 0x10]
mov eax, dword [edi]
call fcn.00405c62
mov esi, eax
pop ecx
test esi, esi
jle 0x406502
mov eax, 0x600
jmp 0x40673b
mov ebx, dword [edi]
call fcn.00405dc3
or dword [edi + 4], 0xffffffff
mov eax, esi
neg eax
sbb eax, eax
and eax, 0x5000000
jmp 0x40673b
cmp dword [edi + 4], 0xffffffff
je 0x40652a
mov ebx, dword [edi]
call fcn.00405dc3
mov eax, dword [edi]
mov ebx, dword [ebp + 8]
or dword [edi + 4], 0xffffffff
cmp ebx, dword [eax + 4]
jge 0x40647a
cmp ebx, dword [eax + 0x10]
jge 0x406551
mov esi, eax
call fcn.004057f9
jmp 0x406551
mov esi, dword [edi]
call fcn.0040582b
mov eax, dword [edi]
cmp dword [eax + 0x10], ebx
jl 0x40654a
push ebx
lea edx, [ebp - 0x4234]
mov ecx, edi
call fcn.00405f45
test byte [ebp - 0x412c], 0x10
je 0x406593
cmp dword [ebp + 0x14], 1
jne 0x40657c
xor eax, eax
jmp 0x40673b
lea eax, [ebp - 0x4230]
push eax
add edi, 0x138
push edi
call fcn.00406379
pop ecx
pop ecx
jmp 0x406575
cmp dword [ebp + 0x14], 1
jne 0x4065a4
mov ebx, dword [ebp - 0x423c]
jmp 0x406682
mov esi, dword [ebp - 0x423c]
mov cl, byte [esi]
mov eax, esi
mov edx, esi
test cl, cl
je 0x406662
cmp cl, 0x2f
je 0x4065c2
cmp cl, 0x5c
jne 0x4065c5
lea eax, [edx + 1]
inc edx
mov cl, byte [edx]
test cl, cl
jne 0x4065b8
cmp eax, esi
je 0x406662
mov ecx, esi
lea esi, [ebp - 0x108]
sub esi, ecx
mov dl, byte [ecx]
mov byte [esi + ecx], dl
inc ecx
test dl, dl
jne 0x4065de
sub eax, dword [ebp - 0x423c]
mov byte [ebp + eax - 0x109], dl
cmp byte [ebp - 0x108], 0x2f
je 0x406614
cmp byte [ebp - 0x108], 0x5c
je 0x406614
cmp byte [ebp - 0x107], 0x3a
je 0x406614
xor bl, bl
jmp 0x406616
mov bl, 1
lea eax, [ebp - 0x108]
push 0x44c3dc
push eax
call fcn.00407743
mov esi, eax
lea eax, [ebp - 0x108]
push 0x44c3e0
push eax
call fcn.00407743
add esp, 0x10
test eax, eax
setne al
test esi, esi
setne cl
or al, cl
or al, bl
jne 0x406662
lea eax, [ebp - 0x108]
push eax
lea eax, [edi + 0x138]
push eax
call fcn.00406379
pop ecx
pop ecx
xor eax, eax
push eax
push dword [ebp - 0x412c]
push 2
push eax
push eax
push 0x40000000
push dword [ebp - 0x423c]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x406691
mov eax, 0x200
jmp 0x40673b
mov edi, dword [edi]
call fcn.00405b75
mov edi, dword [ebp - 0x4240]
mov byte [ebp - 0x4235], 0
mov esi, 0x4000
jmp 0x4066ca
je 0x4066e6
push 0
lea ecx, [ebp - 0x4240]
push ecx
push eax
lea eax, [ebp - 0x4108]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4066df
lea eax, [ebp - 0x4108]
push eax
mov eax, dword [edi]
mov ecx, esi
call fcn.00405c62
pop ecx
test eax, eax
jns 0x4066ac
mov byte [ebp - 0x4235], 1
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 1
jne 0x406717
cmp byte [ebp - 0x4235], 0
jne 0x406717
lea eax, [ebp - 0x4118]
push eax
lea eax, [ebp - 0x4128]
push eax
lea eax, [ebp - 0x4120]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_SetFileTime]
cmp dword [ebp + 0x14], 1
je 0x406724
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ebx, dword [edi]
call fcn.00405dc3
movzx eax, byte [ebp - 0x4235]
neg eax
sbb eax, eax
and eax, 0x400
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004068c3
leave
ret 0x10