Function at 0x40698f
Capabilities:
Check if file exists
Clear file content
Get file attributes
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
mov ecx, dword [ebp + 0xc]
mov eax, edx
push ebx
push esi
mov esi, dword [0x52a68c]
xor edx, edx
push edi
push edx
push 0x80
push 4
push edx
push 3
push 0x40000000
push eax
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x1c], esi
mov dword [ecx], edx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
call edi
mov dword [0x52ab8c], eax
cmp ebx, 0xffffffff
jne 0x406a1a
mov ebx, dword [ebp - 0x14]
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x406d41
push 0
and eax, 6
or eax, 0x80
push eax
push 4
push 0
push 3
push 0x40000000
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
call edi
mov dword [0x52ab8c], eax
cmp ebx, 0xffffffff
je 0x406d41
cmp dword [0x52a6b8], 0
mov edi, dword [sym.imp.USER32.dll_SendMessageW]
je 0x406a46
xor eax, eax
push eax
push eax
push eax
push 0x7ee
push esi
call edi
push eax
push 0x7ed
push esi
call edi
mov ecx, esi
call fcn.0040bc0a
cmp dword [0x52a694], 0
je 0x406a59
xor edx, edx
mov ecx, esi
inc edx
call fcn.0040a5e1
push 0
push 0
push 0x7d6
push esi
call edi
mov dword [ebp - 0x14], eax
lea ecx, [eax + 1]
push ecx
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov edi, eax
push edi
push edi
call dword [sym.imp.KERNEL32.dll_GlobalSize]
push eax
push 0x886
push esi
call dword [sym.imp.USER32.dll_SendMessageW]
mov esi, dword [ebp - 0x14]
test esi, esi
jne 0x406aab
push ebx
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [0x52ab8c], eax
jmp 0x406d19
imul eax, dword [ebp + 8], 0x50
mov dword [ebp - 0x14], eax
mov ecx, dword [eax + 0x4f8a50]
test cl, 8
je 0x406b7c
push ebx
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
lea eax, [esi*2 + 0x10]
push eax
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
push eax
mov dword [ebp + 0xc], eax
call dword [sym.imp.KERNEL32.dll_GlobalSize]
shr eax, 1
push eax
push dword [ebp + 0xc]
push esi
push edi
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov esi, dword [ebp - 0x14]
mov dword [ebp - 0x10], eax
mov eax, dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [esi + 0x4f8a50]
test cl, 0x20
je 0x406b29
push 0
test cl, 0x10
lea ecx, [ebp - 8]
push ecx
push 2
je 0x406b21
push 0x4c2810
jmp 0x406b26
push 0x4c2814
push ebx
call eax
mov eax, dword [ebp - 0x10]
add eax, eax
test byte [esi + 0x4f8a50], 0x10
mov esi, dword [ebp + 0xc]
mov dword [ebp - 0x14], eax
je 0x406b4b
push eax
push esi
push esi
call fcn.0048e1ce
mov eax, dword [ebp - 0x14]
add esp, 0xc
push 0
lea ecx, [ebp - 8]
push ecx
push eax
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [ebp + 0xc], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GlobalFree]
mov dword [0x52ab8c], eax
call esi
push edi
call esi
mov esi, dword [ebp + 0xc]
jmp 0x406d19
test cl, 2
je 0x406bb1
push ebx
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov eax, dword [ebp - 0x14]
test byte [eax + 0x4f8a50], 4
je 0x406cf6
push 0
lea eax, [ebp - 8]
push eax
push 3
push 0x4c2818
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x406cf6
test cl, 0x40
je 0x406cef
mov eax, dword [eax + 0x4f8a54]
and dword [ebp - 0x10], 0
mov dword [ebp - 0xc], eax
lea eax, [esi*2 + 0x10]
push eax
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
push eax
mov dword [ebp - 4], eax
call dword [sym.imp.KERNEL32.dll_GlobalSize]
shr eax, 1
push eax
push dword [ebp - 4]
push esi
push edi
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0xc]
cmp eax, 0xfde8
je 0x406c21
cmp eax, 0xd698
je 0x406c21
mov esi, dword [sym.imp.KERNEL32.dll_GlobalSize]
push edi
call esi
push eax
push 0
push edi
call fcn.00489f20
add esp, 0xc
jmp 0x406c51
push edi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
push dword [ebp - 4]
mov esi, dword [sym.imp.KERNEL32.dll_GlobalSize]
call esi
add eax, eax
push eax
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov edi, eax
mov eax, dword [ebp - 0xc]
cmp eax, 0xfde8
je 0x406c9b
cmp eax, 0xd698
je 0x406c9b
lea eax, [ebp - 0x10]
push eax
push 0
push edi
call esi
push eax
push edi
push dword [ebp - 0x14]
push dword [ebp - 4]
push 0x400
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
cmp dword [ebp - 0x10], 0
mov dword [ebp - 0x18], eax
jne 0x406cb9
push 0
push 0
push edi
call esi
push eax
push edi
push dword [ebp - 0x14]
push dword [ebp - 4]
push 0
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
and dword [ebp - 0x10], 0
mov esi, eax
jmp 0x406cbc
push 0
push 0
push edi
call esi
push eax
push edi
push dword [ebp - 0x14]
push dword [ebp - 4]
push 0
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov esi, eax
jmp 0x406cbc
mov esi, dword [ebp - 0x18]
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_GlobalFree]
cmp dword [ebp - 0x10], 0
je 0x406cef
push 0xc360
push str.MsgConv3
push 8
call fcn.0040449b
xor ecx, ecx
add esp, 0xc
inc ecx
cmp eax, ecx
je 0x406cef
mov eax, dword [ebp + 0xc]
xor esi, esi
mov dword [eax], ecx
jmp 0x406d12
push ebx
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push 0
lea eax, [ebp - 8]
push eax
push esi
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [0x52ab8c], eax
push edi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
je 0x406d41
cmp dword [ebp + 0x10], 0
jne 0x406d3c
push 0
push 0
push 0x7de
push dword [ebp - 0x1c]
call dword [sym.imp.USER32.dll_SendMessageW]
xor eax, eax
inc eax
jmp 0x406d43
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret