summaryrefslogtreecommitdiff
path: root/le/le_fixup_record_table.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'le/le_fixup_record_table.hpp')
-rw-r--r--le/le_fixup_record_table.hpp56
1 files changed, 56 insertions, 0 deletions
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 <boost/variant>
+
+#include <boost/variant.hpp>
+#include <boost/optional.hpp>
+#include <boost/optional/optional_io.hpp>
+
+#include <vector>
+#include <map>
+
+namespace le {
+
+using namespace binparse;
+
+struct FixupRecordTable
+{
+ struct Entry {
+ struct Internal {
+ boost::variant<Value8,Value16> object_number;
+ boost::variant<Offset16, Offset32> target_offset;
+ };
+
+ struct ImportedOrdinal {
+ boost::variant<Value8, Value16> ordinal_number;
+ };
+
+ struct ImportedName {
+ boost::variant<Value8, Value16> ordinal_number;
+ boost::variant<Offset16, Offset32> procedure_name_offset;
+ };
+
+ struct InternalEntry {
+ boost::variant<Value8, Value16> entry_number;
+ };
+
+ Value8 source_flags;
+ Value8 target_flags;
+ boost::variant<Offset16, Value8> source_offset_or_source_list_count;
+ boost::variant<Internal, ImportedOrdinal, ImportedName, InternalEntry> data;
+ boost::optional<boost::variant<boost::variant<Offset16, Offset32>, std::vector<boost::variant<Offset16, Offset32>>>> additive;
+ boost::optional<std::vector<Value16>> sources;
+ };
+
+ std::map<Value32, std::vector<Entry>> 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