Function at 0x40f7c9
Capabilities:
Clear file content
Get file attributes
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, dword [ebp + 0x14]
sub esp, 0x18
xor ecx, ecx
push ebx
push esi
push edi
mov edi, dword [sym.imp.KERNEL32.dll_CreateFileW]
push ecx
push 0x80
push 4
push ecx
push 3
push 0x40000000
push dword [ebp + 0xc]
mov dword [eax], ecx
call edi
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
call esi
mov dword [0x5a9f58], eax
cmp ebx, 0xffffffff
jne 0x40f846
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, ebx
je 0x40fb72
push 0
and eax, 6
or eax, 0x80
push eax
push 4
push 0
push 3
push 0x40000000
push dword [ebp + 0xc]
call edi
mov ebx, eax
call esi
mov dword [0x5a9f58], eax
cmp ebx, 0xffffffff
je 0x40fb72
cmp dword [0x5aa0d4], 0
mov esi, dword [ebp + 8]
mov edi, dword [sym.imp.USER32.dll_SendMessageW]
je 0x40f875
xor eax, eax
push eax
push eax
push eax
push 0x7ee
push esi
call edi
push eax
push 0x7ed
push esi
call edi
push esi
call fcn.0040d839
pop ecx
cmp dword [0x5aa0d0], 0
je 0x40f888
push 1
push esi
call fcn.00410177
pop ecx
pop ecx
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 0x40f8da
push ebx
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [0x5a9f58], eax
jmp 0x40fb4a
imul eax, dword [ebp + 0x10], 0x50
mov dword [ebp - 0x14], eax
mov ecx, dword [eax + 0x579008]
test cl, 8
je 0x40f9ad
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 + 0x14], eax
call dword [sym.imp.KERNEL32.dll_GlobalSize]
shr eax, 1
push eax
push dword [ebp + 0x14]
push esi
push edi
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov esi, dword [ebp - 0x14]
mov ecx, eax
mov eax, dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [ebp - 0x10], ecx
mov edx, dword [esi + 0x579008]
test dl, 0x20
je 0x40f95d
lea ecx, [ebp - 8]
push 0
push ecx
push 2
test dl, 0x10
je 0x40f952
push 0x521458
jmp 0x40f957
push 0x52145c
push ebx
call eax
mov ecx, dword [ebp - 0x10]
test byte [esi + 0x579008], 0x10
mov esi, dword [ebp + 0x14]
je 0x40f977
lea eax, [ecx + ecx]
push eax
push esi
push esi
call fcn.004c9583
add esp, 0xc
push 0
lea eax, [ebp - 8]
push eax
mov eax, dword [ebp - 0x10]
add eax, eax
push eax
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [ebp + 0x14], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GlobalFree]
mov dword [0x5a9f58], eax
call esi
push edi
call esi
mov esi, dword [ebp + 0x14]
jmp 0x40fb4a
test cl, 2
je 0x40f9e2
push ebx
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov eax, dword [ebp - 0x14]
test byte [eax + 0x579008], 4
je 0x40fb27
push 0
lea eax, [ebp - 8]
push eax
push 3
push 0x521460
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x40fb27
test cl, 0x40
je 0x40fb20
mov eax, dword [eax + 0x57900c]
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 0x40fa52
cmp eax, 0xd698
je 0x40fa52
mov esi, dword [sym.imp.KERNEL32.dll_GlobalSize]
push edi
call esi
push eax
push 0
push edi
call fcn.004bd230
add esp, 0xc
jmp 0x40fa82
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 0x40facc
cmp eax, 0xd698
je 0x40facc
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 0x40faea
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 0x40faed
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 0x40faed
mov esi, dword [ebp - 0x18]
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_GlobalFree]
cmp dword [ebp - 0x10], 0
je 0x40fb20
push 0xc360
push str.MsgConv3
push 8
call fcn.00409668
xor ecx, ecx
add esp, 0xc
inc ecx
cmp eax, ecx
je 0x40fb20
mov eax, dword [ebp + 0x14]
xor esi, esi
mov dword [eax], ecx
jmp 0x40fb43
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 [0x5a9f58], eax
push edi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
je 0x40fb72
cmp dword [ebp + 0x18], 0
jne 0x40fb6d
push 0
push 0
push 0x7de
push dword [ebp + 8]
call dword [sym.imp.USER32.dll_SendMessageW]
xor eax, eax
inc eax
jmp 0x40fb74
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret