Function at 0x407951
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x660
mov eax, dword [0x42a1d4]
xor eax, ebp
mov dword [ebp - 8], eax
mov eax, dword [ebp + 8]
push ebx
mov ebx, ecx
cmp dword [ebx + 4], 0xffffffff
push esi
push edi
mov dword [ebp - 0x650], ebx
mov dword [ebp - 0x658], eax
je 0x407985
mov edi, dword [ebx]
call fcn.004071b4
mov esi, dword [ebx]
or dword [ebx + 4], 0xffffffff
xor edi, edi
cmp dword [esi + 4], edi
jg 0x40799c
mov eax, 0x10000
jmp 0x407c11
cmp dword [esi + 0x10], edi
jle 0x4079af
call fcn.00406be5
jmp 0x4079af
mov esi, dword [ebx]
call fcn.00406c1a
mov eax, dword [ebx]
cmp dword [eax + 0x10], edi
jl 0x4079a8
push edi
mov edi, dword [ebp - 0x650]
lea ebx, [ebp - 0x64c]
mov ecx, edi
call fcn.00407294
mov eax, dword [ebp - 0x440]
shr eax, 4
test al, 1
je 0x407a13
mov ecx, dword [ebp - 0x658]
movzx eax, word [ecx]
cmp ax, 0x2f
je 0x4079f8
cmp ax, 0x5c
je 0x4079f8
test ax, ax
je 0x4079fd
cmp word [ecx + 2], 0x3a
jne 0x4079fd
push ecx
push 0
jmp 0x407a05
push ecx
add edi, 0x244
push edi
call fcn.004077f5
pop ecx
pop ecx
xor eax, eax
jmp 0x407c11
mov esi, dword [ebp - 0x658]
movzx eax, word [esi]
and word [ebp - 0x41c], 0
test ax, ax
mov ebx, esi
mov ecx, esi
je 0x407a49
movzx eax, ax
cmp ax, 0x2f
je 0x407a3c
cmp ax, 0x5c
jne 0x407a3f
lea ebx, [ecx + 2]
inc ecx
inc ecx
movzx eax, word [ecx]
test ax, ax
jne 0x407a30
push 0x104
lea eax, [ebp - 0x214]
push esi
push eax
call fcn.0041051b
add esp, 0xc
cmp ebx, esi
jne 0x407ad0
and word [ebp - 0x214], 0
push ebx
lea eax, [ebp - 0x214]
push eax
lea esi, [edi + 0x244]
push esi
lea eax, [ebp - 0x41c]
push str._s_s_s
push eax
call fcn.004019a2
add esp, 0x14
lea eax, [ebp - 0x214]
push eax
push esi
call fcn.004077f5
pop ecx
pop ecx
xor eax, eax
push eax
push dword [ebp - 0x440]
push 2
push eax
push eax
push 0x40000000
lea eax, [ebp - 0x41c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
mov dword [ebp - 0x658], eax
jne 0x407b3e
mov eax, 0x200
jmp 0x407c11
mov eax, ebx
sub eax, esi
sar eax, 1
and word [ebp + eax*2 - 0x214], 0
cmp word [ebp - 0x214], 0x2f
je 0x407b0f
cmp word [ebp - 0x214], 0x5c
je 0x407b0f
cmp word [ebp - 0x214], 0
je 0x407a6a
cmp word [ebp - 0x212], 0x3a
jne 0x407a6a
push ebx
lea eax, [ebp - 0x214]
push eax
lea eax, [ebp - 0x41c]
push str._s_s
push eax
call fcn.004019a2
lea eax, [ebp - 0x214]
push eax
push 0
call fcn.004077f5
add esp, 0x18
jmp 0x407a9c
push dword [edi + 0x23c]
mov ebx, dword [edi]
call fcn.00406e2e
cmp dword [edi + 0x240], 0
pop ecx
mov esi, 0x4000
jne 0x407b67
push esi
call fcn.0040fa93
pop ecx
mov dword [edi + 0x240], eax
and dword [ebp - 0x650], 0
lea eax, [ebp - 0x651]
push eax
push dword [edi + 0x240]
mov eax, dword [edi]
mov ecx, esi
call fcn.00406f82
mov ebx, eax
cmp ebx, 0xffffff96
pop ecx
pop ecx
je 0x407c22
test ebx, ebx
jl 0x407bc4
jle 0x407bb7
push 0
lea eax, [ebp - 0x65c]
push eax
push ebx
push dword [edi + 0x240]
push dword [ebp - 0x658]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x407c2e
cmp byte [ebp - 0x651], 0
jne 0x407bce
test ebx, ebx
jne 0x407b6e
mov dword [ebp - 0x650], 0x5000000
mov edi, dword [edi]
call fcn.004071b4
cmp dword [ebp - 0x650], 0
jne 0x407bff
lea eax, [ebp - 0x42c]
push eax
lea eax, [ebp - 0x43c]
push eax
lea eax, [ebp - 0x434]
push eax
push dword [ebp - 0x658]
call dword [sym.imp.KERNEL32.dll_SetFileTime]
push dword [ebp - 0x658]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x650]
mov ecx, dword [ebp - 8]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040f676
leave
ret 4
mov dword [ebp - 0x650], 0x1000
jmp 0x407bce
mov dword [ebp - 0x650], 0x400
jmp 0x407bce