Function at 0x406440
Capabilities:
Clear file content
Delete file
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x20], 0
cmp dword [ebp + 0x10], 0
jne 0x406484
push 0
push 0x80
push 3
push 0
push 1
push 0xc0000000
mov eax, dword [ebp + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [0x41ff9c], eax
jmp 0x4064c1
push 0
push 0x80
push 4
push 0
push 3
push 0xc0000000
mov ecx, dword [ebp + 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [0x41ff9c], eax
cmp dword [0x41ff9c], 0xffffffff
je 0x4064c1
call dword [sym.imp.KERNEL32.dll_GetLastError]
xor edx, edx
cmp eax, 0xb7
setne dl
mov dword [ebp - 0x10], edx
cmp dword [0x41ff9c], 0xffffffff
jne 0x4064f7
cmp dword [ebp + 0x10], 0
je 0x4064f0
push 0x30
mov eax, dword [ebp + 0xc]
push eax
mov ecx, dword [0x40ee8c]
push ecx
mov edx, dword [0x40ee7c]
push edx
mov eax, dword [ebp + 8]
push eax
call fcn.004080e0
add esp, 0x14
xor eax, eax
jmp 0x4067ce
cmp dword [0x41efc8], 0
je 0x406505
call fcn.00406240
push 0
push 0
push 0xe
mov ecx, dword [0x41efb8]
push ecx
call dword [sym.imp.USER32.dll_SendMessageW]
mov dword [ebp - 0x14], eax
push 0
push 0
push 0xbd
mov edx, dword [0x41efb8]
push edx
call dword [sym.imp.USER32.dll_SendMessageW]
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
je 0x40654d
mov eax, dword [ebp - 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_LocalLock]
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
jne 0x40655e
mov ecx, dword [ebp + 0xc]
push ecx
call fcn.004063a0
add esp, 4
jmp 0x4066f5
mov edx, dword [0x420018]
mov dword [ebp - 0x2c], edx
cmp dword [ebp - 0x2c], 1
je 0x406582
cmp dword [ebp - 0x2c], 2
je 0x4065c1
cmp dword [ebp - 0x2c], 3
je 0x406628
jmp 0x406649
push 0
lea eax, [ebp - 0x24]
push eax
push 2
push 0x40ee0c
mov ecx, dword [0x41ff9c]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
lea edx, [ebp - 0x24]
push edx
mov eax, dword [ebp - 0x14]
shl eax, 1
push eax
mov ecx, dword [ebp - 8]
push ecx
mov edx, dword [0x41ff9c]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [ebp - 0x28], eax
jmp 0x4066d6
push 0
lea eax, [ebp - 0x24]
push eax
push 2
push 0x40ee10
mov ecx, dword [0x41ff9c]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edx, dword [ebp - 0x14]
push edx
mov eax, dword [ebp - 8]
push eax
mov ecx, dword [ebp - 8]
push ecx
call fcn.00406340
add esp, 0xc
push 0
lea edx, [ebp - 0x24]
push edx
mov eax, dword [ebp - 0x14]
shl eax, 1
push eax
mov ecx, dword [ebp - 8]
push ecx
mov edx, dword [0x41ff9c]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x14]
push eax
mov ecx, dword [ebp - 8]
push ecx
mov edx, dword [ebp - 8]
push edx
call fcn.00406340
add esp, 0xc
jmp 0x4066d6
push 0
lea eax, [ebp - 0x24]
push eax
push 3
push 0x40ee08
mov ecx, dword [0x41ff9c]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [ebp - 0x20], 0xfde9
mov dword [ebp - 0xc], 0
cmp dword [0x420018], 3
je 0x406668
call dword [sym.imp.KERNEL32.dll_GetACP]
mov dword [ebp - 0x20], eax
lea edx, [ebp - 0x1c]
mov dword [ebp - 0xc], edx
mov eax, dword [ebp - 0xc]
push eax
push 0
push 0
push 0
mov ecx, dword [ebp - 0x14]
push ecx
mov edx, dword [ebp - 8]
push edx
push 0
mov eax, dword [ebp - 0x20]
push eax
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov dword [ebp - 4], eax
cmp dword [ebp - 0x1c], 0
je 0x4066b5
push 0x31
mov ecx, dword [ebp + 0xc]
push ecx
mov edx, dword [0x40eebc]
push edx
mov eax, dword [0x40ee7c]
push eax
mov ecx, dword [ebp + 8]
push ecx
call fcn.004080e0
add esp, 0x14
cmp eax, 2
jne 0x4066b5
jmp 0x4066f5
mov edx, dword [ebp - 4]
push edx
mov eax, dword [ebp - 0x14]
push eax
mov ecx, dword [ebp - 8]
push ecx
mov edx, dword [ebp - 0x20]
push edx
mov eax, dword [0x41ff9c]
push eax
call fcn.004062a0
add esp, 0x14
mov dword [ebp - 0x28], eax
cmp dword [ebp - 0x28], 0
jne 0x40674f
mov ecx, dword [0x41fa00]
push ecx
call dword [sym.imp.USER32.dll_SetCursor]
mov edx, dword [ebp + 0xc]
push edx
call fcn.004063a0
add esp, 4
mov eax, dword [0x41fa00]
push eax
call dword [sym.imp.USER32.dll_SetCursor]
mov ecx, dword [0x41ff9c]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [0x41ff9c], 0xffffffff
cmp dword [ebp - 0x18], 0
je 0x406728
mov edx, dword [ebp - 0x18]
push edx
call dword [sym.imp.KERNEL32.dll_LocalUnlock]
cmp dword [ebp - 0x10], 0
je 0x406738
mov eax, dword [ebp + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
cmp dword [0x41efc8], 0
je 0x406746
call fcn.00406200
xor eax, eax
jmp 0x4067ce
mov ecx, dword [0x41ff9c]
push ecx
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push 0
push 0
push 0xb9
mov edx, dword [0x41efb8]
push edx
call dword [sym.imp.USER32.dll_SendMessageW]
mov eax, dword [ebp + 0xc]
push eax
call fcn.00407b80
add esp, 4
mov dword [0x40ee40], 0
mov ecx, dword [0x41ff9c]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [0x41ff9c], 0xffffffff
cmp dword [ebp - 0x18], 0
je 0x4067af
mov edx, dword [ebp - 0x18]
push edx
call dword [sym.imp.KERNEL32.dll_LocalUnlock]
cmp dword [0x41efc8], 0
je 0x4067bd
call fcn.00406200
mov eax, dword [0x41fa00]
push eax
call dword [sym.imp.USER32.dll_SetCursor]
mov eax, 1
mov esp, ebp
pop ebp
ret