Function at 0x406690
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
push 1
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.KERNEL32.dll_IsBadReadPtr]
test eax, eax
jne 0x4066af
mov ecx, dword [ebp + 8]
cmp dword [ecx + 0x24], 0xffffffff
jne 0x4066b9
mov eax, 9
jmp 0x40693e
mov edx, dword [ebp + 8]
mov dword [edx + 8], 0
mov eax, dword [ebp + 0x14]
and eax, 1
je 0x40674a
mov ecx, dword [ebp + 8]
movzx edx, word [ecx + 0x58]
test edx, edx
jne 0x406700
mov eax, dword [ebp + 0x10]
push eax
mov ecx, dword [ebp + 8]
push ecx
call fcn.00406a70
add esp, 8
mov edx, dword [ebp + 8]
cmp dword [edx + 8], 0
je 0x4066f4
jmp 0x40692c
mov eax, 1
mov ecx, dword [ebp + 8]
mov word [ecx + 0x58], ax
mov edx, dword [ebp + 0x10]
mov eax, dword [edx + 0x20]
push eax
mov ecx, dword [ebp + 0xc]
push ecx
mov edx, dword [ebp + 8]
push edx
call fcn.00402450
add esp, 0xc
mov ecx, dword [ebp + 0x10]
mov dword [ecx + 0x20], eax
mov edx, dword [ebp + 8]
cmp dword [edx + 8], 0
jne 0x406732
mov eax, dword [ebp + 8]
cmp dword [eax + 0x8c], 0
jne 0x406740
xor ecx, ecx
mov edx, dword [ebp + 8]
mov word [edx + 0x58], cx
jmp 0x40692c
mov eax, 5
jmp 0x40693e
mov eax, dword [ebp + 0x10]
mov ecx, dword [eax + 4]
and ecx, 0x10
je 0x40679d
mov edx, dword [ebp + 0x14]
and edx, 2
je 0x406796
mov eax, dword [ebp + 0x14]
and eax, 0x80000000
je 0x40677a
push 1
mov ecx, dword [ebp + 0xc]
push ecx
call fcn.00406530
add esp, 8
mov dword [ebp + 0x14], eax
jmp 0x40678b
push 1
mov edx, dword [ebp + 0xc]
push edx
call fcn.00406400
add esp, 8
mov dword [ebp + 0x14], eax
cmp dword [ebp + 0x14], 0
jne 0x406796
jmp 0x40683a
xor eax, eax
jmp 0x40693e
cmp dword [ebp + 0x14], 4
jne 0x4067ae
mov eax, dword [ebp + 0xc]
mov dword [ebp - 4], eax
jmp 0x406834
mov ecx, dword [ebp + 0x14]
and ecx, 0x80000000
je 0x4067cc
push 0
mov edx, dword [ebp + 0xc]
push edx
call fcn.00406530
add esp, 8
mov dword [ebp - 8], eax
jmp 0x4067dd
push 0
mov eax, dword [ebp + 0xc]
push eax
call fcn.00406400
add esp, 8
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
jne 0x4067e5
jmp 0x40683a
mov ecx, dword [ebp + 0x14]
and ecx, 0x80000000
je 0x406813
push 0
mov edx, dword [ebp + 0x10]
mov eax, dword [edx + 4]
push eax
push 2
push 0
push 0
push 0x40000000
mov ecx, dword [ebp + 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 4], eax
jmp 0x406834
push 0
mov edx, dword [ebp + 0x10]
mov eax, dword [edx + 4]
push eax
push 2
push 0
push 0
push 0x40000000
mov ecx, dword [ebp + 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0xffffffff
jne 0x406849
mov edx, dword [ebp + 8]
mov dword [edx + 8], 1
jmp 0x40692c
mov eax, dword [ebp + 0x10]
push eax
mov ecx, dword [ebp + 8]
push ecx
call fcn.00406a70
add esp, 8
mov edx, dword [ebp + 8]
cmp dword [edx + 8], 0
jne 0x4068f4
mov eax, dword [ebp + 8]
cmp dword [eax + 0x34], 0
jne 0x406895
push 0x4000
push 0
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x34], eax
mov edx, dword [ebp + 8]
cmp dword [edx + 0x34], 0
jne 0x406895
mov eax, dword [ebp + 8]
mov dword [eax + 8], 2
mov ecx, dword [ebp + 8]
cmp dword [ecx + 8], 0
jne 0x4068f4
push 0x4000
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x34]
push eax
mov ecx, dword [ebp + 8]
push ecx
call fcn.00402450
add esp, 0xc
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jne 0x4068c1
jmp 0x4068f4
push 0
lea edx, [ebp - 0x10]
push edx
mov eax, dword [ebp - 0xc]
push eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x34]
push edx
mov eax, dword [ebp - 4]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4068e8
mov ecx, dword [ebp - 0x10]
cmp ecx, dword [ebp - 0xc]
je 0x4068f2
mov edx, dword [ebp + 8]
mov dword [edx + 8], 3
jmp 0x406895
mov eax, dword [ebp + 8]
cmp dword [eax + 8], 0
jne 0x40691c
mov ecx, dword [ebp + 0x10]
add ecx, 0x18
push ecx
mov edx, dword [ebp + 0x10]
add edx, 8
push edx
mov eax, dword [ebp + 0x10]
add eax, 0x10
push eax
mov ecx, dword [ebp - 4]
push ecx
call dword [sym.imp.KERNEL32.dll_SetFileTime]
cmp dword [ebp + 0x14], 4
je 0x40692c
mov edx, dword [ebp - 4]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp + 8]
push eax
call fcn.00406950
add esp, 4
mov ecx, dword [ebp + 8]
mov eax, dword [ecx + 8]
mov esp, ebp
pop ebp
ret