Tuesday, March 10, 2009

Android: Binary solo

All right, so I got an Android and have been messing with it a bunch. One of the things I did is get tcpdump installed on it. 4.0 seems to be running fine. For the impatient ones, here's a binary that you can just throw on the phone.

This guy was quite nice to put up ARM cross compilation steps for tcpdump/libpcap. You need a cross-compiler for this setup. I used the openmoko toolchain, since it's easy to setup. You can also use the Android source to do this (I think), but I already had openmoko setup.

I had to edit the tcpdump source to disable IPv6 stuff in one function, where it's not ifdefed out. Here's the diff.

NB: make sure to edit the Makefile for tcpdump and remove the -O2 flag and add the -static flag to the linker (LD_FLAGS += -static). Happy tcpdumping :) Update:

Apparently, Michigan removed my home directory, as I am no longer at the university. However, looks like the Symantec folks wrote up a pretty detailed blog spot about this last year, so you could follow their instructions. I recall the only important part being to be sure to statically link the binary. Good luck!


  1. I really like, though not as much as someone else. Really nice!

  2. cool dude your other posts are even more cool ,Just came across you blog by chance while searching for tcpdump.Nice work keep rambling .

  3. Hi I was set up toolchain and I was build to binary but I don't run in android . Please show me detail "How build source C and it can run in android "

  4. Hmmm, Thanx a lot..
    I was just curious to know how to analyse the network traffic in WireShark..

    What are the column fields and various data represented in this ??

  5. Thanks for your efforts. This has saved me a lot of time.

  6. Its a good blog and i think most of internet users are likes your information, so please create more blogs like this, because its good benefit for those peoples. thanks for sharing a wonderful information.