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

Disassembly:
push 0x28
mov eax, 0x4f6014
call fcn.004de80b
mov esi, dword [ebp + 8]
lea edi, [esi + 4]
push edi
mov dword [ebp - 0x18], edi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x46f645
push edi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
test al, 1
je 0x46f645
xor eax, eax
jmp 0x46f833
mov eax, dword [0x545cc4]
and dword [ebp - 0x1c], 0
mov ecx, 0x545cc4
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x14], eax
and dword [ebp - 4], 0
mov eax, dword [esi + 0x224]
mov eax, dword [eax]
mov dword [ebp - 0x28], eax
mov eax, dword [esi + 0x20c]
mov dword [ebp - 0x2c], eax
mov ebx, 0x51163c
mov eax, dword [esi + 0x224]
mov dword [ebp - 0x30], eax
mov eax, dword [esi + 0x20c]
lea edi, [ebp - 0x34]
lea esi, [ebp - 0x2c]
mov dword [ebp - 0x34], eax
call fcn.0046b5c0
test al, al
jne 0x46f776
push 1
push 0x511804
lea eax, [ebp - 0x14]
call fcn.00407be4
call fcn.0046b595
mov esi, dword [eax]
mov eax, esi
call fcn.0040670c
push eax
push esi
lea eax, [ebp - 0x14]
call fcn.00407be4
push 3
push 0x51afec
lea eax, [ebp - 0x14]
call fcn.00407be4
lea esi, [ebp - 0x2c]
call fcn.0046b595
mov edi, dword [eax + 4]
mov eax, dword [edi + 0x18]
mov eax, dword [eax]
mov dword [ebp - 0x20], eax
mov eax, dword [edi]
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x24], 0
mov esi, dword [edi + 0x18]
mov eax, dword [edi]
je 0x46f6fc
cmp dword [ebp - 0x24], eax
je 0x46f701
call fcn.004d6d23
cmp dword [ebp - 0x20], esi
je 0x46f75b
lea esi, [ebp - 0x24]
call fcn.0046b595
mov esi, dword [eax]
mov eax, esi
call fcn.0040670c
push eax
push esi
lea eax, [ebp - 0x14]
call fcn.00407be4
push 1
push 0x5113a8
lea eax, [ebp - 0x14]
call fcn.00407be4
lea esi, [ebp - 0x24]
call fcn.0046b595
add eax, 4
mov eax, dword [eax]
push dword [eax - 0xc]
push eax
lea eax, [ebp - 0x14]
call fcn.00407be4
push 2
push ebx
lea eax, [ebp - 0x14]
call fcn.00407be4
call fcn.0048595a
jmp 0x46f6ec
push 2
push ebx
lea eax, [ebp - 0x14]
call fcn.00407be4
lea esi, [ebp - 0x2c]
call fcn.0048595a
mov esi, dword [ebp + 8]
jmp 0x46f679
push 0
push 0x20
push 4
push 0
push 1
push 0x40000000
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp + 8], eax
cmp eax, 0xffffffff
je 0x46f825
mov ecx, dword [ebp - 0x14]
mov esi, dword [ecx - 0xc]
add esi, esi
jne 0x46f7ad
push eax
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
jmp 0x46f81c
add esi, 2
lea eax, [esi + 2]
push eax
call fcn.004d4f20
mov ebx, eax
xor eax, eax
lea edi, [ebx + esi]
pop ecx
stosw word es:[edi], ax
test ebx, ebx
je 0x46f81c
mov eax, 0xfeff
mov word [ebx], ax
mov eax, dword [ebp - 0x14]
mov ecx, ebx
sub ecx, eax
lea edx, [ecx + 2]
movzx ecx, word [eax]
mov word [edx + eax], cx
inc eax
inc eax
test cx, cx
jne 0x46f7d9
and dword [ebp - 0x18], 0
push 0
lea eax, [ebp - 0x18]
push eax
push esi
push ebx
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x46f815
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
cmp dword [ebp - 0x18], esi
jne 0x46f815
mov dword [ebp - 0x1c], 1
push ebx
call fcn.004d5e58
pop ecx
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x14]
add eax, 0xfffffff0
call fcn.00406ace
mov eax, dword [ebp - 0x1c]
call fcn.004de8e3
ret