Skip to content

How do you go through all the classes and its "members" in the scripting api? #2971

Answered by astrelsky
matcool asked this question in Q&A
Discussion options

You must be logged in to vote

I believe you are looking for SymbolTable.getClassNamespaces. The SymbolTable may be obtained from the scripting api via currentProgram.getSymbolTable(). Then for each GhidraClass you can use Namespace.getSymbol and then get all the "members" using SymbolTable.getChildren.

I don't really like to advertise my own stuff like this but considering what you have there you may find it useful. It is a bit buggy but it will do a large portion of the work for you especially if there was no debug information. (It appears you have some though). https://github.com/astrelsky/Ghidra-Cpp-Class-Analyzer

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by matcool
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@astrelsky
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants