astrelsky / Ghidra-Cpp-Class-Analyzer

Ghidra C++ Class and Run Time Type Information Analyzer
MIT License
633 stars 46 forks source link

When process comes to cppclassanalyzer.plugin.ClassTypeInfoManagerPlugin.getExternalClassTypeInfo(ClassTypeInfoManagerPlugin.java:331), it haven't ProjectClassTypeInfoManager instancies in heap. #53

Closed korotkih2000 closed 2 years ago

korotkih2000 commented 2 years ago

When process comes to cppclassanalyzer.plugin.ClassTypeInfoManagerPlugin.getExternalClassTypeInfo(ClassTypeInfoManagerPlugin.java:331), it haven't ProjectClassTypeInfoManager instancies in heap. May be i need run something to create it? and load archived data?

ghidra.app.cmd.data.rtti.gcc.UnresolvedClassTypeInfoException: Unable to locate archived data for V****::typeinfo at cppclassanalyzer.plugin.ClassTypeInfoManagerPlugin.getExternalClassTypeInfo(ClassTypeInfoManagerPlugin.java:331) at cppclassanalyzer.data.manager.ItaniumAbiClassTypeInfoManager.getExternalClassTypeInfo(ItaniumAbiClassTypeInfoManager.java:77) at ghidra.app.cmd.data.rtti.gcc.typeinfo.BaseClassTypeInfoModel.getClassModel(BaseClassTypeInfoModel.java:135) at ghidra.app.cmd.data.rtti.gcc.typeinfo.VmiClassTypeInfoModel.getVirtualParents(VmiClassTypeInfoModel.java:150) at cppclassanalyzer.data.typeinfo.GnuClassTypeInfoDB.fillModelData(GnuClassTypeInfoDB.java:272) at cppclassanalyzer.data.typeinfo.AbstractClassTypeInfoDB.(AbstractClassTypeInfoDB.java:67) at cppclassanalyzer.data.typeinfo.GnuClassTypeInfoDB.(GnuClassTypeInfoDB.java:49) at cppclassanalyzer.data.manager.ItaniumAbiClassTypeInfoManager$GnuRttiRecordWorker.buildType(ItaniumAbiClassTypeInfoManager.java:308)

astrelsky commented 2 years ago

If this rtti is in a shared library then you will need to create it. It should be as simple as running analysis on the shared library then creating the project archive in the class type info tree and copying the shared library root node of the tree into it. Then it should be resolved when analysis is run on your program.

If you don't actually need this specific class information then you can ignore the warning. Analysis should continue without issue and it will just ignore anything requiring that information.

korotkih2000 commented 2 years ago

Thank you. But i can't drag-n-drop root "Data Types" node to Project Archive in Data Type Manager. that is why i copy into arc only some types. But it doesn't meter, because libManagers on line 325 ClassTypeInfoManagerPlugin.java are still empty.

korotkih2000 commented 2 years ago

One more problem: i got this error during navigation between decompiler window and listing window. It's really hard... :-)))

korotkih2000 commented 2 years ago

And, if can believe my debugger, I still can't find instances of ProjectClassTypeInfoManager in heap.

astrelsky commented 2 years ago

I didn't implement drag n drop but now I will because it would be expected to work. For now but you can use ctrl+c and ctrl+v or right click the program archive to copy and then paste.

I'm attaching a snapshot of where the option is to create a project archive as I suspect there may be a minor language barrier.

image

korotkih2000 commented 2 years ago

Hooray! It was my mistake. Everything is working. Thanks a lot. A really great job. Have a nice day. :-)

astrelsky commented 2 years ago

Hooray! It was my mistake. Everything is working. Thanks a lot. A really great job. Have a nice day. :-)

Glad to hear it. I will look into implementing the drag and drop for the archives. In my opinion that should be expected to work.