Saturday, January 04, 2014

IDA on Debian amd64 with python

Are you the lucky owner of an IDA Pro linux license? Since I had errors last time I set it up, here is a quick brain dump on setting up IDA Pro 6.5 on Debian sid with IDA python 2.7. It may even work for Ubuntu.


Install IDA Pro, choose to use OS-provided python environment (and not bundled).
Then try to run it and it fails:
$ /opt/ida/idaq
libstdc++.so.6: cannot open shared object file: No such file or directory

Indeed since IDA binaries are 32bits:
$ file /opt/ida/idaq*
/opt/ida/idaq:   ELF 32-bit LSB  executable, Intel 80386...
/opt/ida/idaq64: ELF 32-bit LSB  executable, Intel 80386...

We need multiarch support (formerly ia32-libs):
# dpkg --add-architecture i386
# apt-get update

Now we can install dependencies. Since I don't recall exactly which ones I installed:
$ echo aptitude install $(for f in $(ldd /opt/ida/idaq | grep -v '/opt/ida' | awk '$2="=>"{if($3)print $3}'); do
    dpkg -S "$f"
  done | awk '{print substr($1, 1, length($1)-1)}' | sort -u)
Use that:
# aptitude install libc6-i686:i386 libexpat1:i386 libffi6:i386 libfontconfig1:i386 libfreetype6:i386 libgcc1:i386 libglib2.0-0:i386 libice6:i386 libpcre3:i386 libpng12-0:i386 libsm6:i386 libstdc++6:i386 libuuid1:i386 libx11-6:i386 libxau6:i386 libxcb1:i386 libxdmcp6:i386 libxext6:i386 libxrender1:i386 zlib1g:i386

Now IDA starts, but IDA python plugin complains:
dlopen(/opt/ida/plugins/python.plx): libpython2.7.so.1.0: cannot open shared object file: No such file or directory
/opt/ida/plugins/python.plx: can't load file

Same thing as before, we are missing the 32bit library:
# aptitude install libpython2.7:i386

But on Debian sid it gives an error:
dpkg: error processing archive /var/cache/apt/archives/libpython2.7-minimal_2.7.6-4_i386.deb (--unpack):
 trying to overwrite shared '/usr/share/doc/libpython2.7-minimal/changelog.Debian.gz', which is different from other instances of package libpython2.7-minimal:i386
[...]

Overwriting changelog is harmless, we can resolve it with an overwrite and try again:
# dpkg -i --force-overwrite /var/cache/apt/archives/libpython2.7-minimal_2.7.6-4_i386.deb
# aptitude install libpython2.7:i386

Finally IDA starts with IDA python working. Oh linux :)
Hope it helps!

No comments:

Post a Comment