summaryrefslogtreecommitdiff
path: root/le/le_object_table_entry.hpp
diff options
context:
space:
mode:
authorDennis Brentjes <d.brentjes@gmail.com>2016-06-22 00:15:08 +0200
committerDennis Brentjes <d.brentjes@gmail.com>2016-06-22 00:16:28 +0200
commit22231518b9c2c0b7f73c72a6ca834df659c63c7f (patch)
tree12b1d20efd3303583649966ddfe135a81ae8109b /le/le_object_table_entry.hpp
parent46145fe7d5b1d9f0921121a088a3d61f968cc473 (diff)
downloadopenwar-22231518b9c2c0b7f73c72a6ca834df659c63c7f.tar.gz
openwar-22231518b9c2c0b7f73c72a6ca834df659c63c7f.tar.bz2
openwar-22231518b9c2c0b7f73c72a6ca834df659c63c7f.zip
Reduces the amount of boilerplate neccesary to parse the binary format.
Diffstat (limited to 'le/le_object_table_entry.hpp')
-rw-r--r--le/le_object_table_entry.hpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/le/le_object_table_entry.hpp b/le/le_object_table_entry.hpp
new file mode 100644
index 0000000..7b97873
--- /dev/null
+++ b/le/le_object_table_entry.hpp
@@ -0,0 +1,42 @@
+#pragma once
+
+#include "types.hpp"
+
+namespace le {
+
+using binparse::Value32;
+using binparse::Offset32;
+
+enum class ObjectFlags {
+ readable = 0x1,
+ writable = 0x2,
+ executable = 0x4,
+ resource = 0x8,
+ discardable = 0x10,
+ shared = 0x20,
+ has_preload_pages = 0x40,
+ has_invalid_pages = 0x80,
+ has_zero_filled_pages = 0x100,
+ is_resident = 0x200,
+ is_resident_and_contiguous = 0x300,
+ is_resident_and_long_lockable = 0x400,
+ alias_16_16_required = 0x1000,
+ big_bit_setting = 0x2000,
+ is_conforming_for_code = 0x4000,
+ IO_privilege_level = 0x8000,
+};
+
+struct ObjectTableEntry {
+ Value32 virtual_size;
+ Offset32 reloc_base_address;
+ Value32 ojbect_flags;
+ Value32 page_table_index;
+ Value32 nr_page_table_entries;
+ Value32 reserved;
+};
+
+ObjectTableEntry parse_object_table_entry(std::istream& is);
+
+std::ostream& operator<<(std::ostream& os, ObjectTableEntry const& entry);
+
+}