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

av changes #13229

Open
2 of 4 tasks
radare opened this issue Mar 2, 2019 · 18 comments
Open
2 of 4 tasks

av changes #13229

radare opened this issue Mar 2, 2019 · 18 comments

Comments

@radare
Copy link
Collaborator

radare commented Mar 2, 2019

[0x1000011ec]> av?
Usage: av[?jr*]   C++ vtables and RTTI
| av                search for vtables in data sections and show results
| avj               like av, but as json
| av*               like av, but as r2 commands
| avr[j@addr]       try to parse RTTI at vtable addr (see anal.cpp.abi)
| avra[j]           search for vtables and try to parse RTTI at each of them
| avrr              recover class info from all findable RTTI (see aC)
| avrD [classname]  demangle a class name from RTTI
[0x1000011ec]> aC
Usage: aC[e] [addr-of-call] # analyze call args (aCe does esil emulation with abte)
[0x1000011ec]>

note the following:

  • avra should be renamed to aavt (analyze all virtual tables)
  • avrr may be renamed to aavr maybe :?
  • the aC command reference is wrong, it is ac
  • Is avra run from aaa? may we want to use the bin info for this?
@thestr4ng3r
Copy link
Contributor

"aavt (analyze all virtual tables)" is wrong, the command is about rtti, not just vtables, also it doesn't really analyze, it just reads data and prints it. Does that fit under aa? avrr does in any case though.

@radare
Copy link
Collaborator Author

radare commented Mar 2, 2019

then i misunderstood. maybe is avrr the one that must be moved into aa? if those vtables thing are just printing commands why are they under analysis? PD: never used that

@thestr4ng3r
Copy link
Contributor

Well where would it fit other than anal? It's partially heuristic search and partially parsing data structures defined by C++ ABI.

@radare
Copy link
Collaborator Author

radare commented Mar 3, 2019 via email

@thestr4ng3r
Copy link
Contributor

Right now there is nothing in aaa, but avrr is something could certainly be added. The requirement for it are xrefs for the vtable search (aar has to be executed before) and rtti in the binary. Maybe there should also be a fallback when there is no rtti, so it just detects vtables and adds classes for them.

Yes, I'll fix the help

@radare
Copy link
Collaborator Author

radare commented Mar 3, 2019 via email

@Maijin
Copy link
Contributor

Maijin commented Mar 23, 2019

@thestr4ng3r Do you have an example of binary in r2r I can use to test the aaa integration?

@thestr4ng3r
Copy link
Contributor

Not in r2r, but you can try with this: cpp_sample.exe.gz

@thestr4ng3r
Copy link
Contributor

Here's also the pdb for it:
cpp_sample.pdb.gz

@Maijin
Copy link
Contributor

Maijin commented Mar 23, 2019

@thestr4ng3r

[0x14000100f]> avrr
No virtual tables found

Huh?

@thestr4ng3r
Copy link
Contributor

Needs aar first

@Maijin
Copy link
Contributor

Maijin commented Mar 23, 2019

ok great!

@radare
Copy link
Collaborator Author

radare commented Mar 24, 2019 via email

Maijin pushed a commit that referenced this issue Mar 24, 2019
@Maijin Maijin removed their assignment Mar 24, 2019
@radare radare modified the milestones: 3.4.0, 3.5.0 Mar 25, 2019
@radare
Copy link
Collaborator Author

radare commented Apr 15, 2019

@thestr4ng3r any comments on the other points?

@thestr4ng3r
Copy link
Contributor

The aC ref is fixed, for the rest my comments above are still valid

@Maijin Maijin removed their assignment Apr 15, 2019
@Maijin
Copy link
Contributor

Maijin commented Apr 15, 2019

I don't have any opinion on the renaming, won't have impact on the users I think because very few users know about it if not only core so feel free to go ahead :)

@radare radare removed this from the 3.5.0 milestone May 9, 2019
@radare
Copy link
Collaborator Author

radare commented May 9, 2019

removing the milesstone, and imho few users know it because most ppl expect things that analyze the whole thing to be under aa. we can also add some alias commands instead of renaming, so not breaking things, what do u think?

@thestr4ng3r
Copy link
Contributor

I don't think we need an alias for this. A fitting name would be aavr, but that kind of clashes with aav, so not too sure about it.

@XVilka XVilka added the C++ C++ analysis related issues label Aug 15, 2019
@XVilka XVilka added this to To do in Analysis via automation Aug 15, 2019
@XVilka XVilka added this to To do in Type Analysis Improvements via automation Aug 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Analysis
  
To do
Development

No branches or pull requests

5 participants