Function at 0x40647f
Capabilities:
Write file on windows

Disassembly:
push ebp
lea ebp, [esp - 0x2c8]
sub esp, 0x348
mov eax, dword [0x5a71a0]
xor eax, ebp
mov dword [ebp + 0x2c4], eax
cmp dword [ebp + 0x2dc], 3
push ebx
mov ebx, dword [ebp + 0x2d4]
push esi
push edi
mov esi, ecx
je 0x4064d2
cmp dword [ebp + 0x2dc], 2
je 0x40657e
cmp dword [ebp + 0x2dc], 1
je 0x40657e
mov eax, 0x10000
jmp 0x4067eb
mov eax, dword [esi + 4]
mov edi, dword [ebp + 0x2d0]
cmp edi, eax
je 0x406524
cmp eax, 0xffffffff
je 0x4064ec
push dword [esi]
call fcn.004046d4
pop ecx
mov eax, dword [esi]
or dword [esi + 4], 0xffffffff
cmp edi, dword [eax + 4]
jge 0x4064c8
cmp edi, dword [eax + 0x10]
jge 0x40650c
push eax
call fcn.00404496
jmp 0x40650b
push dword [esi]
call fcn.004044d4
pop ecx
mov eax, dword [esi]
cmp dword [eax + 0x10], edi
jl 0x406504
push dword [esi + 0x138]
push eax
call fcn.00406039
pop ecx
pop ecx
mov dword [esi + 4], edi
lea eax, [ebp - 0x71]
push eax
push dword [ebp + 0x2d8]
push ebx
push dword [esi]
call fcn.00406198
mov edi, eax
add esp, 0x10
test edi, edi
jg 0x40654b
push dword [esi]
call fcn.004046d4
or dword [esi + 4], 0xffffffff
pop ecx
cmp byte [ebp - 0x71], 0
je 0x406558
xor eax, eax
jmp 0x4067eb
test edi, edi
jle 0x406566
mov eax, 0x600
jmp 0x4067eb
xor eax, eax
cmp edi, 0xffffff96
setne al
dec eax
and eax, 0xfb001000
add eax, 0x5000000
jmp 0x4067eb
cmp dword [esi + 4], 0xffffffff
je 0x40658c
push dword [esi]
call fcn.004046d4
pop ecx
mov eax, dword [esi]
mov edi, dword [ebp + 0x2d0]
or dword [esi + 4], 0xffffffff
cmp edi, dword [eax + 4]
jge 0x4064c8
cmp edi, dword [eax + 0x10]
jge 0x4065b6
push eax
call fcn.00404496
jmp 0x4065b5
push dword [esi]
call fcn.004044d4
pop ecx
mov eax, dword [esi]
cmp dword [eax + 0x10], edi
jl 0x4065ae
lea eax, [ebp - 0x70]
push eax
push edi
mov ecx, esi
call fcn.00404886
test byte [ebp + 0x98], 0x10
je 0x40660d
cmp dword [ebp + 0x2dc], 1
je 0x406551
mov al, byte [ebx]
cmp al, 0x2f
je 0x4065f3
cmp al, 0x5c
je 0x4065f3
test al, al
je 0x4065f8
cmp byte [ebx + 1], 0x3a
jne 0x4065f8
push ebx
push 0
jmp 0x406600
push ebx
add esi, 0x140
push esi
call fcn.00404d03
pop ecx
xor eax, eax
jmp 0x4067ea
cmp dword [ebp + 0x2dc], 1
jne 0x40661e
mov dword [ebp - 0x7c], ebx
jmp 0x4066a9
mov al, byte [ebx]
mov edi, ebx
mov ecx, ebx
jmp 0x406634
cmp al, 0x2f
je 0x40662e
cmp al, 0x5c
jne 0x406631
lea edi, [ecx + 1]
inc ecx
mov al, byte [ecx]
test al, al
jne 0x406626
lea edx, [ebp + 0x1c0]
mov eax, ebx
sub edx, ebx
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x406642
cmp edi, ebx
jne 0x4066b9
mov byte [ebp + 0x1c0], cl
push edi
lea eax, [ebp + 0x1c0]
push eax
lea ebx, [esi + 0x140]
push ebx
lea eax, [ebp + 0xbc]
push 0x55c080
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
lea eax, [ebp + 0x1c0]
push eax
push ebx
call fcn.00404d03
add esp, 0x1c
xor eax, eax
push eax
push dword [ebp + 0x98]
push 2
push eax
push eax
push 0x40000000
lea eax, [ebp + 0xbc]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x7c], eax
cmp dword [ebp - 0x7c], 0xffffffff
jne 0x406721
mov eax, 0x200
jmp 0x4067eb
mov eax, edi
sub eax, ebx
mov byte [ebp + eax + 0x1c0], 0
cmp byte [ebp + 0x1c0], 0x2f
je 0x4066f1
cmp byte [ebp + 0x1c0], 0x5c
je 0x4066f1
cmp byte [ebp + 0x1c0], 0
je 0x406656
cmp byte [ebp + 0x1c1], 0x3a
jne 0x406656
push edi
lea eax, [ebp + 0x1c0]
push eax
lea eax, [ebp + 0xbc]
push str._s_s
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
lea eax, [ebp + 0x1c0]
push eax
push 0
call fcn.00404d03
add esp, 0x18
jmp 0x406687
push dword [esi + 0x138]
push dword [esi]
call fcn.00406039
cmp dword [esi + 0x13c], 0
pop ecx
pop ecx
mov ebx, 0x4000
jne 0x40674b
push ebx
call fcn.004069ba
pop ecx
mov dword [esi + 0x13c], eax
and dword [ebp - 0x78], 0
lea eax, [ebp - 0x71]
push eax
push ebx
push dword [esi + 0x13c]
push dword [esi]
call fcn.00406198
mov edi, eax
add esp, 0x10
cmp edi, 0xffffff96
je 0x40679e
test edi, edi
jl 0x406795
jle 0x40678b
push 0
lea eax, [ebp - 0x80]
push eax
push edi
push dword [esi + 0x13c]
push dword [ebp - 0x7c]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4067a7
cmp byte [ebp - 0x71], 0
jne 0x4067b0
test edi, edi
jne 0x40674f
mov dword [ebp - 0x78], 0x5000000
jmp 0x4067ce
mov dword [ebp - 0x78], 0x1000
jmp 0x4067ce
mov dword [ebp - 0x78], 0x400
jmp 0x4067ce
lea eax, [ebp + 0xac]
push eax
lea eax, [ebp + 0x9c]
push eax
lea eax, [ebp + 0xa4]
push eax
push dword [ebp - 0x7c]
call dword [sym.imp.KERNEL32.dll_SetFileTime]
cmp dword [ebp + 0x2dc], 1
je 0x4067e0
push dword [ebp - 0x7c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [esi]
call fcn.004046d4
mov eax, dword [ebp - 0x78]
pop ecx
mov ecx, dword [ebp + 0x2c4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004fa21f
add ebp, 0x2c8
leave
ret 0x10