angr-utils icon indicating copy to clipboard operation
angr-utils copied to clipboard

plot_ CFG cannot draw disassembly code

Open ioxera opened this issue 3 years ago • 8 comments

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

ioxera avatar Dec 07 '21 09:12 ioxera

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

axt avatar Dec 08 '21 15:12 axt

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

yes, I follow the example in readme as it is

ioxera avatar Dec 09 '21 09:12 ioxera

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.

axt avatar Dec 09 '21 19:12 axt

'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

ioxera avatar Dec 10 '21 01:12 ioxera

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

axt avatar Dec 13 '21 07:12 axt

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

ioxera avatar Dec 17 '21 01:12 ioxera

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.

axt avatar Dec 29 '21 22:12 axt

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?

lYlantis avatar Jun 14 '22 12:06 lYlantis