junxzm1990 / x86-sok

132 stars 20 forks source link

There are two other questions when I used angr script and bap script. #12

Closed cL0und closed 3 years ago

cL0und commented 3 years ago

Hi, it's me again.

When I used angrBlocks.py, the script raised AttributeError and it seems like that CFGFast of official lib don't have this attribute. image

And when I used bap script,it also raise error,ad it seems like bap have't the with-no-return plugin by default. image

So, Did you do some secondary development? How can I fix the problems?

bin2415 commented 3 years ago

For angr, we added function_prologue_matching_addrs to collect function starts which are found by function prologue. Comment this out is fine to extract CFG of angr.

For bap, please install this plugin to use the pass with-no-return.

cL0und commented 3 years ago

Thanks for your prompt reply,I have solved the first item, whereas I meet a few problems when I compiled plugins.I think I will fix it. Happy mid-autumn ;)

cL0und commented 3 years ago

I have solved the plugin problem, but it raises another error info. image BTW my bap version is 2.3.0.

bin2415 commented 3 years ago

Hello @cL0und , I followed this issue to dump cfg of bap. You could install rcfg plugin with this tutorial.

cL0und commented 3 years ago

I have solved it, think you.Beside I want to know how to use dyninst disassemblers?Is there any tutorial? image Need I download relative lib in the same dir with dyninstBB.cpp?

bin2415 commented 3 years ago

Hello, there exists two errors here.

  1. Install dyninst. cmake /path/to/dyninst/source -DCMAKE_INSTALL_PREFIX=/usr/local/lib make install -jN
  2. Recompile blocks.pb.cc/h files. I update the makefile here
cL0und commented 3 years ago

Ok, Iet me have a try. I had installed it by spark at the first.

cL0und commented 3 years ago

Your Makefile seems to have grammar error about missing separator,I replace space with tab. However the process raise desperate output.There are thousands of errors which can not copy all of them.Like this. image

bin2415 commented 3 years ago

Hello, I add the instructions to build dyninst.

The errors above seems that the protobuf issues. What is the version of protoc? Mine is 3.17.2

cL0und commented 3 years ago

Finally,I degrade version to yours and reconstruct C file from pb. It's been pretty well worked out.Thanks for your help, it's really a long journey.