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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
mov ecx, dword [ebp + 0xc]
mov eax, edx
push ebx
push esi
mov esi, dword [0x5e9fbc]
push edi
push 0
push 0x80
push 4
push 0
push 3
push 0x40000000
push eax
mov dword [ebp - 0x10], eax
mov dword [ebp - 0x18], esi
mov dword [ecx], 0
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
call ebx
mov dword [0x5f0854], eax
cmp edi, 0xffffffff
jne 0x4686af
mov edi, dword [ebp - 0x10]
push edi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x468a0d
push 0
and eax, 6
or eax, 0x80
push eax
push 4
push 0
push 3
push 0x40000000
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
call ebx
mov dword [0x5f0854], eax
cmp edi, 0xffffffff
je 0x468a0d
cmp dword [0x5f03a8], 0
mov ebx, dword [sym.imp.USER32.dll_SendMessageW]
je 0x4686dc
push 0
push 0
push 0
push 0x7ee
push esi
call ebx
push eax
push 0x7ed
push esi
call ebx
mov ecx, esi
call fcn.0046e710
cmp dword [0x5f038c], 0
je 0x4686f1
mov edx, 1
mov ecx, esi
call fcn.0046cf40
push 0
push 0
push 0x7d6
push esi
call ebx
mov dword [ebp - 0xc], eax
lea ecx, [eax + 1]
push ecx
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov ebx, eax
push ebx
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalSize]
push eax
push 0x886
push esi
call dword [sym.imp.USER32.dll_SendMessageW]
mov ecx, dword [ebp - 0xc]
test ecx, ecx
jne 0x468744
push edi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov esi, eax
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
mov dword [0x5f0854], eax
jmp 0x4689de
mov eax, dword [ebp + 8]
lea esi, [eax + eax*4]
shl esi, 4
mov eax, dword [esi + 0x5be128]
test al, 8
je 0x46881e
push edi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov ecx, dword [ebp - 0xc]
lea eax, [ecx*2 + 0x10]
push eax
mov eax, dword [sym.imp.KERNEL32.dll_GlobalAlloc]
push 0x40
call eax
mov ecx, dword [sym.imp.KERNEL32.dll_GlobalSize]
push eax
mov dword [ebp + 0xc], eax
call ecx
shr eax, 1
push eax
push dword [ebp + 0xc]
push dword [ebp - 0xc]
push ebx
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov ecx, dword [esi + 0x5be128]
mov edx, eax
mov eax, dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [ebp - 0x10], edx
test cl, 0x20
je 0x4687cd
push 0
test cl, 0x10
lea ecx, [ebp - 8]
push ecx
push 2
je 0x4687c2
push 0x41ef80
jmp 0x4687c7
push 0x41ef84
push edi
call eax
mov edx, dword [ebp - 0x10]
test byte [esi + 0x5be128], 0x10
mov esi, dword [ebp + 0xc]
je 0x4687e7
lea eax, [edx + edx]
push eax
push esi
push esi
call fcn.0058bb4a
add esp, 0xc
push 0
lea eax, [ebp - 8]
push eax
mov eax, dword [ebp - 0x10]
add eax, eax
push eax
push esi
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [ebp + 0xc], eax
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GlobalFree]
mov dword [0x5f0854], eax
call esi
push ebx
call esi
mov esi, dword [ebp + 0xc]
jmp 0x4689de
test al, 2
je 0x46885a
push edi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
test byte [esi + 0x5be128], 4
mov esi, dword [sym.imp.KERNEL32.dll_WriteFile]
je 0x468848
push 0
lea eax, [ebp - 8]
push eax
push 3
push 0x41ef88
push edi
call esi
push 0
lea eax, [ebp - 8]
push eax
push dword [ebp - 0xc]
push ebx
push edi
call esi
jmp 0x4689c9
test al, 0x40
je 0x4689b1
mov esi, dword [esi + 0x5be12c]
lea eax, [ecx*2 + 0x10]
push eax
mov eax, dword [sym.imp.KERNEL32.dll_GlobalAlloc]
push 0x40
mov dword [ebp - 0x10], 0
call eax
mov ecx, dword [sym.imp.KERNEL32.dll_GlobalSize]
push eax
mov dword [ebp - 4], eax
call ecx
shr eax, 1
push eax
push dword [ebp - 4]
push dword [ebp - 0xc]
push ebx
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov dword [ebp - 0xc], eax
cmp esi, 0xfde8
je 0x4688cb
cmp esi, 0xd698
je 0x4688cb
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalSize]
push eax
push 0
push ebx
call fcn.00583650
add esp, 0xc
jmp 0x4688e8
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_GlobalSize]
add eax, eax
push eax
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov ebx, eax
cmp esi, 0xfde8
je 0x468949
cmp esi, 0xd698
je 0x468949
lea eax, [ebp - 0x10]
push eax
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalSize]
push eax
push ebx
push dword [ebp - 0xc]
push dword [ebp - 4]
push 0x400
push esi
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
cmp dword [ebp - 0x10], 0
mov dword [ebp - 0x14], eax
jne 0x468969
push 0
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalSize]
push eax
push ebx
push dword [ebp - 0xc]
push dword [ebp - 4]
push 0
push esi
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov esi, eax
mov dword [ebp - 0x10], 0
jmp 0x46896c
push 0
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalSize]
push eax
push ebx
push dword [ebp - 0xc]
push dword [ebp - 4]
push 0
push esi
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov esi, eax
jmp 0x46896c
mov esi, dword [ebp - 0x14]
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_GlobalFree]
cmp dword [ebp - 0x10], 0
je 0x4689a1
push 0xc360
push 0x41ef8c
push 8
call fcn.0045c680
add esp, 0xc
cmp eax, 1
je 0x4689a1
mov eax, dword [ebp + 0xc]
xor esi, esi
mov dword [eax], 1
jmp 0x4689d7
push edi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push 0
lea eax, [ebp - 8]
push eax
push esi
jmp 0x4689c1
push edi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push 0
lea eax, [ebp - 8]
push eax
push dword [ebp - 0xc]
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, eax
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
mov dword [0x5f0854], eax
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
je 0x468a0d
cmp dword [ebp + 0x10], 0
jne 0x468a01
push 0
push 0
push 0x7de
push dword [ebp - 0x18]
call dword [sym.imp.USER32.dll_SendMessageW]
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret