mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 10:19:23 +02:00
GP-1095 Fixed duplicate name graph issues in RecoverClassesFromRTTIScript and GraphClassesScript. Fixed class name parsing flaws in GraphClassesScript.
This commit is contained in:
parent
879a249fb1
commit
90c517fcf9
3 changed files with 172 additions and 42 deletions
|
@ -114,7 +114,7 @@ public class RecoverClassesFromRTTIScript extends GhidraScript {
|
|||
// multiple parents = red vertex
|
||||
// edge between child and parent is orange if child inherits the parent virtually
|
||||
// edge between child and parent is lime green if child inherits the parent non-virtually
|
||||
private static final boolean GRAPH_CLASS_HIERARCHIES = false;
|
||||
private static final boolean GRAPH_CLASS_HIERARCHIES = true;
|
||||
|
||||
// show shortened class template names in class structure field names
|
||||
private static final boolean USE_SHORT_TEMPLATE_NAMES_IN_STRUCTURE_FIELDS = true;
|
||||
|
@ -348,7 +348,8 @@ public class RecoverClassesFromRTTIScript extends GhidraScript {
|
|||
|
||||
RecoveredClass recoveredClass = recoveredClassIterator.next();
|
||||
|
||||
AttributedVertex classVertex = g.addVertex(recoveredClass.getName());
|
||||
AttributedVertex classVertex =
|
||||
g.addVertex(recoveredClass.getClassPath().getPath(), recoveredClass.getName());
|
||||
|
||||
Map<RecoveredClass, List<RecoveredClass>> classHierarchyMap =
|
||||
recoveredClass.getClassHierarchyMap();
|
||||
|
@ -356,6 +357,7 @@ public class RecoverClassesFromRTTIScript extends GhidraScript {
|
|||
// no parent = blue vertex
|
||||
if (classHierarchyMap.isEmpty()) {
|
||||
classVertex.setAttribute("Color", "Blue");
|
||||
classVertex.setDescription(recoveredClass.getClassPath().getPath());
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -370,6 +372,8 @@ public class RecoverClassesFromRTTIScript extends GhidraScript {
|
|||
classVertex.setAttribute("Color", "Red");
|
||||
}
|
||||
|
||||
classVertex.setDescription(recoveredClass.getClassPath().getPath());
|
||||
|
||||
Map<RecoveredClass, Boolean> parentToBaseTypeMap =
|
||||
recoveredClass.getParentToBaseTypeMap();
|
||||
|
||||
|
@ -378,7 +382,10 @@ public class RecoverClassesFromRTTIScript extends GhidraScript {
|
|||
monitor.checkCanceled();
|
||||
RecoveredClass parent = parentIterator.next();
|
||||
|
||||
AttributedVertex parentVertex = g.addVertex(parent.getName());
|
||||
AttributedVertex parentVertex =
|
||||
g.addVertex(parent.getClassPath().getPath(), parent.getName());
|
||||
|
||||
parentVertex.setDescription(parent.getClassPath().getPath());
|
||||
|
||||
AttributedEdge edge = g.addEdge(parentVertex, classVertex);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue