The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [gdb]

A source level debugger based on `ptrace` for *NIX systems and developed by the GNU project.

Filter by
Sorted by
Tagged with
3
votes
1answer
377 views

How to test if register value is unavailable in gdb?

I'm using a .gdbinit file that is supposed to print the values of all registers at every hook_stop, followed by the stack and data frames. However, when running many programs, there are often segment ...
4
votes
1answer
1k views

How Can I Debug A Bios Better

I am trying to reverse engineer a firmkit in a bios, but in general I would like to know how can I debug a bios better. I found a way to attach IDA to a vmware instance usign a GDB session GDB ...
2
votes
2answers
1k views

Help with IOLI crackme0x02

I am studying IOLI crackme0x02. It is clear to me that rewriting the jump at 0x8048451 with no instructions the crackme can be patched. However, I want to understand better what the code does. My ...
6
votes
1answer
2k views

How to get a full execution trace with Python gdb?

While trying to answer another question, I tried to set-up a Python script to automatize the extraction of an assembly execution trace. But, I am really not satisfied of this script and I would like ...
3
votes
1answer
9k views

how to setup IDA pro linux GDB server

I have Ubuntu 14.04 x64 and I am running Ida pro V6.6 in virtual box in windows 8 ... currently I want to debug some Linux elf's using Ida either via IDA linux remote server or gdbserver but I don't ...
2
votes
1answer
523 views

Unpacking and the ESP trick

I recently heard about the esp trick: some packers push all registers on the stack, and when unpacking is done, they are restored. Placing a hardware breakpoint on esp we can stop there and get the ...
0
votes
1answer
256 views

buffer overflow-seg fault

I am trying to overflow a buffer, which has a size of 0x201 bytes, and get a shellcode. The program that contains the buffer,there is a call to ptrace() (on itself), therefore the shellcode I'm using ...
0
votes
2answers
1k views

Detecting debugger with `rdtsc`

I am reading Eldad Eilam's book titled Reversing. In Chapter 11: Breaking Protections, there is a crackme called Defender, which creates a dedicated thread, which repeats the following steps: 1. ...
1
vote
0answers
191 views

An anti debug method on Linux [duplicate]

I have found this question (linux) How to debug a "debugger"? It is an anti debug technique, the parent creates a forked process and ptrace it. Now gdb can not attach top the child process. ...
0
votes
1answer
655 views

Hiding call to ptrace [duplicate]

I am trying to detect whether my executable is running in a debugger. Here is a solution using ptrace. My problem is that even if my executable is stripped (strip a.out) I am able to find with gdb the ...
2
votes
2answers
406 views

Reverse engineering self-checking binary

I have linux binary, written in C. During runtime I calculate the checksum of the binary, and it seems that this prevents setting up gdb software breakpoints in it. How safe is this from a reverse ...
3
votes
1answer
745 views

using GDB and dealing with breakpoint detection

I am trying to solve a reverse engineering challenge using using gdb. I can run the program inside it but when I set a breakpoint at main then I get Program received signal SIGSEGV, Segmentation ...
1
vote
1answer
590 views

Set Breakpoint at Entry point fails (GDB)

I'm currently practicing some RE w/ GDB and am having issues simply stopping the run/start on the first/second instruction. I am new to GDB/RE and have a limited knowledge of some of GDB's inner ...
0
votes
1answer
3k views

Strcpy BufferOverflow get shellcode location for EIP

I am trying to get a shellcode, exploiting a C program with a strcpy() function. I have found out that I need 68 bytes to start writing on the EIP. So, if I write 72's by EIP register is 0x41414141. ...
5
votes
1answer
2k views

Writing an exploit for sample-application

I understand the principles of exploiting a classical stack-based buffer-overflow, and now I want to practice it. Therefore I wrote the following test-application: #include <stdio.h> #include &...
0
votes
1answer
2k views

How To Set Breakpoints On An Assembly Program Not Compiled With Debugging Symbols?

I have an executable file I put together from an demo powerpc assembly program I whipped together. AssemblyProgram.s .global _Start .text _Start: addi 3, 0, 0xa addi 4, 0, 0xb addi 5, 0,...
2
votes
0answers
1k views

Debugging a position independent executable ELF

I am trying to follow the write-up about hackercalc (a challenge for DEFCON 2015 quals). First, by loading the challenge into gdb, I observe that: (gdb) info files ... Entry point: 0xcf8 ... So I ...
1
vote
1answer
552 views

Variable's position on stack

I wanna create a script/program that will modify value in memory of another process. With GDB I've discovered that variable I want modify is located on heap. Because this variable is create ...
3
votes
2answers
2k views

How to stop debugger right after the execution?

I'm using /bin/true as my sample binary (without available main method): $ lldb /bin/true (lldb) target create "/bin/true" Current executable set to '/bin/true' (x86_64). (lldb) break main invalid ...
1
vote
0answers
149 views

How to dump PHP backtrace on live running script in lldb?

I'm trying to print PHP backtrace of the live running script using the following 2 simple steps: Run PHP script as: php -r "sleep(1000);" On another console, I've called directly ...
5
votes
1answer
2k views

How to get current PHP function name in gdb?

I'm following these steps to locate the current PHP function call as below: Run dummy script: $ gdb -ex run --args php -r "sleep(10);" Pressed Ctrl+C to get back to gdb to run: (gdb) bt full #1 ...
1
vote
1answer
432 views

lldb - breakpoint not reached when attach do process (but executing when set before app running)

I am trying to set breakpoint to existing processes, but when i am trying to do it breakpoint is not reached, but when i am running app directly in lldb and set breakpoint before it runs all ...
1
vote
0answers
233 views

gdbserver doesn't trigger breakpoints

I'm debugging a vulnerable app on a remote host. I've set up gbserver on the host with: gdbserver host:1234 /my/target/app On my local host I've connected with: $ gdb /same/target/app gdb$ target ...
2
votes
2answers
6k views

Debug binary with GDB & disassembly: File format not recognized (elf headers corrupted)

I'm trying to reverse engineer a binary file using GDB and objdump. I can execute the binary in my linux shell, however the file seems to be changed in a way that it can't be debugged / reverse ...
3
votes
1answer
4k views

Output of gdb `info registers`

Upon running info registers in gdb, we get an output similar to the following: rax 0x1c 28 rbx 0x0 0 rcx 0x400a60 4196960 rdx 0x7fffffffde88 ...
2
votes
3answers
1k views

Books on reversing with GDB?

I'm getting started with some reverse engineering lately, especially on Linux and ELF format, but I'm struggling here. For now I'm only using GDB to disassemble binaries, and even though I can read ...
2
votes
0answers
2k views

Remotely debugging Android native ARM library running in Bluestacks

I want to debug a native library loaded by JNI on Android. I have set up the debugging environment to debug native code running on Bluestacks. I got gdbserver installed on rooted Bluestacks, running ...
18
votes
3answers
25k views

Cross debugging for ARM / MIPS ELF with QEMU/toolchain

as i'm new about cross-debugging and cross-compilation i need some help because i feel so confused. I have a MIPS elf file, [myelf][1] .You can see bellow the output of file myelf: myelf: ELF 32-bit ...
2
votes
0answers
1k views

How to set-up GDB debugging in IDA Pro on Linux via Wine?

I tried running on linux via root terminal: gdbserver --multi localhost:23947 And then at IDA Pro at Wine I use Remote GDB debugger with my local ip and port: However when I start debugging I think ...
14
votes
2answers
12k views

Set a breakpoint on GDB entry point for stripped PIE binaries without disabling ASLR

Given a position-independent, statically-linked, stripped binary, there does not appear to be a way in GDB to set a breakpoint at the entry point without disabling ASLR. break start and similar ...
2
votes
1answer
613 views

Custom gdb output

Yesterday i noticed a nice output from dbg while going through a write up on the internet. As am new to dbg i googled a lot as i wanted to make dbg work similar for me. As seen below this ...
0
votes
1answer
1k views

Can either volatility or GDB dump only the heap memory of a process under Linux?

What I am looking to do is programmatically analyze the contents of each processes heap on a system I control. I've been searching for an easily scriptable way to do this with either gdb, or ...
2
votes
1answer
2k views

Why/how is GDB allowed to attach to a process and read/write to attached process' address space?

The fact that GDB can attach to any process without having su rights is terrifying to me. For example, what prevents me from writing a malware/virus(/whatever the correct term is) that uses same ...
0
votes
1answer
851 views

ldd doesn't show dynamic libraries

I'm trying understand how some parts of a closed source program distributed as a stripped binary implemented. When I run ldd on the program, it prints only 4-5 most basic C libraries as dynamic ...
2
votes
1answer
11k views

Problem finding return address for shellcode

Howdy guys and ghouls, I've got a classic b0f, in fact it's the protostar stack5 exercise link to stack5 code Now I have the buffer + shellcode running up to overwriting EIP and I need to provide ...
5
votes
2answers
253 views

Returning a C function to its grandfather

This is a homework assignment, so I'd appreciate it if I would get a hint only, not a full answer. I wrote this program which is supposed to print the following: Executing function_a Executing ...
2
votes
1answer
3k views

Using GDB to modify an executable

I'm working on an assignment for a systems programming class, and for extra credit we are asked to modify an executable to allow it to accept the reverse of our PIN (finding the PIN was the original ...
2
votes
1answer
326 views

Adding Types to GDB via Python

GDB has a reasonably robust API which is exposed to Python at runtime. It allows for inspecting various types, but does not appear to allow creation of types. However, types can be manually added by ...
2
votes
1answer
3k views

What does Hopper's Debugger Server do?

Hopper offers a GDB/LLDB Debugger Server companion to the standard program. I'm unclear on what this should / can be used for. When I run the debugger server on the same machine that I'm using I see ...
1
vote
0answers
120 views

How to find maximum and minimum process boundaries while debugging?

If I'm using GDB or any other debugger, I just want to know where the respective images are loaded for a given process. Say I create an executable HelloWorld, and it just prints hello. It has a ...
2
votes
2answers
3k views

How can I change the value of a variable while debugging?

I know that I can output the value of a variable using (gdb) p var_name $1 = "varvalue" Is there a way to set the value of a variable while debugging with gdb? The document that I'm using doesn't ...
3
votes
1answer
2k views

How to rebase IDA to match GDB

I would like to debug my elf file on linux using GDB and follow the disassembly in IDA, is this possible? And if it is how would I rebase IDA to match with GDB? Thanks!
1
vote
1answer
801 views

How to debug a binary with the relative path in argv[0]?

I have a binary test that I want to debug with gdb. As you can see pwd is /tmp: $ gdb (gdb) file test Reading symbols from /tmp/test...(no debugging symbols found)...done. (gdb) pwd Working directory ...
1
vote
2answers
96 views

ELF File format Two terminating null dword towards 0xc0000000?

While I was reversing an elf binary, I tried to manually compute my environment variable's address. Therefore I found this documentation and we're said that there is one NULL DWORD at the end of the ...
7
votes
2answers
10k views

Why does `ldd` and `(gdb) info sharedlibrary` show a different library base address?

I see three different outputs for where libc should be loaded. ldd shows the loading address of libc at 0xf7e9e000 $ ldd ~/my_tool linux-gate.so.1 => (0xf7ffe000) libc.so.6 => /lib/...
6
votes
2answers
1k views

(linux) How to debug a “debugger”?

I'm trying to understand a program. This programm implements an antidebug technique. From what I've understand so far, the father ptrace a forked process. An the child does something like that: ...
8
votes
2answers
2k views

Hopper on Linux — how to use GDBserver

I'm looking for a good front-end to GDB and looks like Hopper is a good alternative. Unfortunately, I wasted several hours but still couldn't make it working with gdbserver. Here are the steps I'm ...
1
vote
1answer
2k views

Debug httpd process

I'm attempting to inspect memory of an httpd binary compiled statically with openssl. When I list the httpd processes, I get: $ ps aux|grep httpd root 58539 0.0 0.7 75364 3740 ? Ss ...
1
vote
0answers
3k views

Debug Android Native Code without source

Id like to debug (to log function calls) native ARM Android Code in a shared library. So far I got no source and tried to disassemble it with IDA, but its hard to track all the calls down to a ...
6
votes
1answer
2k views

Can I send gdb command from IDA Debugger to gdbserver?

I want to send gdb command (like "backtrace", "b *0xAAAAAAA", "i b", ...) from IDA debugger to gdbserver over gdb remote debugging and receive result and print it to output view of IDA, can I do it? ...