9#include "../linker/format.h"
10#include "../linker/module.h"
11#include "../linker/options.h"
12#include "../linker/reader.h"
13#include "../linker/section.h"
14#include "../linker/segment.h"
15#include "../linker/segment_manager.h"
16#include "../linker/writer.h"
17#include "../dumper/dumper.h"
104 static Relocation FromLinear(uint32_t address);
106 uint32_t GetOffset()
const;
108 bool operator ==(
const Relocation& other)
const;
110 bool operator <(
const Relocation& other)
const;
119 static constexpr uint32_t MAGIC_BEGIN = 0x0013EDC1;
120 static constexpr uint32_t MAGIC_END = 0xEDC10013;
121 static constexpr size_t SIZE = 19;
124 uint16_t maximum_extra_paragraphs;
125 uint16_t minimum_extra_paragraphs;
127 uint8_t lowest_used_interrupt;
128 uint8_t highest_used_interrupt;
129 uint8_t com_port_usage;
130 uint8_t lpt_port_usage;
131 uint8_t screen_usage;
146 std::shared_ptr<Linker::Image>
image;
152 void Clear()
override;
159 void SetFileSize(uint32_t size);
161 uint32_t GetHeaderSize()
const;
163 uint32_t GetPifOffset()
const;
184 InitializeFields(header_align, file_align);
224 unsigned FormatAdditionalSectionFlags(std::string section_name)
const override;
226 static std::vector<Linker::OptionDescription<void>> MemoryModelNames;
230 void SetModel(std::string model)
override;
232 std::shared_ptr<Linker::OptionCollector>
GetOptions()
override;
234 void SetOptions(std::map<std::string, std::string>& options)
override;
236 void OnNewSegment(std::shared_ptr<Linker::Segment> segment)
override;
260 uint32_t GetDataSize()
const;
271 std::string filename;
273 std::ifstream stream;
282 bool OpenAndCheckValidFile();
284 offset_t GetStubImageSize();
286 void WriteStubImage(std::ostream& out);
302 std::string filename;
304 std::ifstream stream;
311 uint32_t original_file_size = -1;
312 uint32_t stub_file_size = 0;
313 uint16_t stub_reloc_count = 0;
314 uint32_t original_header_size = 0;
315 uint32_t stub_header_size = 0;
316 uint16_t original_reloc_offset = 0;
317 uint16_t stub_reloc_offset = 0;
319 bool OpenAndCheckValidFile();
321 offset_t GetStubImageSize();
323 void WriteStubImage(std::ostream& out);
An abstract interface that separates structure and presentation of the data inside a file.
Definition dumper.h:586
Encodes an object module file as a collection of sections, symbols and relocations.
Definition module.h:24
Helper class that contains the options interpreted by the format.
Definition options.h:308
Documents and handles command line options.
Definition options.h:196
A helper class, encapsulating functionality needed to import binary data.
Definition reader.h:16
A helper class to collect sections into segments.
Definition segment_manager.h:32
A helper class, encapsulating functionality needed to export binary data.
Definition writer.h:15