5#include "../dumper/dumper.h"
6#include "../linker/options.h"
7#include "../linker/reader.h"
8#include "../linker/segment_manager.h"
9#include "../linker/writer.h"
50 ACCESS_TYPE_EMPTY = 0x00,
51 ACCESS_TYPE_TSS16_A = 0x01,
52 ACCESS_TYPE_LDT = 0x02,
53 ACCESS_TYPE_TSS16_B = 0x03,
54 ACCESS_TYPE_CALLGATE16 = 0x04,
55 ACCESS_TYPE_TASKGATE = 0x05,
56 ACCESS_TYPE_INTGATE16 = 0x06,
57 ACCESS_TYPE_TRAPGATE16 = 0x07,
59 ACCESS_TYPE_TSS32_A = 0x09,
61 ACCESS_TYPE_TSS32_B = 0x0B,
62 ACCESS_TYPE_CALLGATE32 = 0x0C,
64 ACCESS_TYPE_INTGATE32 = 0x0E,
65 ACCESS_TYPE_TRAPGATE32 = 0x0F,
81 Segment(uint32_t base, uint32_t limit, uint8_t access, uint8_t flags)
82 : base(base), limit(limit), access(access), flags(flags)
91 uint32_t ldt_offset = 0;
92 uint32_t image_offset = 0;
93 uint32_t relocation_offset = 0;
94 uint32_t relocation_count = 0;
95 uint32_t minimum_extent = 0;
96 uint32_t maximum_extent = 0;
97 uint32_t unknown_field = 0;
98 uint32_t gs = 0, fs = 0, ds = 0, ss = 0, cs = 0, es = 0, edi = 0, esi = 0, ebp = 0, esp = 0, ebx = 0, edx = 0, ecx = 0, eax = 0, eflags = 0, eip = 0;
99 std::vector<Segment> ldt;
100 std::shared_ptr<Linker::Image> image;
102 void Clear()
override;
116 Linker::Option<bool> no_intermediate_selector{
"nointer",
"Do not generate selectors for segments inside groups"};
120 InitializeFields(stub, dual_selector, no_intermediate_selector);
132 Wordsize wordsize = Unknown;
164 static std::vector<Linker::OptionDescription<void>> MemoryModelNames;
168 void SetModel(std::string model)
override;
170 std::shared_ptr<Linker::OptionCollector>
GetOptions()
override;
172 void SetOptions(std::map<std::string, std::string>& options)
override;
174 void OnNewSegment(std::shared_ptr<Linker::Segment> segment)
override;
191 std::shared_ptr<Linker::Segment> GetImageSegment();
196 size_t first_section;
197 size_t section_count;
199 offset_t GetStartAddress(
XPFormat * format)
const;
200 offset_t GetLength(
XPFormat * format)
const;
202 std::vector<Group> section_groups;
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