#pragma once #include "types.hpp" #include #include #include #include #include namespace mz { using namespace binparse; struct NotAMZFileException : public std::runtime_error { NotAMZFileException(); }; struct UnexpectedEOS : public std::runtime_error { UnexpectedEOS(); UnexpectedEOS(std::string location); }; struct MZHeader { Magic16 magic; Value16 bytes_in_last_block; Value16 blocks_in_file; Value16 num_relocs; Value16 header_paragraphs; Value16 min_extra_paragraphs; Value16 max_extra_paragraphs; Offset16 ss; Offset16 sp; Value16 checksum; Offset16 ip; Offset16 cs; Offset16 reloc_table_offset; Value16 overlay_number; }; MZHeader parse_file(std::istream& is); std::ostream& operator<<(std::ostream& os, MZHeader const& header); }