Skip to main content
Notice removed Draw attention by CommunityBot
Bounty Ended with no winning answer by CommunityBot
added 394 characters in body
Source Link

I'm trying to debug binaries of a a firmware running Linux with no ASLR, binaries are not compiled with PIE either so I have no issue getting the memory locations.

So after including gdbserver in the firmware and running, I connect to it from my machine and insert the breakpoint, the breakpoint is inserted successfully (sometimes gdb adjust the breakpoint location), and I continue the execution, and when the breakpoint is hit, I get the following in gdbserver:

enter image description here

I know that memory locations are correct by comparing bytes at location in gdb when debugging, and in Ghidra and they are identical.

This a mips architecture, and I compiled the gdbserver based on it, here is the file command result:

gdbserver: ELF 32-bit MSB executable, MIPS, MIPS-I version 1 (SYSV), statically linked, with debug_info, not stripped

I even tried to debug directly through gdb from the emulator, I failed to compile 7.7, 8.1 and 9.1, successfully compiled 7.9 but it crashes right after running, but I'm more interested in running gdb in the host machine, so I'm not really tried to fix this one.

Edit:

Following @Mega instructions and compiling gdb for target="mips-linux-gnu" instead of just using gdb-multiarch in host, I'm getting this error when a breakpoint is hit:

enter image description here

And on the host it says:

Program terminated with signal SIGTRAP, Trace/breakpoint trap. The program no longer exists.

I'm trying to debug binaries of a a firmware running Linux with no ASLR, binaries are not compiled with PIE either so I have no issue getting the memory locations.

So after including gdbserver in the firmware and running, I connect to it from my machine and insert the breakpoint, the breakpoint is inserted successfully (sometimes gdb adjust the breakpoint location), and I continue the execution, and when the breakpoint is hit, I get the following in gdbserver:

enter image description here

I know that memory locations are correct by comparing bytes at location in gdb when debugging, and in Ghidra and they are identical.

This a mips architecture, and I compiled the gdbserver based on it, here is the file command result:

gdbserver: ELF 32-bit MSB executable, MIPS, MIPS-I version 1 (SYSV), statically linked, with debug_info, not stripped

I even tried to debug directly through gdb from the emulator, I failed to compile 7.7, 8.1 and 9.1, successfully compiled 7.9 but it crashes right after running, but I'm more interested in running gdb in the host machine, so I'm not really tried to fix this one.

I'm trying to debug binaries of a a firmware running Linux with no ASLR, binaries are not compiled with PIE either so I have no issue getting the memory locations.

So after including gdbserver in the firmware and running, I connect to it from my machine and insert the breakpoint, the breakpoint is inserted successfully (sometimes gdb adjust the breakpoint location), and I continue the execution, and when the breakpoint is hit, I get the following in gdbserver:

enter image description here

I know that memory locations are correct by comparing bytes at location in gdb when debugging, and in Ghidra and they are identical.

This a mips architecture, and I compiled the gdbserver based on it, here is the file command result:

gdbserver: ELF 32-bit MSB executable, MIPS, MIPS-I version 1 (SYSV), statically linked, with debug_info, not stripped

I even tried to debug directly through gdb from the emulator, I failed to compile 7.7, 8.1 and 9.1, successfully compiled 7.9 but it crashes right after running, but I'm more interested in running gdb in the host machine, so I'm not really tried to fix this one.

Edit:

Following @Mega instructions and compiling gdb for target="mips-linux-gnu" instead of just using gdb-multiarch in host, I'm getting this error when a breakpoint is hit:

enter image description here

And on the host it says:

Program terminated with signal SIGTRAP, Trace/breakpoint trap. The program no longer exists.

Tweeted twitter.com/StackReverseEng/status/1600233631972483072
Notice added Draw attention by Soufiane Touil
Bounty Started worth 50 reputation by Soufiane Touil
edited title
Link

GDB breakpointsbreakpoint crashes at a correct memory location

Source Link

GDB breakpoints at a correct memory location

I'm trying to debug binaries of a a firmware running Linux with no ASLR, binaries are not compiled with PIE either so I have no issue getting the memory locations.

So after including gdbserver in the firmware and running, I connect to it from my machine and insert the breakpoint, the breakpoint is inserted successfully (sometimes gdb adjust the breakpoint location), and I continue the execution, and when the breakpoint is hit, I get the following in gdbserver:

enter image description here

I know that memory locations are correct by comparing bytes at location in gdb when debugging, and in Ghidra and they are identical.

This a mips architecture, and I compiled the gdbserver based on it, here is the file command result:

gdbserver: ELF 32-bit MSB executable, MIPS, MIPS-I version 1 (SYSV), statically linked, with debug_info, not stripped

I even tried to debug directly through gdb from the emulator, I failed to compile 7.7, 8.1 and 9.1, successfully compiled 7.9 but it crashes right after running, but I'm more interested in running gdb in the host machine, so I'm not really tried to fix this one.