summaryrefslogtreecommitdiff
path: root/le/le_object_table.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'le/le_object_table.cpp')
-rw-r--r--le/le_object_table.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/le/le_object_table.cpp b/le/le_object_table.cpp
index 3e87fb0..7523257 100644
--- a/le/le_object_table.cpp
+++ b/le/le_object_table.cpp
@@ -1,11 +1,33 @@
#include "le_object_table.hpp"
#include "output.hpp"
+#include "parse.hpp"
+
+#include <boost/fusion/adapted/struct.hpp>
#include <iostream>
+BOOST_FUSION_ADAPT_STRUCT(
+ le::ObjectTable::Entry,
+ (binparse::Value32, virtual_size)
+ (binparse::Offset32, reloc_base_address)
+ (binparse::Value32, object_flags)
+ (binparse::Value32, page_table_index)
+ (binparse::Value32, nr_page_table_entries)
+ (binparse::Value32, reserved)
+)
+
namespace le {
+ObjectTable::Entry parse_object_table_entry(std::istream& is) {
+ return parse<ObjectTable::Entry>(is);
+}
+
+std::ostream& operator<<(std::ostream& os, ObjectTable::Entry const& entry)
+{
+ return binparse::operator<<(os, entry);
+}
+
ObjectTable parse_object_table(std::istream& is, Offset32 offset, Value32 nr_objects)
{
is.seekg(0, std::ios::beg);