diff --git a/data/Memory-ng.xml b/data/Memory-ng.xml index b35de2f82..702d1a273 100644 --- a/data/Memory-ng.xml +++ b/data/Memory-ng.xml @@ -1784,6 +1784,92 @@ + + + + + +
+ +
+
+ + + + +
+
+
+
+
+ + +
+ + + + +
+ + +
+ + + +
+
+ + + + 0x016a12c0 vector + + +
MAYBE... THE DETAILS WILL BE DIFFERENT +
+ WTF IS THIS, I DON'T EVEN... +
+
+
+ + +
+ + +
+
+ + + + +
+ List of offsets in the VTable : + + + + + + + + + + (in the vtable) + + +
+
+
+ + + .-"""-. ' \ diff --git a/library/VersionInfo.cpp b/library/VersionInfo.cpp index f63dc0930..7773b7470 100644 --- a/library/VersionInfo.cpp +++ b/library/VersionInfo.cpp @@ -180,6 +180,18 @@ void OffsetGroup::setOffset (const string & key, const string & value, const INV else throw Error::MissingMemoryDefinition("offset", getFullName() + key); } +void OffsetGroup::setOffsetValidity (const string & key, const INVAL_TYPE inval) +{ + if(inval != NOT_SET) + { + int32_Iter it = OGd->offsets.find(key); + if(it != OGd->offsets.end()) + { + (*it).second.first = inval; + } + else throw Error::MissingMemoryDefinition("offset", getFullName() + key); + } +} void OffsetGroup::setAddress (const string & key, const string & value, const INVAL_TYPE inval) { @@ -194,6 +206,19 @@ void OffsetGroup::setAddress (const string & key, const string & value, const IN else throw Error::MissingMemoryDefinition("address", getFullName() + key); } +void OffsetGroup::setAddressValidity (const string & key, const INVAL_TYPE inval) +{ + if(inval != NOT_SET) + { + uint32_Iter it = OGd->addresses.find(key); + if(it != OGd->addresses.end()) + { + (*it).second.first = inval; + } + else throw Error::MissingMemoryDefinition("address", getFullName() + key); + } +} + void OffsetGroup::setHexValue (const string & key, const string & value, const INVAL_TYPE inval) { @@ -207,6 +232,18 @@ void OffsetGroup::setHexValue (const string & key, const string & value, const I else throw Error::MissingMemoryDefinition("hexvalue", getFullName() + key); } +void OffsetGroup::setHexValueValidity (const string & key, const INVAL_TYPE inval) +{ + if(inval != NOT_SET) + { + uint32_Iter it = OGd->hexvals.find(key); + if(it != OGd->hexvals.end()) + { + (*it).second.first = inval; + } + else throw Error::MissingMemoryDefinition("hexvalue", getFullName() + key); + } +} void OffsetGroup::setString (const string & key, const string & value, const INVAL_TYPE inval) { @@ -220,6 +257,18 @@ void OffsetGroup::setString (const string & key, const string & value, const INV else throw Error::MissingMemoryDefinition("string", getFullName() + key); } +void OffsetGroup::setStringValidity (const string & key, const INVAL_TYPE inval) +{ + if(inval != NOT_SET) + { + strings_Iter it = OGd->strings.find(key); + if(it != OGd->strings.end()) + { + (*it).second.first = inval; + } + else throw Error::MissingMemoryDefinition("string", getFullName() + key); + } +} // Get named address uint32_t OffsetGroup::getAddress (const string & key) diff --git a/library/VersionInfoFactory.cpp b/library/VersionInfoFactory.cpp index 686a426e4..e74ca2b44 100644 --- a/library/VersionInfoFactory.cpp +++ b/library/VersionInfoFactory.cpp @@ -292,7 +292,7 @@ void VersionInfoFactory::ParseOffsets(TiXmlElement * parent, VersionInfo* target } else { - // ERROR, missing attribute + currentGroup->setAddressValidity(cstr_name, child_inval); } } else if(type == "offset") @@ -309,7 +309,7 @@ void VersionInfoFactory::ParseOffsets(TiXmlElement * parent, VersionInfo* target } else { - // ERROR, missing attribute + currentGroup->setOffsetValidity(cstr_name, child_inval); } } else if(type == "string") @@ -326,7 +326,7 @@ void VersionInfoFactory::ParseOffsets(TiXmlElement * parent, VersionInfo* target } else { - // ERROR, missing attribute + currentGroup->setStringValidity(cstr_name, child_inval); } } else if(type == "hexvalue") @@ -343,7 +343,7 @@ void VersionInfoFactory::ParseOffsets(TiXmlElement * parent, VersionInfo* target } else { - // ERROR, missing attribute + currentGroup->setHexValueValidity(cstr_name, child_inval); } } diff --git a/library/include/dfhack/VersionInfo.h b/library/include/dfhack/VersionInfo.h index e01b8f115..b5c7dac14 100644 --- a/library/include/dfhack/VersionInfo.h +++ b/library/include/dfhack/VersionInfo.h @@ -76,9 +76,13 @@ namespace DFHack OffsetGroup * getGroup ( const std::string & name ); void setOffset (const std::string& key, const std::string& value, const DFHack::INVAL_TYPE inval = IS_VALID); + void setOffsetValidity(const std::string& key, const DFHack::INVAL_TYPE inval = IS_VALID); void setAddress (const std::string& key, const std::string& value, const DFHack::INVAL_TYPE inval = IS_VALID); + void setAddressValidity(const std::string& key, const DFHack::INVAL_TYPE inval = IS_VALID); void setHexValue (const std::string& key, const std::string& value, const DFHack::INVAL_TYPE inval = IS_VALID); + void setHexValueValidity(const std::string& key, const DFHack::INVAL_TYPE inval = IS_VALID); void setString (const std::string& key, const std::string& value, const DFHack::INVAL_TYPE inval = IS_VALID); + void setStringValidity(const std::string& key, const DFHack::INVAL_TYPE inval = IS_VALID); std::string PrintOffsets(int indentation); std::string getName(); std::string getFullName();