Function at 0x405160
Capabilities:
Clear file content
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x4091b8
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x14
push ebx
push ebp
push esi
mov esi, ecx
push edi
lea ecx, [esp + 0x18]
mov dword [esp + 0x20], esi
call sub.MFC42.DLL_CString::CString_2
lea ecx, [esp + 0x14]
mov dword [esp + 0x2c], 0
call sub.MFC42.DLL_CString::CString_2
lea ecx, [esp + 0x10]
mov byte [esp + 0x2c], 1
call sub.MFC42.DLL_CString::CString_2
lea eax, [esi + 8]
mov ecx, esi
push eax
mov byte [esp + 0x30], 2
call fcn.00405110
mov edi, eax
or ebx, 0xffffffff
cmp edi, ebx
je 0x40538f
push 0
push 0
push 0
push edi
mov ecx, esi
call fcn.004053d0
test edx, edx
jg 0x4051df
jl 0x4051ea
test eax, eax
jb 0x4051ea
push edi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
test eax, eax
jne 0x40522f
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [esp + 0x10]
mov byte [esp + 0x2c], 1
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x14]
mov byte [esp + 0x2c], 0
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x18]
mov dword [esp + 0x2c], ebx
call sub.MFC42.DLL_CString::CString
pop edi
pop esi
mov eax, ebx
pop ebp
pop ebx
mov ecx, dword [esp + 0x14]
mov dword fs:[0], ecx
add esp, 0x20
ret
mov ebp, dword [esi + 0x10]
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
test ebp, ebp
je 0x40530e
mov ecx, dword [ebp + 0xc]
lea edx, [esp + 0x18]
push ecx
push str.__s__r_n
push edx
call sub.MFC42.DLL_CString::Format
add esp, 0xc
lea eax, [esp + 0x18]
lea ecx, [esp + 0x10]
push eax
call sub.MFC42.DLL_CString::operator
mov ecx, dword [esp + 0x10]
mov eax, dword [ecx - 8]
cmp eax, 0x1000
jle 0x405298
lea edx, [esp + 0x1c]
push 0
push edx
push eax
push ecx
push edi
call ebx
test eax, eax
je 0x405329
push 0x40d800
lea ecx, [esp + 0x14]
call fcn.00406850
mov ecx, dword [esp + 0x10]
mov esi, dword [ebp + 0x14]
test esi, esi
je 0x4052fd
mov eax, dword [esi + 0x10]
mov ecx, dword [esi + 0xc]
push eax
push ecx
lea edx, [esp + 0x1c]
push str._s_s_r_n
push edx
call sub.MFC42.DLL_CString::Format
add esp, 0x10
lea eax, [esp + 0x14]
lea ecx, [esp + 0x10]
push eax
call sub.MFC42.DLL_CString::operator
mov ecx, dword [esp + 0x10]
mov eax, dword [ecx - 8]
cmp eax, 0x1000
jle 0x4052f7
lea edx, [esp + 0x1c]
push 0
push edx
push eax
push ecx
push edi
call ebx
test eax, eax
je 0x405329
push 0x40d800
lea ecx, [esp + 0x14]
call fcn.00406850
mov ecx, dword [esp + 0x10]
mov esi, dword [esi]
test esi, esi
jne 0x40529f
mov ebp, dword [ebp]
test ebp, ebp
jne 0x405240
mov esi, dword [esp + 0x20]
jmp 0x405312
mov ecx, dword [esp + 0x10]
mov eax, dword [ecx - 8]
test eax, eax
je 0x405381
lea edx, [esp + 0x1c]
push 0
push edx
push eax
push ecx
push edi
call ebx
test eax, eax
jne 0x405373
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [esp + 0x10]
mov byte [esp + 0x2c], 1
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x14]
mov byte [esp + 0x2c], 0
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x18]
mov dword [esp + 0x2c], 0xffffffff
call sub.MFC42.DLL_CString::CString
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
mov ecx, dword [esp + 0x14]
mov dword fs:[0], ecx
add esp, 0x20
ret
push 0x40d800
lea ecx, [esp + 0x14]
call fcn.00406850
push edi
mov byte [esi + 4], 0
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or ebx, 0xffffffff
lea ecx, [esp + 0x10]
mov byte [esp + 0x2c], 1
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x14]
mov byte [esp + 0x2c], 0
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x18]
mov dword [esp + 0x2c], ebx
call sub.MFC42.DLL_CString::CString
mov ecx, dword [esp + 0x24]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
mov dword fs:[0], ecx
add esp, 0x20
ret