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
1 vote
0 answers
39 views

can't debug properly

In the last few days I tried to solve "unlink" challenge in pwnable.kr and I'm struggling to attach a debugger remotely and locally on the server using pwntools (code added below). #!/usr/...
  • 11
4 votes
0 answers
194 views

What utilities allow you to debug a process without pausing execution?

I was just reading this answer on StackOverflow, "How can you debug a process using gdb without pausing it?" The Linux kernel provides some support for this via PTRACE_SEIZE, but gdb doesn'...
  • 1,674
0 votes
1 answer
24 views

Gdb hardware watchpoint error on android

After failing to find a solution to this I have started using Gdb and have encountered another error. Gdbfails to set hardware watchpoint when I'm remote debugging a rooted arm7-a target. It supports ...
  • 144
0 votes
1 answer
68 views

Debugging Windows applications on Linux: Hardware watchpoints and backtracing in IDA not working and winedbg hardware watchpoints borderline unusable?

As in the title. Maybe someone has any experience with this. It's a significant impediment when trying to debug Windows applications on Linux. I find hardware watchpoints, in particular, to be ...
  • 115
1 vote
0 answers
49 views

Why Qiling doesn't recognize the right EntryPoint?

I'm trying to emulate an EFI driver. Luckily, I found a nice emulator called Qiling and try to debug it with GDB but it doesn't recognize the right Entry-Point. Here is the Entry-Point in IDA and in ...
  • 83
0 votes
1 answer
36 views

ROP: System function not printing results to stdout

in oder to solve a CTF-Challenge I have to construct a small ROP-chain. The scope of the ROP chain is to print the content of the `flag` file. I already constructed the ROP-chain, but it seems that ...
1 vote
1 answer
83 views

breakpoint already hit 1 time

I'm following Erickson 2008 Hacking the art of exploitation. The program is very simple. #include <stdio.h> #include <string.h> int main() { char str_a[20]; strcpy(str_a, "Hello, ...
0 votes
2 answers
274 views

Run a python in command (kali) with "run" on gdb-peda$

While debugging a program under gdb with gdb-peda installed, I need to pass args to the binary using output from something like python. Why I am not getting AAAAA? gdb-peda$ b doSomthing gdb-peda$ run ...
  • 11
0 votes
0 answers
16 views

Print CMarkupSTL object with GDB

CMarkupSTL is contain XML. How can I print that XML with GDB while I debug process? I run on Arm Linux
0 votes
0 answers
89 views

Debugging a security camera with gdbserver

I am just starting in reverse engineering and I have been stuck for a couple of weeks on this problem. It probably is a very basic question but I don't seem to be able to find an answer and I hope ...
0 votes
0 answers
38 views

Unable to redirect program because function address is not correctly written to the heap

I have a heap overflow example program (heap0.c)compiled as follows: gcc heap0.c -w -g -no-pie -z execstack -o heap0 In order to overwrite the instruction pointer with (BBBB = \x42\x42\x42\x42), I ...
1 vote
0 answers
25 views

Using rbreak without import functions

While debugging with GDB I want to break for each function and print the PC register. rbreak . define hook-stop i r $PC c end The problem is that is stop on functions that imported like printf ...
2 votes
1 answer
475 views

Debug shared library in Android application

There is an Android application that has a shared library (.so) file in split_config.arm64_v8a.apk that I want to debug . When I look at /proc/PID/maps I don't see that library (I do see the ...
  • 23
1 vote
1 answer
49 views

Adding ltrace information to gdb

I'd like to run gdb (or gdb-peda) with ltrace like info on each syscall. How can I do that? I know that, as per ltrace and gdb attach to same process , you can't actually attach ltrace and gdb to the ...
1 vote
1 answer
384 views

How can I find out the size of heap allocations?

While I debug with GDB I see the address of a buffer that's located on the heap. How can I know what is the size of this buffer? Or where (in the code) this buffer was originally allocated? When I ...
1 vote
1 answer
142 views

Connect remotely with GDBSERVER to pid

When I run gdbserver to listen for port and connect remotely with gdb: Gdbserver command: gdbserver --multi 0.0.0.0:4444 Gdb command: target remote 192.168.1.99 4444 In gdb . How can I connect to pid ...
  • 11
1 vote
0 answers
176 views

Passing a String into a Function With GDB

So, I have a function with the prototype according to GDB: {std::string (std::string)} 0x56027729e545 <function(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator&...
  • 11
0 votes
1 answer
112 views

PEDA: Don't show context

gdb-peda shows a very useful context each time it stops (b, si, etc.), but sometimes I don't want it. Is there any way to quiet it so it won't show the context automatically (unless prompted context)?...
0 votes
0 answers
178 views

Remote debugging with Binary Ninja on Windows possible?

Quick background -- I cannot start the .exe from a debugger; I need to attach after the fact. Binary Ninja's debugging plugin only allows attaching to a remote debug server and not a process. The ...
  • 101
1 vote
1 answer
56 views

Paint path in Ida according to gdb log file

In Gdb I put script that print each instruction to gdb.txt file. I want to load this file to Ida to show and print/paint the path that the process has been running. The gdb script is # not strictly ...
1 vote
0 answers
47 views

Handle Ioctl call while running with qemu

I am using qemu to emulate a binary like this qemu -strace XXXXX . I saw that the first 2 system calls of this process were TCGETS to stdin and stdout. From man pages Get and set terminal attributes ...
1 vote
1 answer
100 views

Debug bFLT in qemu-arm-static

I have bFLT binary (into linux-arm arch.) that I can run with qemu-arm-static . I want to debug that binary dynamically with GDB. I know I can debug binary with qemu like qemu-arm-static -g 1111 <...
2 votes
0 answers
1k views

How to decompile python ELF file (Compiled with Nuitka)?

I have some files that compiled with nuitka. formats are .bin. I could get shell access to running process with pyrasite same as this guide. but I cannot decompile function codes or anything else, and ...
  • 21
1 vote
1 answer
2k views

startup program exits with code 126 when executing program at entrypoint

I want to reverse engineer a program. I managed to find the entry point but every time I want to launch the application I get the same error `During startup program exited with code 126. Here is what ...
0 votes
0 answers
99 views

/bin/sh shell not execute when performing ret2libc attack

I have attempted to do a ret2libc attack. It's a simple buffer overflow with the return address pointed to the system call with the string "/bin/sh" on the stack. For some reason, when I try ...
2 votes
2 answers
190 views

Changing value of parameter with gdb

I have a file named exploit.c inside which: #include <stdbool.h> #include <stdio.h> const char y1 = 'a'; const char y2 = 'b'; const char y3 = 'x'; const char y4 = 'y'; const char y5 = 'i';...
3 votes
1 answer
97 views

Confused about the use of the shl instruction in this disassembly

I created a code construct in C to see how it looks in x86. I'm confused about the use of the shl instructions. I'm confused about what is happening in between the lines <+39> and <+51> I ...
2 votes
0 answers
397 views

How to perform full MIPS system emulation with QEMU, using the squashfs image and uBoot kernel image?

TL;DR: Need tips on emulation of MIPS-BE system using QEMU with the help of squashfs image file and uBoot Kernel image file extracted from the firmware file. Long Version: - What I have: A cheap ...
1 vote
2 answers
148 views

I'm confused about parameter in Printf function

I'm trying to understand call conventions and such. I created a function with the source code #include <stdio.h> int main() { int x = 9; printf("%d\n", x); } The above screenshot ...
2 votes
1 answer
363 views

GDB inserting breakpoint cause Segmentation Fault

I was trying to play around with gdb, and I'm especially interest in seeing how the Procedural Linkage Table(PLT) and the Global Offset Table (GOT) interact with each other. So I set some breakpoints ...
0 votes
0 answers
231 views

Using GDB to find the address of a buffer in a stripped C binary

I am working with a crackmes binary called Simple Overflow. It has two buffers with sizes 0x10 and 0x8, and it uses malloc to allocate two contiguous memory blocks (see <+25> and <+39> on ...
2 votes
2 answers
132 views

How can i recognize the length of this array based on the assembly instruction?

In the sourcecode i can clearly see that the Array called "buf" is 32 byte long since 1 char = 1 byte I assume that the array starts at the address [rbp-0x30] and the argv[ ] is stored in ...
1 vote
1 answer
259 views

Set gdb breakpoint by address with gdb python

into GDB python I tried gdb.Breakpoint('0xaaaa') I got error Function 0xaaaa is not defided . Breakpoint 5(0xaaaa) pending and the program not break at this address. Why is that?
0 votes
0 answers
555 views

Print write and comment into .gdbinit file

Is there any way how to write comment into gdb file? b*0x1111 # break point at function or b*0x1111 // break point at function or b*0x1111 ; break point at function That return an error . Or maybe is ...
  • 33
1 vote
1 answer
40 views

Define operations to do in specific breakpoints using GDB

In gdbinit I defined some breakpoints. How can I do that when specific breakpoint called I want to run x/s $r1 ?
  • 33
1 vote
1 answer
834 views

How to let SIGTRAP get caught by sighandler in GDB?

I have a program that I am trying to reverse, which contains an int3 (0xCC) which emits a SIGTRAP signal, which is then handled by a sighandler defined in sigaction. The handler performs calculations ...
0 votes
1 answer
1k views

Attach to process with gdbserver without stop it

I run gdbserver gdbserver --attach :<port> <pid> and then connect with gdb-multiarch The problem is that until I connect with gdb-multiarch and run c the process is stop. Can I continue ...
  • 33
1 vote
0 answers
113 views

What do you think is the optimum environment for reverse engineering dynamically-linked aarch64 Golang binaries developed in Alpine Linux?

Direct quote from Golang's website: "GDB does not understand Go programs well. The stack management, threading, and runtime contain aspects that differ enough from the execution model GDB expects ...
  • 257
4 votes
1 answer
2k views

Correct way to understand local_ in ghidra disassembly

Attached is the part of a disassembled main from a x86 binary file, generated by ghidra. ************************************************************** ...
  • 113
0 votes
0 answers
498 views

Remote Debugging an Aarch64 ELF File on Multiarch/Qemu-user-static (arm64v8/alpine) Docker Container

My goal is stated in the title. However, I think there is a fundamental issue with gdbserver. In particular, I create an aarch64 alpine docker container on a x86_64 Ubuntu 16.04 host using sudo docker ...
  • 257
4 votes
1 answer
931 views

ELF binary injection

I am currently working on an ELF-injector and my approach is standard: find code cave (long enough sequence of 0's), rewrite it with the instructions I want to execute and then jump back to the start ...
1 vote
1 answer
260 views

Edit IDA signal handler

In Ida Pro while debugging linux process with gdbserver I got window that show than SIGTRAP has been arrived, I choose to pass it to application. How can I edit that choose now? I want to ignore this ...
  • 11
1 vote
0 answers
158 views

Dynamic Analysis with gdb on ELF binaries with no compilation/linking information

I am trying to do some dynamic analysis on a couple of ELF binaries with gdb. However, since those two are directly downloaded (ELF binary file only) with no additional information related to ...
  • 11
0 votes
1 answer
1k views

How to watch a function's local variable in GDB?

I'm reversing a 64bit binary with gdb & peda and I've identified a function of interest (probably encoding user input). I want to watch the function interesting's local variable arg1. How can I ...
0 votes
0 answers
83 views

ret2libc exploit issue

i have some code in c i am working to write exploit for it: #include <stdio.h> void secretFunction() { printf("Congratulations!\n"); printf("You have ...
0 votes
1 answer
241 views

Setting Breakpoints on Thumb Instructions in GDB

I'm practicing reversing a stripped arm binary, and found that when I set a breakpoint at say 0x010451, and run the program, gdb spins forever until I hit ctrl+c. When I do, the current pc is at the ...
  • 101
1 vote
1 answer
407 views

GDBserver on Qemu not honoring "follow-fork-mode child"

I am using gdb-multiarch version 9.1 on Ubuntu to connect to a qemu-mipsel-static version 4.2.0 running a MIPS application which daemonizes itself with fork(), and which is running the built-in ...
1 vote
1 answer
315 views

Is it possible to find a running process's arguments to main from an attached GDB?

Given a very basic program, perl -e'$|=1; print $$; sleep 500;' HELLO WORLD How can I find HELLO WORLD using GDB? I thought bt -full but when I attach and run, I get #0 __GI___clock_nanosleep (...
  • 1,674
1 vote
1 answer
94 views

Use dtrace, lldb or gdb to find which file or line of code was responsible for a line of output in stdout or stderr?

I see a string being output to my Terminal, when I ran an executable. I have the source code (in C) of the executable, but it was not written by me. I compiled it with -g flag. Is there any way to ...
0 votes
1 answer
662 views

Can I force GDB breakpoints and disassemble?

Sorry English isn't my first language. I noticed something when setting breakpoints in GDB. It appears that they are ignored if symbols aren't loaded. I have found it weird how GDB behaves when there ...
  • 723

1
2 3 4 5 6