angr / angr

A powerful and user-friendly binary analysis platform!
http://angr.io
BSD 2-Clause "Simplified" License
7.48k stars 1.07k forks source link

Error in running the examples. #19

Closed chubbymaggie closed 9 years ago

chubbymaggie commented 9 years ago

I have successfully installed angr. However, I am getting following errors in running the 2 examples provided in the documentation.

Whitehat CTF 2015 Crypto 400

[*] example guess: 'ny;~!TBU'
[*] brute-forcing 6392 possibilities
Traceback (most recent call last):                              | ETA:  --:--:--
  File "whitehat_crypto400.py", line 83, in <module>
    stdout,_ = subprocess.Popen(["./whitehat_crypto400", ''.join(guess)], stdout=subprocess.PIPE, stderr=subprocess.STDOUT).communicate()
  File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
    raise child_exception
OSError: [Errno 8] Exec format error

Layer7 CTF 2015 Windows challenge OnlyOne

No handlers could be found for logger "cle.pe"
Executing...
Traceback (most recent call last):
  File "solve.py", line 83, in <module>
    main()
  File "solve.py", line 59, in main
    r = ex.run()
  File "/home/xyz/angr/angr/angr/surveyor.py", line 240, in run
    self.step()
  File "/home/xyz/angr/angr/angr/surveyor.py", line 217, in step
    self.tick()
  File "/home/xyz/angr/angr/angr/surveyor.py", line 297, in tick
    if isinstance(p.error, PathUnreachableError):
AttributeError: 'Path' object has no attribute 'error'
rhelmot commented 9 years ago

For the first, that example involves actually running a linux binary, which is not possible when you're not on linux! :-)

The second looks like a legitimate bug in Surveyors. @ltfish why would this come up?

chubbymaggie commented 9 years ago

Thank you so much for the speedy reply :) I am actually running on Ubuntu 12.04. What could be the reason. Anyway, I'll search online and figure this out. Regarding the 2nd example, I had it working on my laptop, but getting this error on my Desktop PC, both are running Ubuntu 12.04.

cheers

rhelmot commented 9 years ago

The first example's binary is also for the x86_64 architecture, so it'll only work if your machine is 64-bit.

ltfish commented 9 years ago

Regarding the second example, it's because the path which is being symbolically explored got an exception, and the Path object used to have an error attribute (not anymore) - that's why it raised an exception. So you are seeing two bugs here :-)

The ultimate solution would be pulling the latest angr. I suspect that you are not using the latest version of angr (as on GitHub) on your desktop. Pulling the latest version should resolve this problem for you (i.e. the symbolic exploration will not raise an exception).

By the way @rhelmot, can you please fix the 'Path' object has no attribute 'error' issue? Thanks!

rhelmot commented 9 years ago

Pushed what I think is a fix. It has to do with the awful hack PathHierarchy uses to mark ancestors unsatisfiable.

zardus commented 9 years ago

I am always open to better suggestions :-) On Sep 1, 2015 4:27 PM, "Andrew Dutcher" notifications@github.com wrote:

Pushed what I think is a fix. It has to do with the awful hack PathHierarchy uses to mark ancestors unsatisfiable.

— Reply to this email directly or view it on GitHub https://github.com/angr/angr/issues/19#issuecomment-136634982.

rhelmot commented 9 years ago

@chubbymaggie did this fix resolve your issue with the second example?

chubbymaggie commented 9 years ago

Sorry for the late response.. I was busy with something else. Yes, this fix the problem and I am able to run the 2nd example.

Thanks alot for the help :+1: