Function at 0x403ef0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x42a9d2
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0xc4
mov al, byte [ebp + 0xb]
push ebx
push esi
push edi
mov edi, ecx
mov dword [ebp - 0x10], esp
push 0
lea ecx, [ebp - 0x64]
mov dword [ebp - 0x38], edi
mov byte [ebp - 0x64], 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 esi, dword [ebp + 8]
push 0x4373e8
push esi
mov dword [ebp - 4], 0
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 0x403f58
lea eax, [edi + 0x18]
push eax
jmp 0x403f59
push esi
lea ecx, [ebp - 0x64]
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 - 0x60]
mov byte [ebp - 4], 1
test eax, eax
jne 0x403f72
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 ebx, eax
cmp ebx, 0xffffffff
mov dword [ebp - 0x44], ebx
jne 0x403faa
lea eax, [ebp - 0x40]
push 0x42f348
push eax
mov dword [ebp - 0x40], str.open_file_error
call sub.MSVCRT.dll__CxxThrowException
push 0
push 0
push 0x18
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea ecx, [ebp - 0xd0]
call fcn.00413a80
mov eax, dword [edi + 8]
mov dword [ebp - 0x54], eax
mov esi, dword [eax]
mov dword [ebp - 0x14], 0
cmp esi, eax
je 0x4040e3
mov ecx, dword [esi + 0xc]
lea edx, [ebp - 0x18]
mov dword [ebp - 0x18], ecx
push 4
push edx
lea ecx, [ebp - 0xd0]
call fcn.00413ab0
lea eax, [ebp + 8]
push 0
push eax
lea ecx, [ebp - 0x18]
push 4
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x40401c
lea edx, [ebp - 0x4c]
push 0x42f348
push edx
mov dword [ebp - 0x4c], str.Write_error_n
call sub.MSVCRT.dll__CxxThrowException
cmp dword [ebp + 8], 4
jae 0x404037
lea eax, [ebp - 0x28]
push 0x42f348
push eax
mov dword [ebp - 0x28], str.Write_error_n
call sub.MSVCRT.dll__CxxThrowException
mov edi, dword [esi + 0x10]
push 0x15
push edi
lea ecx, [ebp - 0xd0]
call fcn.00413ab0
lea ecx, [ebp + 8]
push 0
push ecx
push 0x15
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x404071
lea edx, [ebp - 0x48]
push 0x42f348
push edx
mov dword [ebp - 0x48], str.Write_error_n
call sub.MSVCRT.dll__CxxThrowException
cmp dword [ebp + 8], 0x15
jae 0x40408c
lea eax, [ebp - 0x30]
push 0x42f348
push eax
mov dword [ebp - 0x30], str.Write_error_n
call sub.MSVCRT.dll__CxxThrowException
lea ecx, [ebp - 0x50]
call dword [sym.imp.MSVCP60.dll_public:_void___thiscall_std::_Lockit::constructor_void_]
mov eax, dword [esi + 8]
mov ecx, dword [0x43746c]
cmp eax, ecx
mov byte [ebp - 4], 2
je 0x4040b1
push eax
call fcn.00405bb0
add esp, 4
jmp 0x4040c2
mov eax, dword [esi + 4]
cmp esi, dword [eax + 8]
jne 0x4040bd
mov esi, eax
jmp 0x4040b1
cmp dword [esi + 8], eax
je 0x4040c4
mov esi, eax
lea ecx, [ebp - 0x50]
mov byte [ebp - 4], 1
call dword [sym.imp.MSVCP60.dll_public:_void___thiscall_std::_Lockit::destructor_void_]
mov eax, dword [ebp - 0x14]
mov edi, dword [ebp - 0x38]
inc eax
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x54]
jmp 0x403fd1
push 0
push 0
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov esi, dword [sym.imp.KERNEL32.dll_WriteFile]
lea ecx, [ebp + 8]
push 0
push ecx
lea edx, [ebp - 0x14]
push 4
push edx
push ebx
call esi
test eax, eax
jne 0x40411e
lea eax, [ebp - 0x1c]
push 0x42f348
push eax
mov dword [ebp - 0x1c], str.Write_error_n
call sub.MSVCRT.dll__CxxThrowException
cmp dword [ebp + 8], 4
jae 0x404139
lea ecx, [ebp - 0x20]
push 0x42f348
push ecx
mov dword [ebp - 0x20], str.Write_error_n
call sub.MSVCRT.dll__CxxThrowException
lea edx, [ebp + 8]
push 0
push edx
add edi, 0x14
push 4
push edi
push ebx
call esi
test eax, eax
jne 0x404161
lea eax, [ebp - 0x24]
push 0x42f348
push eax
mov dword [ebp - 0x24], str.Write_error_n
call sub.MSVCRT.dll__CxxThrowException
cmp dword [ebp + 8], 4
jae 0x40417c
lea ecx, [ebp - 0x2c]
push 0x42f348
push ecx
mov dword [ebp - 0x2c], str.Write_error_n
call sub.MSVCRT.dll__CxxThrowException
lea edx, [ebp - 0x78]
lea ecx, [ebp - 0xd0]
push edx
call fcn.00413b60
lea eax, [ebp + 8]
push 0
push eax
lea ecx, [ebp - 0x78]
push 0x10
push ecx
push ebx
call esi
test eax, eax
jne 0x4041b3
lea edx, [ebp - 0x34]
push 0x42f348
push edx
mov dword [ebp - 0x34], str.Write_error_n
call sub.MSVCRT.dll__CxxThrowException
cmp dword [ebp + 8], 0x10
jae 0x4041ce
lea eax, [ebp - 0x3c]
push 0x42f348
push eax
mov dword [ebp - 0x3c], str.Write_error_n
call sub.MSVCRT.dll__CxxThrowException
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x60]
test ecx, ecx
je 0x40420b
mov al, byte [ecx - 1]
test al, al
je 0x404201
cmp al, 0xff
je 0x404201
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 4
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 4