Function at 0x406530
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xfffffffffffffffe
push 0x45b960
push 0x439ec0
mov eax, dword fs:[0]
push eax
sub esp, 0x53c
mov eax, dword [0x45f478]
xor dword [ebp - 8], eax
xor eax, ebp
mov dword [ebp - 0x1c], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0x10]
mov dword fs:[0], eax
mov dword [ebp - 0x18], esp
mov esi, dword [ebp + 8]
mov ebx, dword [ebp + 0xc]
mov dword [ebp - 0x538], ebx
mov edi, dword [ebp + 0x14]
mov dword [ebp - 0x52c], edi
mov eax, dword [ebp + 0x18]
mov dword [ebp - 0x54c], eax
mov eax, dword [ebp + 0x1c]
mov dword [ebp - 0x528], eax
mov eax, dword [ebp + 0x20]
mov dword [ebp - 0x534], eax
movzx eax, word [ebp + 0x24]
mov dword [ebp - 0x53c], eax
mov dword [ebp - 0x540], 0
mov dword [ebp - 0x544], 0
mov dword [ebp - 4], 0
lea eax, [ebp - 0x520]
push eax
call fcn.0040d3c0
add esp, 4
test ebx, ebx
jne 0x4065e3
test edi, edi
jne 0x4065e3
mov dword [ebp - 4], 0xfffffffe
mov al, 1
jmp 0x406a81
test esi, esi
jne 0x406604
push 0xe0000003
call dword [sym.imp.KERNEL32.dll_SetLastError]
push esi
push esi
push esi
push 0x60000001
mov edi, dword [sym.imp.KERNEL32.dll_RaiseException]
call edi
jmp 0x40660a
mov edi, dword [sym.imp.KERNEL32.dll_RaiseException]
cmp byte [ebp + 0x28], 0
je 0x406629
push 0
push esi
call fcn.00403060
add esp, 8
test eax, eax
jne 0x406629
push eax
push eax
push eax
push 0x60000000
call edi
push 0
push dword [ebp - 0x534]
push dword [ebp - 0x528]
push 0
push dword [ebp - 0x54c]
mov eax, 0x40000000
mov ecx, 0xc0000000
cmp word [ebp - 0x53c], 2
cmove eax, ecx
push eax
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
mov ebx, dword [sym.imp.KERNEL32.dll_lstrcpyA]
cmp esi, 0xffffffff
jne 0x406684
push str.CreateFile
lea eax, [ebp - 0x520]
push eax
call ebx
push 0
push 0
push 0
push 0x60000001
call edi
mov eax, 2
xor ecx, ecx
cmp word [ebp - 0x53c], ax
cmove eax, ecx
push eax
push ecx
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x4066c6
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x44a5e8
lea eax, [ebp - 0x520]
push eax
call ebx
push 0
push 0
push 0
push 0x60000001
call edi
mov dword [ebp - 0x530], 0
mov dword [ebp - 0x534], 0
cmp word [ebp - 0x53c], 2
jne 0x406757
push 0
lea eax, [ebp - 0x534]
push eax
lea eax, [ebp - 0x530]
push eax
push 0
push esi
call fcn.00405ad0
add esp, 0x14
test al, al
jne 0x406717
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0
push 0
push 0
push 0x60000000
call edi
lea eax, [ebp - 0x530]
mov dword [ebp - 0x540], eax
push 0
push 0
push 0
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x406757
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x44a5e8
lea eax, [ebp - 0x520]
push eax
call ebx
push 0
push 0
push 0
push 0x60000001
call edi
mov ecx, dword [ebp - 0x538]
test ecx, ecx
je 0x4067d8
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x4067d8
push 0
lea edx, [ebp - 0x538]
push edx
push eax
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x4067a0
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x44a61c
lea eax, [ebp - 0x520]
push eax
call ebx
push 0
push 0
push 0
push 0x60000001
call edi
mov eax, dword [ebp + 0x10]
cmp dword [ebp - 0x538], eax
je 0x4067d8
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0xe0000008
call dword [sym.imp.KERNEL32.dll_SetLastError]
push 0x44a61c
lea eax, [ebp - 0x520]
push eax
call ebx
push 0
push 0
push 0
push 0x60000001
call edi
mov eax, dword [ebp - 0x52c]
test eax, eax
je 0x4068ce
push eax
call fcn.0040cd30
add esp, 4
mov dword [ebp - 0x528], eax
test eax, eax
je 0x4068a8
lea ecx, [ebp - 0x528]
mov dword [ebp - 0x544], ecx
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov dword [ebp - 0x52c], eax
push 0
lea ecx, [ebp - 0x538]
push ecx
push eax
push dword [ebp - 0x528]
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x406853
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x44a61c
lea eax, [ebp - 0x520]
push eax
call ebx
push 0
push 0
push 0
push 0x60000001
call edi
mov eax, dword [ebp - 0x52c]
cmp dword [ebp - 0x538], eax
je 0x40688e
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0xe0000008
call dword [sym.imp.KERNEL32.dll_SetLastError]
push 0x44a61c
lea eax, [ebp - 0x520]
push eax
call ebx
push 0
push 0
push 0
push 0x60000001
call edi
push dword [ebp - 0x528]
call fcn.004380f7
add esp, 4
mov dword [ebp - 0x528], 0
jmp 0x4068ce
push 0xe000000d
call dword [sym.imp.KERNEL32.dll_SetLastError]
push str.FTAFormat__
lea eax, [ebp - 0x520]
push eax
call ebx
push 0
push 0
push 0
push 0x60000001
call edi
cmp word [ebp - 0x53c], 2
jne 0x406971
push 0
lea eax, [ebp - 0x52c]
push eax
push dword [ebp - 0x534]
push dword [ebp - 0x530]
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x40691e
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x44a61c
lea eax, [ebp - 0x520]
push eax
call ebx
push 0
push 0
push 0
push 0x60000001
call edi
mov eax, dword [ebp - 0x534]
cmp dword [ebp - 0x52c], eax
je 0x406959
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0xe0000008
call dword [sym.imp.KERNEL32.dll_SetLastError]
push 0x44a61c
lea eax, [ebp - 0x520]
push eax
call ebx
push 0
push 0
push 0
push 0x60000001
call edi
push dword [ebp - 0x530]
call fcn.004380f7
add esp, 4
mov dword [ebp - 0x530], 0
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
jne 0x406997
push 0x44a4b8
lea eax, [ebp - 0x520]
push eax
call ebx
push 0
push 0
push 0
push 0x60000001
call edi
mov al, 1
jmp 0x406a74
mov byte [ebp - 0x521], al
mov dword [ebp - 4], 0xfffffffe
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x1c]
xor ecx, ebp
call fcn.00439a01
mov esp, ebp
pop ebp
ret