I understand from other SO threads that gdb can debug both 32bit and 64bit binaries on a 64bit architecture, but when I run it I have the following issue :
Starting program: /root/crackme-01
/bin/bash: /root/crackme-01: No such file or directory
During startup program exited with code 127.
Here is the result of file on the program :
crackme-01: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=9feb70a8647779984dc69b1e5c90bd757343fb29, stripped
Is there anything else I should do to debug it?
Thanks for your help.
Use the run command to start your program under GDB. You must first specify the program name (except on VxWorks) with an argument to GDB (see section Getting In and Out of GDB), or by using the file or exec-file command (see section Commands to specify files).
Gdb is a debugger for C (and C++). It allows you to do things like run the program up to a certain point then stop and print out the values of certain variables at that point, or step through the program one line at a time and print out the values of each variable after executing each line.
GDB can only debug a program that can start by itself. In your case, the program couldn't start at all (not a single instruction was executed in user space for your process, the execve
system call failed). This:
/bin/bash: /root/crackme-01: No such file or directory
is almost always caused by missing program interpreter. You can see the interpreter like so:
readelf -l /root/crackme-01 | grep interpreter
In your case, the interpreter is almost certainly /lib/ld-linux.so.2
.
I was just missing the libraries
You were missing libc6:i386
, which ld-linux.so.2
is part of.
I was just missing the libraries as explained here
I needed to install the 32bit libs with :
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With