Function at 0x40bd76
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 0x40bda6
lea edi, [esi + 4]
push ebx
push edi
mov dword [ebp - 0x18], edi
call fcn.0042953d
pop ecx
test eax, eax
pop ecx
je 0x40bdad
push edi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
test al, 1
je 0x40bdad
xor eax, eax
jmp 0x40bf8d
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 0x40becb
mov esi, dword [sym.imp.KERNEL32.dll_lstrlenW]
mov edi, 0x43db94
mov ebx, 0x43dbb8
mov eax, ebx
test eax, eax
je 0x40bde4
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 0x40bdfc
xor eax, eax
jmp 0x40bdff
push ebx
call esi
push ebx
push eax
lea ecx, [ebp - 4]
call fcn.00404d06
mov ebx, 0x43dbb0
mov eax, ebx
test eax, eax
je 0x40be17
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 0x40be9c
mov eax, dword [eax + 0xc]
test eax, eax
mov dword [ebp - 0x14], eax
je 0x40be41
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 0x40be60
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 0x40be85
push edi
call esi
push edi
push eax
lea ecx, [ebp - 4]
call fcn.00404d06
lea ecx, [ebp - 0xc]
call fcn.0040d4ca
mov eax, dword [ebp - 0xc]
jmp 0x40be2f
mov eax, edi
test eax, eax
je 0x40bea5
push edi
call esi
push edi
push eax
lea ecx, [ebp - 4]
call fcn.00404d06
lea ecx, [ebp - 8]
call fcn.0040d1e2
mov ecx, dword [ebp + 8]
mov eax, dword [ebp - 8]
cmp eax, dword [ecx + 0x210]
jne 0x40bdd6
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 0x40bf82
mov eax, dword [ebp - 4]
mov eax, dword [eax - 8]
shl eax, 1
jne 0x40bf02
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
jmp 0x40bf79
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 0x40bf79
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 0x40bf72
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
cmp dword [ebp - 0xc], esi
jne 0x40bf72
mov dword [ebp - 0x10], 1
push edi
call fcn.0043265a
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