9#include "../linker/linker.h"
10#include "../linker/format.h"
11#include "../linker/module.h"
12#include "../linker/reader.h"
13#include "../linker/section.h"
14#include "../linker/segment.h"
15#include "../linker/writer.h"
16#include "../dumper/dumper.h"
58 uint32_t GetFileSize()
const;
103 static Relocation FromLinear(uint32_t address);
105 uint32_t GetOffset()
const;
107 bool operator ==(
const Relocation& other)
const;
109 bool operator <(
const Relocation& other)
const;
118 static constexpr uint32_t MAGIC_BEGIN = 0x0013EDC1;
119 static constexpr uint32_t MAGIC_END = 0xEDC10013;
120 static constexpr size_t SIZE = 19;
123 uint16_t maximum_extra_paragraphs;
124 uint16_t minimum_extra_paragraphs;
126 uint8_t lowest_used_interrupt;
127 uint8_t highest_used_interrupt;
128 uint8_t com_port_usage;
129 uint8_t lpt_port_usage;
130 uint8_t screen_usage;
145 std::shared_ptr<Linker::Writable>
image;
151 void Clear()
override;
158 void SetFileSize(uint32_t size);
160 uint32_t GetHeaderSize();
162 uint32_t GetPifOffset()
const;
208 unsigned FormatAdditionalSectionFlags(std::string section_name)
const override;
210 using LinkerManager::SetLinkScript;
212 void SetModel(std::string model)
override;
214 void SetOptions(std::map<std::string, std::string>& options)
override;
216 void OnNewSegment(std::shared_ptr<Linker::Segment> segment)
override;
240 uint32_t GetDataSize()
const;
250 std::string stub_file;
251 bool stub_file_valid =
true;
255 : stub_file(stub_file)
259 offset_t stub_size = -1;
261 bool OpenAndCheckValidFile();
263 offset_t GetStubImageSize();
265 void WriteStubImage(std::ostream& out);
281 std::string stub_file;
282 bool stub_file_valid =
true;
286 : stub_file(stub_file)
290 uint32_t original_file_size = -1;
291 uint32_t stub_file_size = 0;
292 uint16_t stub_reloc_count = 0;
293 uint32_t original_header_size = 0;
294 uint32_t stub_header_size = 0;
295 uint16_t original_reloc_offset = 0;
296 uint16_t stub_reloc_offset = 0;
298 bool OpenAndCheckValidFile();
300 offset_t GetStubImageSize();
302 void WriteStubImage(std::ostream& out);
A class to control the output of a file analysis.
Definition dumper.h:550
A helper class to collect sections into segments.
Definition linker.h:19
Encodes an object module file as a collection of sections, symbols and relocations.
Definition module.h:20
A helper class, encapsulating functionality needed to import binary data.
Definition reader.h:16
A helper class, encapsulating functionality needed to export binary data.
Definition writer.h:15