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

Disassembly:
push 0x28
mov eax, 0x5b5035
call fcn.00598f2b
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 0x5181ff
push edi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
test al, 1
je 0x5181ff
xor eax, eax
jmp 0x5183d7
mov eax, dword [0x63696c]
and dword [ebp - 0x1c], 0
mov ecx, 0x63696c
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, 0x5df2dc
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.004acc17
test al, al
jne 0x51831a
push 1
push 0x5df4b8
lea eax, [ebp - 0x14]
call fcn.0040a5cb
call fcn.00518626
push dword [eax]
lea eax, [ebp - 0x14]
push eax
call fcn.0040a5b1
push 3
push 0x5fb660
lea eax, [ebp - 0x14]
call fcn.0040a5cb
call fcn.00518626
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 0x5182ab
cmp dword [ebp - 0x24], eax
je 0x5182b0
call fcn.005908ee
cmp dword [ebp - 0x20], esi
je 0x5182ff
lea esi, [ebp - 0x24]
call fcn.00518626
push dword [eax]
lea eax, [ebp - 0x14]
push eax
call fcn.0040a5b1
push 1
push 0x5ed79c
lea eax, [ebp - 0x14]
call fcn.0040a5cb
call fcn.00518626
add eax, 4
mov eax, dword [eax]
push dword [eax - 0xc]
push eax
lea eax, [ebp - 0x14]
call fcn.0040a5cb
push 2
push ebx
lea eax, [ebp - 0x14]
call fcn.0040a5cb
call fcn.004408ee
jmp 0x51829b
push 2
push ebx
lea eax, [ebp - 0x14]
call fcn.0040a5cb
lea esi, [ebp - 0x2c]
call fcn.004408ee
mov esi, dword [ebp + 8]
jmp 0x518233
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 0x5183c9
mov ecx, dword [ebp - 0x14]
mov esi, dword [ecx - 0xc]
add esi, esi
jne 0x518351
push eax
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
jmp 0x5183c0
add esi, 2
lea eax, [esi + 2]
push eax
call fcn.0058e040
mov ebx, eax
xor eax, eax
lea edi, [ebx + esi]
pop ecx
stosw word es:[edi], ax
test ebx, ebx
je 0x5183c0
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 0x51837d
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 0x5183b9
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
cmp dword [ebp - 0x18], esi
jne 0x5183b9
mov dword [ebp - 0x1c], 1
push ebx
call fcn.0058f807
pop ecx
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x14]
add eax, 0xfffffff0
call fcn.00407b6b
mov eax, dword [ebp - 0x1c]
call fcn.00599003
ret