Installing Intel SDE on Ubuntu

Intel Software Development Emulator (SDE) is a very handy tool for dynamic program analysis.  The binary version of the tool is available at

Once you untar the distribution you’ll find the sde executable:

ilya@lin1:~/Tools/SDE$ tar -xvf sde-external-7.39.0-2016-01-18-lin.tar.bz2 
ilya@lin1:~/Tools/SDE$ tar -xf sde-external-7.39.0-2016-01-18-lin.tar.bz2
ilya@lin1:~/Tools/SDE$ ln -s sde-external-7.39.0-2016-01-18-lin sde
ilya@lin1:~/Tools/SDE$ cd sde/
ilya@lin1:~/Tools/SDE/sde$ ls -l sde
-rwxr-xr-x 1 ilya ilya 52272 Jan 17 18:47 sde

But when you try to run it you might get a somewhat puzzling error message:

ilya@lin1:~/Tools/SDE/sde$ ./sde
bash: ./sde: No such file or directory

Of course there is the executable is there, the problem is that it’s a 32-binary

ilya@lin1:~/Tools/SDE/sde$ file sde
sde: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/, for GNU/Linux 2.6.4, not stripped

and we are trying to run in a 64-bit environment:

ilya@lin1:~/Tools/SDE/sde$ uname -a
Linux lin1 4.2.0-27-generic #32-Ubuntu SMP Fri Jan 22 04:49:08 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

To fix this problem we need to install 32-bit libraries:

ilya@lin1:~/Tools/SDE/sde$ sudo apt-get install lib32gcc1 libc6-i386 lib32z1 lib32stdc++6

Now we can make a simple SDE test run

ilya@lin1:~/Tools/SDE/sde$ ./sde -mix -- ls
ia32	 LICENSE.txt  README.txt  sde64		   src	xed64
intel64  misc	      sde	  sde-mix-out.txt  xed

This command generates file sde-mix-out.txt with a histogram of basic blocks executed by ls.