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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x42b249
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x40
mov al, byte [ebp + 0xf]
push ebx
push esi
push edi
mov esi, ecx
mov dword [ebp - 0x10], esp
push 0
lea ecx, [ebp - 0x4c]
mov dword [ebp - 4], 0
mov byte [ebp - 0x4c], al
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Tidy_bool_]
mov edi, dword [ebp + 8]
push 0x436408
push edi
mov byte [ebp - 4], 1
call dword [sym.imp.MSVCP60.dll_bool___cdecl_std::operator_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const___char_const__]
mov ecx, dword [sym.imp.MSVCP60.dll_unsigned_int_const_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::npos]
add esp, 8
test al, al
mov edx, dword [ecx]
push edx
push 0
je 0x409e96
lea eax, [esi + 4]
push eax
jmp 0x409e97
push edi
lea ecx, [ebp - 0x4c]
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::assign_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const___unsigned_int__unsigned_int_]
mov eax, dword [ebp - 0x48]
test eax, eax
jne 0x409eac
mov eax, dword [sym.imp.MSVCP60.dll_char_const__private:_static_char_const____cdecl_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Nullstr_void_::_2::_C]
push 0
push 0x80
push 2
push 0
push 1
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
mov dword [ebp - 0x38], edi
jne 0x409ee4
lea eax, [ebp - 0x1c]
push 0x42f338
push eax
mov dword [ebp - 0x1c], str.open_file_error_n
call sub.MSVCRT.dll__CxxThrowException
push edi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov bl, byte [ebp + 0xc]
test bl, bl
je 0x409ef7
mov eax, dword [esi + 0x24]
jmp 0x409efa
mov eax, dword [esi + 0x34]
lea ecx, [ebp - 0x14]
push 0
push ecx
lea edx, [ebp - 0x18]
push 4
push edx
push edi
mov dword [ebp - 0x18], eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x409f29
lea eax, [ebp - 0x20]
push 0x42f338
push eax
mov dword [ebp - 0x20], str.Write_error_n
call sub.MSVCRT.dll__CxxThrowException
cmp dword [ebp - 0x14], 4
jae 0x409f44
lea ecx, [ebp - 0x24]
push 0x42f338
push ecx
mov dword [ebp - 0x24], str.Write_error_n
call sub.MSVCRT.dll__CxxThrowException
test bl, bl
jne 0x409f91
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
lea edx, [ebp - 0x14]
push 0
push edx
lea eax, [esi + 0x14]
push 4
push eax
push edi
call ebx
test eax, eax
jne 0x409f76
lea ecx, [ebp - 0x28]
push 0x42f338
push ecx
mov dword [ebp - 0x28], str.Write_error_n
call sub.MSVCRT.dll__CxxThrowException
cmp dword [ebp - 0x14], 4
jae 0x409fa1
lea edx, [ebp - 0x2c]
push 0x42f338
push edx
mov dword [ebp - 0x2c], str.Write_error_n
call sub.MSVCRT.dll__CxxThrowException
mov eax, dword [esi + 0x1c]
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [ebp + 0xc], eax
mov esi, dword [eax]
jmp 0x409fa9
mov eax, dword [esi + 0x2c]
mov dword [ebp + 0xc], eax
mov esi, dword [eax]
cmp esi, dword [ebp + 0xc]
je 0x40a023
mov eax, dword [esi + 0xc]
lea ecx, [ebp - 0x14]
push 0
push ecx
lea edx, [ebp + 8]
push 4
push edx
push edi
mov dword [ebp + 8], eax
call ebx
test eax, eax
jne 0x409fdc
lea eax, [ebp - 0x30]
push 0x42f338
push eax
mov dword [ebp - 0x30], str.Write_error_n
call sub.MSVCRT.dll__CxxThrowException
cmp dword [ebp - 0x14], 4
jae 0x409ff7
lea ecx, [ebp - 0x34]
push 0x42f338
push ecx
mov dword [ebp - 0x34], str.Write_error_n
call sub.MSVCRT.dll__CxxThrowException
mov eax, dword [esi + 8]
mov ecx, dword [0x436484]
cmp eax, ecx
je 0x40a00e
mov esi, eax
mov eax, dword [esi]
cmp eax, ecx
jne 0x40a004
jmp 0x409fa9
mov eax, dword [esi + 4]
cmp esi, dword [eax + 8]
jne 0x40a01a
mov esi, eax
jmp 0x40a00e
cmp dword [esi + 8], eax
je 0x409fa9
mov esi, eax
jmp 0x409fa9
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x48]
test ecx, ecx
je 0x40a060
mov al, byte [ecx - 1]
test al, al
je 0x40a056
cmp al, 0xff
je 0x40a056
dec al
mov byte [ecx - 1], al
mov al, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
dec ecx
push ecx
call sub.MFC42.DLL_operatordelete
add esp, 4
mov al, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8