eset / ipyida

IPython console integration for IDA Pro

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Installer fails on Linux

obilodeau opened this issue · comments

Installer stacktrace

Python>import urllib2; exec urllib2.urlopen('https://github.com/eset/ipyida/raw/stable/install_from_ida.py').read()
ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
  File "/home/olivier/opt/ida/python/lib/python27.zip/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/home/olivier/opt/ida/python/lib/python27.zip/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type md5
ERROR:root:code for hash sha1 was not found.
Traceback (most recent call last):
  File "/home/olivier/opt/ida/python/lib/python27.zip/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/home/olivier/opt/ida/python/lib/python27.zip/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha1
ERROR:root:code for hash sha224 was not found.
Traceback (most recent call last):
  File "/home/olivier/opt/ida/python/lib/python27.zip/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/home/olivier/opt/ida/python/lib/python27.zip/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha224
ERROR:root:code for hash sha256 was not found.
Traceback (most recent call last):
  File "/home/olivier/opt/ida/python/lib/python27.zip/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/home/olivier/opt/ida/python/lib/python27.zip/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha256
ERROR:root:code for hash sha384 was not found.
Traceback (most recent call last):
  File "/home/olivier/opt/ida/python/lib/python27.zip/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/home/olivier/opt/ida/python/lib/python27.zip/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha384
ERROR:root:code for hash sha512 was not found.
Traceback (most recent call last):
  File "/home/olivier/opt/ida/python/lib/python27.zip/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/home/olivier/opt/ida/python/lib/python27.zip/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha512
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/olivier/opt/ida/python/lib/python27.zip/urllib2.py", line 154, in urlopen
  File "/home/olivier/opt/ida/python/lib/python27.zip/urllib2.py", line 431, in open
  File "/home/olivier/opt/ida/python/lib/python27.zip/urllib2.py", line 454, in _open
  File "/home/olivier/opt/ida/python/lib/python27.zip/urllib2.py", line 409, in _call_chain
  File "/home/olivier/opt/ida/python/lib/python27.zip/urllib2.py", line 1265, in unknown_open
urllib2.URLError: <urlopen error unknown url type: https>

urllib2 needs hashlib with md5 (most likely to verify certs) and IDA's python on Linux doesn't seem to provide it.

Anyway IDA's python is very crippled so documentation about using a virtualenv for IDA would be good. I'll see if I can contribute docs to get ananconda's 32-bit python built in a virtualenv for IDA today.

Ok, so I think this is easier to fix than originally thought. With anaconda's python I also have hashlib errors which means that I'm probably only lacking a 32bit lib.

I think hashlib is using a binary module (_hashlib.so) that links to OpenSSL.

32-bit IDA with a 64-bit system or Python is a mess :(

Once we find a solution I'll fix the error message in the installer to refer to the package to install.

So to fix this, you basically need a couple things:

  • 32-bit Python runtime /opt/python32-2.7.12 is mine
  • mv /opt/ida-6.95/python/lib/python2.7 /opt/ida-6.95/python/lib/python2.7_backup
  • Symlink your /opt/python32-2.7.12 to your /opt/ida-6.95/python/lib
  • Copy missing *.so from /opt/ida-6.95/python/lib/python2.7_backup/lib-dynload/ to /opt/python32-2.7.12/lib-dynload/

Running locate hashlib.so will help you find where the missing file is. (Assuming you've installed it, which it sounds like reading above you have.)

Now the IDA Pro is a 64-bits executable there should be less compatibility problems with dual Python installs. Since this is mostly a setup problem I'll close it for now, but let me know if you have further problems.