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

plot_ CFG cannot draw disassembly code #32

Open
ioxera opened this issue Dec 7, 2021 · 8 comments
Open

plot_ CFG cannot draw disassembly code #32

ioxera opened this issue Dec 7, 2021 · 8 comments

Comments

@ioxera
Copy link

ioxera commented Dec 7, 2021

I ran the sample code, but I didn't get an image of the disassembly code,image as below:
out
parameter "format='raw'" then "dot -Tpng -o out.png ais3_cfg.raw" as same as above.
the "ais3_cfg.raw" file's content as below:
image
The node description of the "ais3_cfg. Raw" file does not seem to contain disassembly content. I don't know whether this is an angr problem or an angr utils problem.
could you give me some help? Thanks

@axt
Copy link
Owner

axt commented Dec 8, 2021

Did you call it with an 'asminst=True' parameter?

@ioxera
Copy link
Author

ioxera commented Dec 9, 2021

Did you call it with an 'asminst=True' parameter?

yes, I follow the example in readme as it is

@axt
Copy link
Owner

axt commented Dec 9, 2021

Just for a smoketest, I've tried with the latest version of angr, and it is working for me.

Could you try what happens with 'vexinst=True'?
Do you see vex instructions in the plotted graph?

This is where the assembly instructions are generated:
https://github.com/axt/bingraphvis/blob/master/bingraphvis/angr/content.py#L258-L263

Could you try to run this

self.project.factory.block(addr=0x4005c5, num_inst=1).capstone.insns

and check if it gives back any instruction.

If not, I would suspect something is wrong with your capstone installation. If that's the case, probably the angr community can help.

@ioxera
Copy link
Author

ioxera commented Dec 10, 2021

'vexinst=True' don't see vex instructions in the plotted graph
but self.project.factory.block(addr=0x4005c5, num_inst=1).capstone.insns was gives:
image
Thanks for your help, i will debug the source code

@axt
Copy link
Owner

axt commented Dec 13, 2021

Could you solve it? I'm curious what was/is the problem.

@ioxera
Copy link
Author

ioxera commented Dec 17, 2021

I'm sorry, i can't solve it,I don't know where is the problem.

@axt
Copy link
Owner

axt commented Dec 29, 2021

I'm sorry to hear that. Not sure how to help.

Did you check that the codes I linked above were executed?

If yes, then you should check the 'n.content' map here:
https://github.com/axt/bingraphvis/blob/master/bingraphvis/output.py#L120

If no, then you should check the 'self.content' map here:
https://github.com/axt/bingraphvis/blob/master/bingraphvis/base.py#L285

In both cases it should have a 'head' and an 'asm' key in it.

If you install the libs in an editable way, 'pip install -e ./bingraphvis' then you simply just can add some print functions to those lines.

@lYlantis
Copy link

I am running into the same issue. I added the print statements in both places. Both locations have a head and asm key.

Any other obvious things to check?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants