summaryrefslogtreecommitdiff
path: root/reversing
diff options
context:
space:
mode:
authorQuietust2012-03-03 14:14:09 -0600
committerQuietust2012-03-03 14:14:09 -0600
commit3ae622b0ffb9002a053664bad9ebb57532515be7 (patch)
tree1c8cfc963b17971237ecd20fd1eb4e061b7a88c9 /reversing
parente43a87b13b70e11b518eac450cc5f789d04badcb (diff)
downloaddfhack-3ae622b0ffb9002a053664bad9ebb57532515be7.tar.gz
dfhack-3ae622b0ffb9002a053664bad9ebb57532515be7.tar.bz2
dfhack-3ae622b0ffb9002a053664bad9ebb57532515be7.tar.xz
BaseClassDescriptor includes a pointer back to ClassHierarchyDescriptor - parse it
Diffstat (limited to 'reversing')
-rw-r--r--reversing/ms_rtti.idc14
1 files changed, 13 insertions, 1 deletions
diff --git a/reversing/ms_rtti.idc b/reversing/ms_rtti.idc
index 052751f2..658645f2 100644
--- a/reversing/ms_rtti.idc
+++ b/reversing/ms_rtti.idc
@@ -293,6 +293,7 @@ struct _s_RTTIBaseClassDescriptor
DWORD numContainedBases; //number of nested classes following in the array
struct PMD where; //some displacement info
DWORD attributes; //usually 0, sometimes 10h
+ struct _s_RTTIClassHierarchyDescriptor *pClassHierarchyDescriptor; //of this base class
};
struct PMD
@@ -314,6 +315,15 @@ struct PMD
DwordCmt(x+4, "numContainedBases");
DwordArrayCmt(x+8, 3, "PMD where");
DwordCmt(x+20, "attributes");
+ OffCmt(x+24, "pClassHierarchyDescriptor");
+
+ if(substr(Name(Dword(x+24)),0,5) != "??_R3")
+ {
+ // assign dummy name to prevent infinite recursion
+ MakeName(Dword(x+24),"??_R3"+form("%06x",x)+"@@8");
+ // a proper name will be assigned shortly
+ Parse_CHD(Dword(x+24),indent-1);
+ }
s = Parse_TD(Dword(x), indent+1);
//??_R1A@?0A@A@B@@8 = B::`RTTI Base Class Descriptor at (0,-1,0,0)'
@@ -414,9 +424,11 @@ static Parse_CHD(x, indent)
i=0;
DumpNestedClass(a, indent, n);
indent=indent+1;
- while(i<n)
+ while(i<=n)
{
p = Dword(a);
+ if (i==n && p!=0)
+ break;
//Message(indent_str+" BaseClass[%02d]: %08.8Xh\n", i, p);
OffCmt(a, form("BaseClass[%02d]", i));
if (i==0)