From b80a82fcc9edc73057796005cede4eea8380e193 Mon Sep 17 00:00:00 2001 From: Dennis Brentjes Date: Mon, 27 Jun 2016 01:33:02 +0200 Subject: Parses the fixup page and fixup record table. --- le/le_fixup_record_table.hpp | 56 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 le/le_fixup_record_table.hpp (limited to 'le/le_fixup_record_table.hpp') diff --git a/le/le_fixup_record_table.hpp b/le/le_fixup_record_table.hpp new file mode 100644 index 0000000..6a07da5 --- /dev/null +++ b/le/le_fixup_record_table.hpp @@ -0,0 +1,56 @@ +#pragma once + +#include "le_fixup_page_table.hpp" +#include "types.hpp" +#include "variant_output_helper.hpp" //include this before + +#include +#include +#include + +#include +#include + +namespace le { + +using namespace binparse; + +struct FixupRecordTable +{ + struct Entry { + struct Internal { + boost::variant object_number; + boost::variant target_offset; + }; + + struct ImportedOrdinal { + boost::variant ordinal_number; + }; + + struct ImportedName { + boost::variant ordinal_number; + boost::variant procedure_name_offset; + }; + + struct InternalEntry { + boost::variant entry_number; + }; + + Value8 source_flags; + Value8 target_flags; + boost::variant source_offset_or_source_list_count; + boost::variant data; + boost::optional, std::vector>>> additive; + boost::optional> sources; + }; + + std::map> entries; + +}; + +FixupRecordTable::Entry parse(std::istream& is); +FixupRecordTable parse_fixup_record_table(std::istream& is, Offset32 offset, FixupPageTable fixups); + +std::ostream& operator<<(std::ostream& os, FixupRecordTable const& table); + +} \ No newline at end of file -- cgit v1.2.3-70-g09d2