Function at 0x4060b8
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 [0x5bd018], eax
cmp ebx, 0xffffffff
jne 0x406135
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, ebx
je 0x40644a
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 [0x5bd018], eax
cmp ebx, 0xffffffff
je 0x40644a
cmp dword [0x5bd194], 0
mov esi, dword [sym.imp.USER32.dll_SendMessageW]
je 0x406160
xor edi, edi
push edi
push edi
push edi
push 0x7ee
push dword [ebp + 8]
call esi
push eax
push 0x7ed
push dword [ebp + 8]
call esi
jmp 0x406162
xor edi, edi
push edi
push edi
push 0x7d6
push dword [ebp + 8]
call esi
mov esi, eax
lea ecx, [esi + 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 dword [ebp + 8]
call dword [sym.imp.USER32.dll_SendMessageW]
test esi, esi
jne 0x4061b2
push ebx
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [0x5bd018], eax
jmp 0x406422
imul eax, dword [ebp + 0x10], 0x50
mov dword [ebp - 0x14], eax
mov ecx, dword [eax + 0x55f128]
test cl, 8
je 0x406285
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 + 0x55f128]
test dl, 0x20
je 0x406235
lea ecx, [ebp - 8]
push 0
push ecx
push 2
test dl, 0x10
je 0x40622a
push 0x5617a4
jmp 0x40622f
push 0x5617a8
push ebx
call eax
mov ecx, dword [ebp - 0x10]
test byte [esi + 0x55f128], 0x10
mov esi, dword [ebp + 0x14]
je 0x40624f
lea eax, [ecx + ecx]
push eax
push esi
push esi
call fcn.004d884e
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 [0x5bd018], eax
call esi
push edi
call esi
mov esi, dword [ebp + 0x14]
jmp 0x406422
test cl, 2
je 0x4062ba
push ebx
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov eax, dword [ebp - 0x14]
test byte [eax + 0x55f128], 4
je 0x4063ff
push 0
lea eax, [ebp - 8]
push eax
push 3
push 0x5617ac
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x4063ff
test cl, 0x40
je 0x4063f8
mov eax, dword [eax + 0x55f12c]
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 0x40632a
cmp eax, 0xd698
je 0x40632a
mov esi, dword [sym.imp.KERNEL32.dll_GlobalSize]
push edi
call esi
push eax
push 0
push edi
call fcn.004cbf40
add esp, 0xc
jmp 0x40635a
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 0x4063a4
cmp eax, 0xd698
je 0x4063a4
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 0x4063c2
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 0x4063c5
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 0x4063c5
mov esi, dword [ebp - 0x18]
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_GlobalFree]
cmp dword [ebp - 0x10], 0
je 0x4063f8
push 0xc360
push str.MsgConv3
push 8
call fcn.004028f0
xor ecx, ecx
add esp, 0xc
inc ecx
cmp eax, ecx
je 0x4063f8
mov eax, dword [ebp + 0x14]
xor esi, esi
mov dword [eax], ecx
jmp 0x40641b
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 [0x5bd018], eax
push edi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
je 0x40644a
cmp dword [ebp + 0x18], 0
jne 0x406445
push 0
push 0
push 0x7de
push dword [ebp + 8]
call dword [sym.imp.USER32.dll_SendMessageW]
xor eax, eax
inc eax
jmp 0x40644c
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret