From 06336eaddcc6a8f9cc578d8f059117c3aa535c9f Mon Sep 17 00:00:00 2001 From: Dennis Brentjes Date: Tue, 5 Jul 2016 17:51:21 +0200 Subject: Made the interface somewhat more consistant. --- binparse/output.cpp | 8 ++++++ binparse/output.hpp | 2 ++ binparse/parse.cpp | 35 +++++++++++++---------- binparse/parse.hpp | 6 ++++ binparse/types.hpp | 4 +++ disasm/disasm.cpp | 26 +++++++++++++++--- le/CMakeLists.txt | 4 --- le/le_entry_table.cpp | 49 +++++++++++++++++++++++++++++++++ le/le_entry_table.hpp | 21 ++++++++++++-- le/le_entry_table_entry.cpp | 55 ------------------------------------- le/le_entry_table_entry.hpp | 33 ---------------------- le/le_fixup_record_table.cpp | 2 -- le/le_object_page_table.cpp | 19 +++++++++++++ le/le_object_page_table.hpp | 21 ++++++++++---- le/le_object_page_table_entry.cpp | 27 ------------------ le/le_object_page_table_entry.hpp | 28 ------------------- le/le_object_table.cpp | 22 +++++++++++++++ le/le_object_table.hpp | 36 ++++++++++++++++++++++-- le/le_object_table_entry.cpp | 31 --------------------- le/le_object_table_entry.hpp | 42 ---------------------------- le/le_resident_name_table.cpp | 19 +++++++++++++ le/le_resident_name_table.hpp | 12 ++++++-- le/le_resident_name_table_entry.cpp | 26 ------------------ le/le_resident_name_table_entry.hpp | 21 -------------- 24 files changed, 249 insertions(+), 300 deletions(-) delete mode 100644 le/le_entry_table_entry.cpp delete mode 100644 le/le_entry_table_entry.hpp delete mode 100644 le/le_object_page_table_entry.cpp delete mode 100644 le/le_object_page_table_entry.hpp delete mode 100644 le/le_object_table_entry.cpp delete mode 100644 le/le_object_table_entry.hpp delete mode 100644 le/le_resident_name_table_entry.cpp delete mode 100644 le/le_resident_name_table_entry.hpp diff --git a/binparse/output.cpp b/binparse/output.cpp index 16447a7..de9db29 100644 --- a/binparse/output.cpp +++ b/binparse/output.cpp @@ -35,6 +35,13 @@ std::ostream& operator<<(std::ostream& os, Offset16 o) { return os << std::hex << std::setw(sizeof(o) * 2) << std::setfill('0') << static_cast(o); } +std::ostream&operator<<(std::ostream& os, Value24 v) +{ + std::array va = v; + uint32_t tv = (va[2] << 16 | va[1] << 8 | va[0] << 0); + return os << std::dec << tv; +} + std::ostream& operator<<(std::ostream& os, Value32 v) { return os << std::dec << static_cast(v); } @@ -63,4 +70,5 @@ std::ostream&operator<<(std::ostream& os, std::vector vec) return os; } + } diff --git a/binparse/output.hpp b/binparse/output.hpp index 3919bef..d942fca 100644 --- a/binparse/output.hpp +++ b/binparse/output.hpp @@ -29,6 +29,8 @@ std::ostream& operator<<(std::ostream& os, Magic16 m); std::ostream& operator<<(std::ostream& os, Value16 v); std::ostream& operator<<(std::ostream& os, Offset16 o); +std::ostream& operator<<(std::ostream& os, Value24 v); + std::ostream& operator<<(std::ostream& os, Value32 v); std::ostream& operator<<(std::ostream& os, Offset32 o); diff --git a/binparse/parse.cpp b/binparse/parse.cpp index a26e72e..de0f04d 100644 --- a/binparse/parse.cpp +++ b/binparse/parse.cpp @@ -79,6 +79,12 @@ Offset16 parse(std::istream& is, std::string name) { return Offset16(parse(is, name)); } +template<> +Value24 parse(std::istream& is, std::__cxx11::string name) +{ + return Value24(parse>(is, name)); +} + template<> Value32 parse(std::istream& is, std::string name) { return Value32(parse(is, name)); @@ -97,13 +103,13 @@ PString8 parse(std::istream& is, std::string name) { return PString8(std::string(data.begin(), data.end())); } -template<> -std::array parse>(std::istream& is, std::string name) { +template +std::array parse(std::istream& is, std::string name) { if(!is) { throw UnexpectedEOS(); } - std::array buffer; + std::array buffer; is.read(reinterpret_cast(buffer.data()), buffer.size()); if(!is) { @@ -113,20 +119,19 @@ std::array parse>(std::istream& is, std::stri return buffer; } +template<> +std::array parse>(std::istream& is, std::string name) { + return parse(is, name); +} + +template<> +std::array parse>(std::istream& is, std::string name) { + return parse(is, name); +} + template<> std::array parse>(std::istream& is, std::string name) { - if(!is) { - throw UnexpectedEOS(); - } - - std::array buffer; - is.read(reinterpret_cast(buffer.data()), buffer.size()); - - if(!is) { - throw UnexpectedEOS(name); - } - - return buffer; + return parse(is, name); } void dump_bytes(std::istream& is, std::vector& buffer, std::string name) diff --git a/binparse/parse.hpp b/binparse/parse.hpp index e02b230..5c641d8 100644 --- a/binparse/parse.hpp +++ b/binparse/parse.hpp @@ -48,6 +48,9 @@ Value16 parse(std::istream& is, std::string name); template<> Offset16 parse(std::istream& is, std::string name); +template<> +Value24 parse(std::istream& is, std::string name); + template<> Value32 parse(std::istream& is, std::string name); @@ -57,6 +60,9 @@ Offset32 parse(std::istream& is, std::string name); template<> PString8 parse(std::istream& is, std::string name); +template<> +std::array parse>(std::istream& is, std::string name); + template<> std::array parse>(std::istream& is, std::string name); diff --git a/binparse/types.hpp b/binparse/types.hpp index d1b1910..5d7f7d7 100644 --- a/binparse/types.hpp +++ b/binparse/types.hpp @@ -3,6 +3,7 @@ #include #include +#include namespace binparse { @@ -19,6 +20,9 @@ BOOST_STRONG_TYPEDEF(uint32_t, Value32) BOOST_STRONG_TYPEDEF(std::string, PString8); +typedef std::array uint24_t; +BOOST_STRONG_TYPEDEF(uint24_t, Value24); + template T operator+(T const lh, T const rh) { return T(0 + lh + rh); diff --git a/disasm/disasm.cpp b/disasm/disasm.cpp index 609794e..862813c 100644 --- a/disasm/disasm.cpp +++ b/disasm/disasm.cpp @@ -8,6 +8,7 @@ #include #include +#include int main(int argc, char* argv[]) { boost::program_options::options_description description; @@ -58,11 +59,28 @@ int main(int argc, char* argv[]) { std::basic_ifstream code_file(file_path.string()); std::vector code(std::istreambuf_iterator(code_file), {}); - _DecodedInst inst; + std::vector<_DecodedInst> instructions; + instructions.resize(100000); unsigned int read_inst; + + auto eip_object = x.object_table.entries[x.le_header.EIP_object]; + auto index = eip_object.page_table_index; + auto page = x.object_page_table.entries[index]; - auto result = distorm_decode64(x.mz_header.ip, code.data(), 1, Decode16Bits, &inst, 1, &read_inst); + binparse::Offset32 offset = x.le_offset + x.le_header.data_page_offset; - std::cout << inst.mnemonic.p << " " << inst.operands.p << std::endl; - + auto result = distorm_decode64(0x00010000, code.data() + offset, x.object_table.entries[1].nr_page_table_entries * x.le_header.page_size, Decode32Bits, instructions.data(), instructions.size(), &read_inst); + + instructions.resize(read_inst); + instructions.shrink_to_fit(); + + if(result) { + + } + + for(auto&& inst : instructions) { + std::cout << std::hex << std::setw(8) << std::setfill('0') << inst.offset << ":\t" << inst.mnemonic.p << " " << inst.operands.p << std::endl; + } + + return 0; } diff --git a/le/CMakeLists.txt b/le/CMakeLists.txt index a453669..6bea735 100644 --- a/le/CMakeLists.txt +++ b/le/CMakeLists.txt @@ -3,15 +3,11 @@ add_library(le STATIC le_header.hpp le_header.cpp le_file.hpp le_file.cpp le_object_table.hpp le_object_table.cpp - le_object_table_entry.hpp le_object_table_entry.cpp le_object_page_table.hpp le_object_page_table.cpp - le_object_page_table_entry.hpp le_object_page_table_entry.cpp le_object_iterate_data_map_table.hpp le_object_iterate_data_map_table.cpp le_resource_table.hpp le_resource_table.cpp le_resident_name_table.hpp le_resident_name_table.cpp - le_resident_name_table_entry.hpp le_resident_name_table_entry.cpp le_entry_table.hpp le_entry_table.cpp - le_entry_table_entry.hpp le_entry_table_entry.cpp le_fixup_page_table.hpp le_fixup_page_table.cpp le_fixup_record_table.hpp le_fixup_record_table.cpp ) diff --git a/le/le_entry_table.cpp b/le/le_entry_table.cpp index 28f901d..6e8b0c7 100644 --- a/le/le_entry_table.cpp +++ b/le/le_entry_table.cpp @@ -1,9 +1,58 @@ #include "le_entry_table.hpp" +#include "parse.hpp" #include "output.hpp" +#include "boost/fusion/adapted/struct.hpp" + +typedef boost::variant EntryT; + +BOOST_FUSION_ADAPT_STRUCT( + le::EntryTable::Entry::EntryPoint, + (binparse::Value8, flags) + (EntryT, entry) +) + +BOOST_FUSION_ADAPT_STRUCT( + le::EntryTable::Entry, + (binparse::Value8, nr_entries) + (binparse::Value8, flags) + (binparse::Value16, object_index) + (std::vector, entries) +) + namespace le { +EntryTable::Entry parse_entry_table_entry(std::istream& is) { + EntryTable::Entry entry; + + entry.nr_entries = binparse::parse(is, "nr_entries"); + entry.flags = binparse::parse(is, "flags"); + entry.object_index = binparse::parse(is, "object_index"); + + for(Value8 i = Value8(0); i < entry.nr_entries; i++) { + if(entry.flags & 2) { + entry.entries.push_back({ + binparse::parse(is, "flags"), + binparse::parse(is, "entry") + }); + } else { + entry.entries.push_back({ + binparse::parse(is, "flags"), + binparse::parse(is, "entry") + }); + } + } + + return entry; +} + +std::ostream& operator<<(std::ostream& os, EntryTable::Entry const& entry) +{ + return binparse::operator<<(os, entry); +} + + EntryTable parse_entry_table(std::istream& is, binparse::Offset32 offset) { is.seekg(0, std::ios::beg); diff --git a/le/le_entry_table.hpp b/le/le_entry_table.hpp index f31f542..ad2bbe5 100644 --- a/le/le_entry_table.hpp +++ b/le/le_entry_table.hpp @@ -1,15 +1,32 @@ #pragma once -#include "le_entry_table_entry.hpp" +#include "types.hpp" + +#include #include #include +#include namespace le { +using namespace binparse; + struct EntryTable { - std::map entries; + struct Entry { + struct EntryPoint { + Value8 flags; + boost::variant entry; + }; + + Value8 nr_entries; + Value8 flags; + Value16 object_index; + std::vector entries; + }; + + std::map entries; }; EntryTable parse_entry_table(std::istream& is, binparse::Offset32 offset); diff --git a/le/le_entry_table_entry.cpp b/le/le_entry_table_entry.cpp deleted file mode 100644 index 4894ec0..0000000 --- a/le/le_entry_table_entry.cpp +++ /dev/null @@ -1,55 +0,0 @@ -#include "le_entry_table_entry.hpp" - -#include "parse.hpp" -#include "output.hpp" - -#include - -typedef boost::variant EntryT; - -BOOST_FUSION_ADAPT_STRUCT( - le::EntryPoint, - (binparse::Value8, flags) - (EntryT, entry) -) - -BOOST_FUSION_ADAPT_STRUCT( - le::EntryTableEntry, - (binparse::Value8, nr_entries) - (binparse::Value8, flags) - (binparse::Value16, object_index) - (std::vector, entries) -) - -namespace le { - -EntryTableEntry parse_entry_table_entry(std::istream& is) { - EntryTableEntry entry; - - entry.nr_entries = binparse::parse(is, "nr_entries"); - entry.flags = binparse::parse(is, "flags"); - entry.object_index = binparse::parse(is, "object_index"); - - for(Value8 i = Value8(0); i < entry.nr_entries; i++) { - if(entry.flags & 2) { - entry.entries.push_back({ - binparse::parse(is, "flags"), - binparse::parse(is, "entry") - }); - } else { - entry.entries.push_back({ - binparse::parse(is, "flags"), - binparse::parse(is, "entry") - }); - } - } - - return entry; -} - -std::ostream&operator<<(std::ostream& os, const EntryTableEntry& entry) -{ - return binparse::operator<<(os, entry); -} - -} \ No newline at end of file diff --git a/le/le_entry_table_entry.hpp b/le/le_entry_table_entry.hpp deleted file mode 100644 index 209c1bb..0000000 --- a/le/le_entry_table_entry.hpp +++ /dev/null @@ -1,33 +0,0 @@ -#pragma once - -#include "types.hpp" - -#include - -#include - -namespace le { - -using binparse::Value8; -using binparse::Value16; -using binparse::Offset16; -using binparse::Offset32; - -struct EntryPoint { - binparse::Value8 flags; - boost::variant entry; -}; - -struct EntryTableEntry { - - Value8 nr_entries; - Value8 flags; - Value16 object_index; - std::vector entries; -}; - -EntryTableEntry parse_entry_table_entry(std::istream& is); - -std::ostream& operator<<(std::ostream& os, EntryTableEntry const& entry); - -} diff --git a/le/le_fixup_record_table.cpp b/le/le_fixup_record_table.cpp index 9331626..51dee60 100644 --- a/le/le_fixup_record_table.cpp +++ b/le/le_fixup_record_table.cpp @@ -222,8 +222,6 @@ FixupRecordTable parse_fixup_record_table(std::istream& is, Offset32 offset, Fix auto x = parse(is); table.entries[Value32(i)].push_back(x); } - - } return table; diff --git a/le/le_object_page_table.cpp b/le/le_object_page_table.cpp index d8fd290..9843689 100644 --- a/le/le_object_page_table.cpp +++ b/le/le_object_page_table.cpp @@ -3,8 +3,27 @@ #include "parse.hpp" #include "output.hpp" +#include + +BOOST_FUSION_ADAPT_STRUCT( + le::ObjectPageTable::Entry, + (binparse::Value16, high) + (binparse::Value8, low) + (binparse::Value8, flags) +) + namespace le { +ObjectPageTable::Entry parse_object_page_table_entry(std::istream& is) +{ + return binparse::parse(is); +} + +std::ostream& operator<<(std::ostream& os, ObjectPageTable::Entry const& entry) +{ + return binparse::operator<<(os, entry); +} + ObjectPageTable parse_object_page_table(std::istream& is, binparse::Offset32 offset, binparse::Value32 nr_pages) { is.seekg(0, std::ios::beg); diff --git a/le/le_object_page_table.hpp b/le/le_object_page_table.hpp index 08a67e6..da464b5 100644 --- a/le/le_object_page_table.hpp +++ b/le/le_object_page_table.hpp @@ -2,18 +2,29 @@ #include "types.hpp" -#include "le_object_page_table_entry.hpp" - #include namespace le { -using binparse::Value32; -using binparse::Offset32; +using namespace binparse; struct ObjectPageTable { - std::map entries; + struct Entry { + enum class object_page_flags { + legal_physical = 0, + iteration_data = 1, + invalid = 2, + zero_filled = 3, + range_of = 4 + }; + + Value16 high; + Value8 low; + Value8 flags; + }; + + std::map entries; }; ObjectPageTable parse_object_page_table(std::istream& is, Offset32 offset, Value32 nr_pages); diff --git a/le/le_object_page_table_entry.cpp b/le/le_object_page_table_entry.cpp deleted file mode 100644 index 73bdb61..0000000 --- a/le/le_object_page_table_entry.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include "le_object_page_table_entry.hpp" - -#include "parse.hpp" -#include "output.hpp" - -#include - -BOOST_FUSION_ADAPT_STRUCT( - le::ObjectPageTableEntry, - (binparse::Offset16, high_page_number) - (binparse::Value8, low_page_number) - (binparse::Value8, flags) -) - -namespace le { - -ObjectPageTableEntry parse_object_page_table_entry(std::istream& is) -{ - return binparse::parse(is); -} - -std::ostream& operator<<(std::ostream& os, const ObjectPageTableEntry& entry) -{ - return binparse::operator<<(os, entry); -} - -} \ No newline at end of file diff --git a/le/le_object_page_table_entry.hpp b/le/le_object_page_table_entry.hpp deleted file mode 100644 index 3254365..0000000 --- a/le/le_object_page_table_entry.hpp +++ /dev/null @@ -1,28 +0,0 @@ -#pragma once - -#include "types.hpp" - -namespace le { - -using binparse::Offset16; -using binparse::Value8; - -enum class object_page_flags { - legal_physical = 0, - iteration_data = 1, - invalid = 2, - zero_filled = 3, - range_of = 4 -}; - -struct ObjectPageTableEntry { - Offset16 high_page_number; - Value8 low_page_number; - Value8 flags; -}; - -ObjectPageTableEntry parse_object_page_table_entry(std::istream& is); - -std::ostream& operator<<(std::ostream& os, ObjectPageTableEntry const& entry); - -} 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 #include +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(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); diff --git a/le/le_object_table.hpp b/le/le_object_table.hpp index c840734..c3f584d 100644 --- a/le/le_object_table.hpp +++ b/le/le_object_table.hpp @@ -1,13 +1,43 @@ #pragma once -#include "le_object_table_entry.hpp" +#include "types.hpp" #include namespace le { -struct ObjectTable { - std::map entries; +using namespace binparse; + +struct ObjectTable { + struct Entry { + 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, + }; + + Value32 virtual_size; + Offset32 reloc_base_address; + Value32 object_flags; + Value32 page_table_index; + Value32 nr_page_table_entries; + Value32 reserved; + }; + + std::map entries; }; ObjectTable parse_object_table(std::istream& is, Offset32 offset, Value32 nr_objects); diff --git a/le/le_object_table_entry.cpp b/le/le_object_table_entry.cpp deleted file mode 100644 index 68e77ba..0000000 --- a/le/le_object_table_entry.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include "le_object_table_entry.hpp" - -#include "parse.hpp" -#include "output.hpp" - -#include - -BOOST_FUSION_ADAPT_STRUCT( - le::ObjectTableEntry, - (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 { - -ObjectTableEntry parse_object_table_entry(std::istream& is) { - using binparse::parse; - - return parse(is); -} - -std::ostream& operator<<(std::ostream& os, const ObjectTableEntry& entry) -{ - return binparse::operator<<(os, entry); -} - -} diff --git a/le/le_object_table_entry.hpp b/le/le_object_table_entry.hpp deleted file mode 100644 index c456a15..0000000 --- a/le/le_object_table_entry.hpp +++ /dev/null @@ -1,42 +0,0 @@ -#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 object_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); - -} diff --git a/le/le_resident_name_table.cpp b/le/le_resident_name_table.cpp index bc34999..4633431 100644 --- a/le/le_resident_name_table.cpp +++ b/le/le_resident_name_table.cpp @@ -1,9 +1,28 @@ #include "le_resident_name_table.hpp" +#include "parse.hpp" #include "output.hpp" +#include + +BOOST_FUSION_ADAPT_STRUCT( + le::ResidentNameTable::Entry, + (binparse::PString8, string) + (binparse::Value16, index) +) + namespace le { +ResidentNameTable::Entry parse_resident_name_table_entry(std::istream& is) +{ + return binparse::parse(is); +} + +std::ostream&operator<<(std::ostream& os, ResidentNameTable::Entry const& entry) +{ + return binparse::operator<<(os, entry); +} + ResidentNameTable parse_resident_name_table(std::istream& is, binparse::Offset32 offset) { is.seekg(0, std::ios::beg); diff --git a/le/le_resident_name_table.hpp b/le/le_resident_name_table.hpp index aa81577..1369383 100644 --- a/le/le_resident_name_table.hpp +++ b/le/le_resident_name_table.hpp @@ -1,14 +1,22 @@ #pragma once -#include "le_resident_name_table_entry.hpp" +#include "types.hpp" #include #include namespace le { +using namespace binparse; + struct ResidentNameTable { - std::vector entries; + + struct Entry { + PString8 string; + Value16 index; + }; + + std::vector entries; }; ResidentNameTable parse_resident_name_table(std::istream& is, binparse::Offset32 offset); diff --git a/le/le_resident_name_table_entry.cpp b/le/le_resident_name_table_entry.cpp deleted file mode 100644 index a82cbeb..0000000 --- a/le/le_resident_name_table_entry.cpp +++ /dev/null @@ -1,26 +0,0 @@ -#include "le_resident_name_table_entry.hpp" - -#include "parse.hpp" -#include "output.hpp" - -#include - -BOOST_FUSION_ADAPT_STRUCT( - le::ResidentNameTableEntry, - (binparse::PString8, string) - (binparse::Value16, index) -) - -namespace le { - -ResidentNameTableEntry parse_resident_name_table_entry(std::istream& is) -{ - return binparse::parse(is); -} - -std::ostream&operator<<(std::ostream& os, ResidentNameTableEntry const& entry) -{ - return binparse::operator<<(os, entry); -} - -} \ No newline at end of file diff --git a/le/le_resident_name_table_entry.hpp b/le/le_resident_name_table_entry.hpp deleted file mode 100644 index 95c83bc..0000000 --- a/le/le_resident_name_table_entry.hpp +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once - -#include "types.hpp" - -#include - -namespace le { - -using binparse::PString8; -using binparse::Value16; - -struct ResidentNameTableEntry { - PString8 string; - Value16 index; -}; - -ResidentNameTableEntry parse_resident_name_table_entry(std::istream& is); - -std::ostream& operator<<(std::ostream& os, ResidentNameTableEntry const& entry); - -} \ No newline at end of file -- cgit v1.2.3-70-g09d2