Comments (10)
Currently it's very tedious to create the structs representing the vtable in Ghidra. It would be convenient if this extension could create those structs and function pointer types based off of the signatures of the destinations.
It does. You can get to it quickly by right-clicking on the type in the "ClassTypeInfo Tree" and selecting "Edit Data Type". From there just right click on the _vptr component and choose "Edit Component".
The creation should occur when the corresponding c++ class analyzer is run.
from ghidra-cpp-class-analyzer.
Hmmm... I seem to not have those things. I have "Edit" but the structure that I get is empty. Is there an example binary that is known to work well with this extension that I can compare with?
from ghidra-cpp-class-analyzer.
Hmmm... I seem to not have those things. I have "Edit" but the structure that I get is empty. Is there an example binary that is known to work well with this extension that I can compare with?
It is "Edit". I was going off memory.
If the Structure is empty then the cause would be one of 3 things:
- No vtable
- Vtable wasn't found
- Some other bug
If you are certain that there is a vtable for the class in question then this would definitely require further investigation.
A class which has a located vtable should have a "Goto vtable" option available on right clicking on it in the tree.
from ghidra-cpp-class-analyzer.
As a sanity check you can always run it on libstdc++.so and then check the iostream classes.
from ghidra-cpp-class-analyzer.
Ok, I think I have the analyzers running properly on this test case:
struct Bar {
virtual int a(int x) = 0;
virtual int b(double x, double y) = 0;
virtual int get() = 0;
};
struct Foo : public Bar {
int a(int ax) override {
x = ax;
return x;
}
int b(double ax, double ay) override {
x = ax;
y = ay;
return y;
}
virtual int get() {
return y;
}
int x;
int y;
};
int main() {
Bar* b = new Foo;
b->a(4);
b->b(6, 7);
return b->get();
}
Foo
and Bar
both show up in the ClassTypeInfo Tree and both have "Goto Vtable". However the vtable* _vptr member of Bar is empty. I'd like it to be automatically/or semi-automatically filled in with 3 function pointers that have types matching the signatures of a
, b
and get
respectively.
from ghidra-cpp-class-analyzer.
This seems like a regression. I will investigate with the provided example tomorrow. The vtable structs shouldn't be empty and should have the function signatures.
from ghidra-cpp-class-analyzer.
FWIW, I built it with gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)
from ghidra-cpp-class-analyzer.
I was able to reproduce this. I should have it fixed within a couple days.
from ghidra-cpp-class-analyzer.
b6f24a7 should have fixed the issue
from ghidra-cpp-class-analyzer.
Yep. It works for me now. Thanks!
from ghidra-cpp-class-analyzer.
Related Issues (20)
- Binary 10.1.2 release HOT 1
- Resource Leak
- Extension won't install for Ghidra version 10.1.3 HOT 2
- Extension doesn't appear in the Experimental Plugin List HOT 12
- When process comes to cppclassanalyzer.plugin.ClassTypeInfoManagerPlugin.getExternalClassTypeInfo(ClassTypeInfoManagerPlugin.java:331), it haven't ProjectClassTypeInfoManager instancies in heap. HOT 7
- Add Drag n drop handlers
- Plugin: ClassTypeInfoManager name collision
- Duplicated data types with GNU Demangler HOT 6
- Ghidra 10.1.4: "String index out of range: 0" when trying to analyze an executable HOT 3
- `UnresolvedClassTypeInfoException`: Unable to locate archived data HOT 5
- Analysis failure, unable to copy some library ClassTypeInfo data to a project archive HOT 8
- Everything seems to be working fine, but RTTI finds no results. HOT 14
- Error using `TypeInfo *` in structs HOT 2
- Clone method implemented incorrectly for TypeInfoFactoryDataType HOT 3
- Class analyzer errors while analyzing binary HOT 6
- 10.2 Build
- Plugin Related Analysis Tools do not Appear. HOT 4
- 10.2 plugin incompatible with Ghidra 10.3 HOT 6
- getManagerNode is null in analyzer
- Fails to progress due to demangle exception HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ghidra-cpp-class-analyzer.