shellphish / driller

Driller: augmenting AFL with symbolic execution!
BSD 2-Clause "Simplified" License
889 stars 162 forks source link

AttributeError: 'module' object has no attribute 'UNICORN_HANDLE_TRANSMIT_SYSCALL' #28

Closed ash09 closed 7 years ago

ash09 commented 7 years ago

Hi, I get the following error when I run Driller, I'm not able to figure out what is the problem.

import driller
d = driller.Driller("./test","a"*1024,"\xff" * 65535)
n = d.drill()
Traceback (most recent call last):
  File "test-driller.py", line 4, in <module>
    n = d.drill()
  File "/usr/lib/python2.7/site-packages/driller/driller.py", line 110, in drill
    list(self._drill_input())
  File "/usr/lib/python2.7/site-packages/driller/driller.py", line 136, in _drill_input
    t = tracer.Tracer(self.binary, self.input, hooks=self._hooks)
  File "/usr/lib/python2.7/site-packages/tracer/tracer.py", line 216, in __init__
    self.path_group = self._prepare_paths()
  File "/usr/lib/python2.7/site-packages/tracer/tracer.py", line 921, in _prepare_paths
    return self._linux_prepare_paths()
  File "/usr/lib/python2.7/site-packages/tracer/tracer.py", line 1081, in _linux_prepare_paths
    options.add(so.UNICORN_HANDLE_TRANSMIT_SYSCALL)
AttributeError: 'module' object has no attribute 'UNICORN_HANDLE_TRANSMIT_SYSCALL'

Thank you for your help.

salls commented 7 years ago

It looks like you need to update simuvex/unicorn. I suggest using the version on github which is the most up to date.

ash09 commented 7 years ago

Indeed, simuvex, pyvex and cle were not up to date. Thanks!

dkasak commented 7 years ago

@ash09 Did you install simuvex from https://github.com/angr/simuvex? The build fails for me with:

  Found existing installation: simuvex 6.7.1.31
    Uninstalling simuvex-6.7.1.31:
      Successfully uninstalled simuvex-6.7.1.31
  Running setup.py install for simuvex ... error
    Complete output from command /home/dkasak/code/projects/shellphish/venv/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-CO6_qP-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-LjkLo0-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/dkasak/code/projects/shellphish/venv/include/site/python2.7/simuvex:
    running install
    running build
    Building sim_unicorn
    gcc -fPIC -c -O3 -o log.o log.c
    g++ -I /home/dkasak/code/projects/shellphish/venv/lib/python2.7/site-packages/unicorn/include -I /home/dkasak/code/projects/shellphish/venv/lib/python2.7/site-packages/pyvex/include -L /home/dkasak/code/projects/shellphish/venv/lib/python2.7/site-packages/unicorn/lib -L /home/dkasak/code/projects/shellphish/venv/lib/python2.7/site-packages/pyvex/lib `pkg-config --cflags glib-2.0` -O3 -fPIC -std=c++11 -shared -o sim_unicorn.so log.o sim_unicorn.cpp `pkg-config --libs glib-2.0` -lunicorn -lpyvex
    sim_unicorn.cpp: In member function ‘bool State::check_expr(RegisterSet*, RegisterSet*, IRExpr*)’:
    sim_unicorn.cpp:574:9: error: ‘Iex_GSPTR’ was not declared in this scope
        case Iex_GSPTR:
             ^~~~~~~~~
    sim_unicorn.cpp: In member function ‘bool State::check_block(uint64_t, int32_t)’:
    sim_unicorn.cpp:765:114: error: ‘vex_lift’ was not declared in this scope
        IRSB *the_block = vex_lift(this->vex_guest, this->vex_archinfo, instructions.get(), address, 99, size, 1, 0, 0);
                                                                                                                      ^
    make: *** [Makefile:24: sim_unicorn.so] Error 1
    error: Unable to build sim_unicorn

    ----------------------------------------
  Rolling back uninstall of simuvex
Command "/home/dkasak/code/projects/shellphish/venv/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-CO6_qP-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-LjkLo0-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/dkasak/code/projects/shellphish/venv/include/site/python2.7/simuvex" failed with error code 1 in /tmp/pip-CO6_qP-build/
zardus commented 7 years ago

Sounds like your pyvex and vex aren't up to date, either.

On Mar 25, 2017 9:40 AM, "Denis Kasak" notifications@github.com wrote:

@ash09 https://github.com/ash09 Did you install simuvex from https://github.com/angr/simuvex? The build fails for me with:

Found existing installation: simuvex 6.7.1.31 Uninstalling simuvex-6.7.1.31: Successfully uninstalled simuvex-6.7.1.31 Running setup.py install for simuvex ... error Complete output from command /home/dkasak/code/projects/shellphish/venv/bin/python2 -u -c "import setuptools, tokenize;file='/tmp/pip-CO6_qP-build/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-LjkLo0-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/dkasak/code/projects/shellphish/venv/include/site/python2.7/simuvex: running install running build Building sim_unicorn gcc -fPIC -c -O3 -o log.o log.c g++ -I /home/dkasak/code/projects/shellphish/venv/lib/python2.7/site-packages/unicorn/include -I /home/dkasak/code/projects/shellphish/venv/lib/python2.7/site-packages/pyvex/include -L /home/dkasak/code/projects/shellphish/venv/lib/python2.7/site-packages/unicorn/lib -L /home/dkasak/code/projects/shellphish/venv/lib/python2.7/site-packages/pyvex/lib pkg-config --cflags glib-2.0 -O3 -fPIC -std=c++11 -shared -o sim_unicorn.so log.o sim_unicorn.cpp pkg-config --libs glib-2.0 -lunicorn -lpyvex sim_unicorn.cpp: In member function ‘bool State::check_expr(RegisterSet, RegisterSet, IRExpr)’: sim_unicorn.cpp:574:9: error: ‘Iex_GSPTR’ was not declared in this scope case Iex_GSPTR: ^~~~~ sim_unicorn.cpp: In member function ‘bool State::check_block(uint64_t, int32_t)’: sim_unicorn.cpp:765:114: error: ‘vex_lift’ was not declared in this scope IRSB the_block = vex_lift(this->vex_guest, this->vex_archinfo, instructions.get(), address, 99, size, 1, 0, 0);

                                           ^
make: *** [Makefile:24: sim_unicorn.so] Error 1
error: Unable to build sim_unicorn

----------------------------------------

Rolling back uninstall of simuvex Command "/home/dkasak/code/projects/shellphish/venv/bin/python2 -u -c "import setuptools, tokenize;file='/tmp/pip-CO6_qP-build/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-LjkLo0-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/dkasak/code/projects/shellphish/venv/include/site/python2.7/simuvex" failed with error code 1 in /tmp/pip-CO6_qP-build/

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/shellphish/driller/issues/28#issuecomment-289223310, or mute the thread https://github.com/notifications/unsubscribe-auth/ADSzl-l5krOgewmpjYQ3n72a-8sTHWGEks5rpUNfgaJpZM4MoZGY .