Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add size info to anal class vtables #12601

Closed
thestr4ng3r opened this issue Jan 1, 2019 · 3 comments
Closed

Add size info to anal class vtables #12601

thestr4ng3r opened this issue Jan 1, 2019 · 3 comments
Labels
classes Parsing, propagating and inferring object-oriented language structures RAnal
Projects

Comments

@thestr4ng3r
Copy link
Contributor

Right now, vtables in aCv only have an address, but no size. This should be added to the sdb record and also be represented in the size of the flag for the vtable.

@thestr4ng3r thestr4ng3r added RAnal classes Parsing, propagating and inferring object-oriented language structures labels Jan 1, 2019
@radare
Copy link
Collaborator

radare commented Jan 2, 2019 via email

@XVilka XVilka added this to To do in Analysis via automation Feb 9, 2019
@HoundThe
Copy link
Contributor

HoundThe commented Mar 3, 2020

Hey! I started working on this issue #12603 and found out that I can't really look up the actual destination of the method without being sure I am able to dereference memory on the offset because I don't know the size of the table. So I guess I am gonna start here.

Is size mentioned here supposed to be added by the user when adding the vtable to a class? Or an additional command, also I am not sure what the flag mentioned means?

@thestr4ng3r
Copy link
Contributor Author

First of all, the size info should be able to be stored at all, no matter where it will come from later. It should also be settable with the acv command, like addr and offset. If possible, avrr should fill it too.

Flags in r2 are generic markers at some address and they can also have a size. The flag for a vtable is set here: https://github.com/radareorg/radare2/blob/master/libr/anal/class.c#L876 (r_anal_class_set_flag() doesn't have a size arg yet, this needs to be added and passed to flg_class_set)

This function r_anal_class_vtable_set() is also the point where the size would have to be stored into the SDB. See how it is done for the address and offset.

Analysis automation moved this from To do to Done Mar 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
classes Parsing, propagating and inferring object-oriented language structures RAnal
Projects
Analysis
  
Done
Development

No branches or pull requests

3 participants