Programming

Compiling and using sstrip

There’s a new 3.0 version of ELFkickers available since may 2011, after a decade of inactivity.

You can read the changelog from the previous link to see what has changed, but concerning sstrip, the most important thing is that it now also works with 64-bit ELF files.

Let’s download, compile and install it:

$ wget http://www.muppetlabs.com/~breadbox/pub/software/ELFkickers-3.0.tar.gz
$ tar xf ELFkickers-3.0.tar.gz
$ cd ELFkickers-3.0/
$ make
$ sudo make install

Now we can try it on strip :)

First make a copy:

$ cp /usr/bin/strip /tmp/

Check the size before:

$ wc -c < /tmp/strip 
220432

And also what file says before:

$ file /tmp/strip 
strip: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.26, BuildID[sha1]=0xa4aa26810da0b5672790975fc7e193520c9e2008, stripped

Now sstrip it!

$ sstrip /tmp/strip

This is the size after:

$ wc -c < /tmp/strip 
218404

The size has been reduced by 2028 bytes:

$ echo $((220432 - 218404))
2028

And here’s what file reports now:

$ file /tmp/strip
strip: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), for GNU/Linux 2.6.26, dynamically linked (uses shared libs), corrupted section header size

file complains that the section header size is corrupted, but the sstripped binary still seems to run fine.

speak up

Add your comment below, or trackback from your own site.

Subscribe to these comments.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

*Required Fields