Compiling LDasm in Ubuntu 12.04 amd64

Hi Folks,
In this post, I’ll show you how to compile and install the LDasm 0.04.53 on ubuntu 12.04 amd64. Firstly, you will need to download a compressed ldasm file in this link http://freecode.com/projects/ldasm.

Before you compile, you’ll need change some code in ptrace/ptrace.c .

  1. Change linux/user.h to sys/user.h
  2. Change typedef enum { FALSE = 0,TRUE } Bool; to typedef enum { False = 0,True } Bool;
  3. Change all instances of _cooked_size to size
  4. Change all instances of eip to rip

In ptrace/Makefile

Change COPTS to COPTS   = -W -Wall -g
Change LIBS to LIBS    = -lbfd -liberty

and finally, type

$ make

$ sudo make install

😀