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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
push ebx
push esi
mov esi, dword [ebp + 8]
xor ebx, ebx
cmp esi, ebx
push edi
je 0x40be68
lea edi, [esi + 4]
push ebx
push edi
mov dword [ebp - 0x18], edi
call fcn.0042947d
pop ecx
test eax, eax
pop ecx
je 0x40be6f
push edi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
test al, 1
je 0x40be6f
xor eax, eax
jmp 0x40c04f
mov eax, dword [0x43c4ec]
mov dword [ebp - 0x10], ebx
mov dword [ebp - 4], eax
mov eax, dword [esi + 0x210]
mov ecx, dword [eax]
cmp ecx, eax
mov dword [ebp - 8], ecx
je 0x40bf8d
mov esi, dword [sym.imp.KERNEL32.dll_lstrlenW]
mov edi, 0x43dc54
mov ebx, 0x43dc78
mov eax, ebx
test eax, eax
je 0x40bea6
push ebx
call esi
push ebx
push eax
lea ecx, [ebp - 4]
call fcn.00404d06
mov eax, dword [ebp - 8]
mov ebx, dword [eax + 0xc]
test ebx, ebx
jne 0x40bebe
xor eax, eax
jmp 0x40bec1
push ebx
call esi
push ebx
push eax
lea ecx, [ebp - 4]
call fcn.00404d06
mov ebx, 0x43dc70
mov eax, ebx
test eax, eax
je 0x40bed9
push ebx
call esi
push ebx
push eax
lea ecx, [ebp - 4]
call fcn.00404d06
mov eax, dword [ebp - 8]
mov ebx, dword [eax + 0x10]
mov eax, dword [ebx + 4]
mov eax, dword [eax]
mov dword [ebp - 0xc], eax
cmp eax, dword [ebx + 4]
je 0x40bf5e
mov eax, dword [eax + 0xc]
test eax, eax
mov dword [ebp - 0x14], eax
je 0x40bf03
push eax
call esi
push dword [ebp - 0x14]
lea ecx, [ebp - 4]
push eax
call fcn.00404d06
mov ecx, 0x43c588
mov eax, ecx
test eax, eax
je 0x40bf22
push ecx
call esi
mov ecx, 0x43c588
push ecx
push eax
lea ecx, [ebp - 4]
call fcn.00404d06
mov eax, dword [ebp - 0xc]
lea ecx, [ebp - 4]
mov eax, dword [eax + 0x10]
push eax
push dword [eax - 8]
call fcn.00404d06
mov eax, edi
test eax, eax
je 0x40bf47
push edi
call esi
push edi
push eax
lea ecx, [ebp - 4]
call fcn.00404d06
lea ecx, [ebp - 0xc]
call fcn.0040d58c
mov eax, dword [ebp - 0xc]
jmp 0x40bef1
mov eax, edi
test eax, eax
je 0x40bf67
push edi
call esi
push edi
push eax
lea ecx, [ebp - 4]
call fcn.00404d06
lea ecx, [ebp - 8]
call fcn.0040d2a4
mov ecx, dword [ebp + 8]
mov eax, dword [ebp - 8]
cmp eax, dword [ecx + 0x210]
jne 0x40be98
xor ebx, ebx
push ebx
push 0x20
push 4
push ebx
push 1
push 0x40000000
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
mov dword [ebp + 8], eax
je 0x40c044
mov eax, dword [ebp - 4]
mov eax, dword [eax - 8]
shl eax, 1
jne 0x40bfc4
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
jmp 0x40c03b
lea esi, [eax + 2]
lea eax, [esi + 2]
push eax
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
mov edi, eax
push 2
push ebx
lea eax, [edi + esi]
push eax
call sub.MSVCRT.dll_memset
add esp, 0x10
cmp edi, ebx
je 0x40c03b
lea eax, [ebp - 0x18]
push 2
push eax
push edi
mov dword [ebp - 0x18], 0xfeff
call sub.MSVCRT.dll_memcpy
push dword [ebp - 4]
lea eax, [edi + 2]
push eax
call dword [sym.imp.MSVCRT.dll_wcscpy]
add esp, 0x14
lea eax, [ebp - 0xc]
mov dword [ebp - 0xc], ebx
push ebx
push eax
push esi
push edi
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40c034
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
cmp dword [ebp - 0xc], esi
jne 0x40c034
mov dword [ebp - 0x10], 1
push edi
call fcn.0043259a
pop ecx
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp - 4]
call fcn.00404beb
mov eax, dword [ebp - 0x10]
pop edi
pop esi
pop ebx
leave
ret