public void run() throws Exception {
var cp = currentProgram;
var nsSymbols = ghidra.app.util.NamespaceUtils.getSymbols("myNameSpace", cp);
var glNS = nsSymbols.get(0);
var st = cp.getSymbolTable();
var childs = st.getChildren(glNS);
Map<String, Integer> map = new HashMap<String, Integer>();
println("Test");
while (childs.hasNext())
{
var next = childs.next();
var func = (Function)next.getObject();
var body = func.getBody();
var lbcu = cp.getListing().getCodeUnits(body, true);
var i = 0;
while (lbcu.hasNext())
{
lbcu.next();
i++;
}
println("Name: " + next.getName() + ", count: " + i);
}
Results I get:
NewScript.java> Name: CreateTypeInstance, count: 1
NewScript.java> Name: Deserialize, count: 1
This does not make any sense to me. The listing clearly show more instructions and I can see whole decompiled view yet API return some garbage?