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
0
votes
0answers
20 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';...
2
votes
1answer
26 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
0answers
32 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
2answers
54 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 ...
0
votes
1answer
23 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
0answers
42 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
2answers
88 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
1answer
45 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
0answers
28 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 ...
0
votes
1answer
29 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 ?
1
vote
1answer
57 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
1answer
101 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 ...
1
vote
0answers
47 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 ...
2
votes
1answer
320 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. ************************************************************** ...
0
votes
0answers
156 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 ...
3
votes
1answer
191 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 ...
0
votes
0answers
34 views

Use IDAPython to automatically attach to a remote GDB server

I would like to automate the process of connecting to a remote debug server. The following code worked for the remote win32 debugger: from ida_dbg import * set_remote_debugger(addr, port) ...
0
votes
0answers
25 views

Determine the PE Header load location and size in Cygwin GDB

I am currently writing GDB extensions using Python, GDB, and GEF. Due to project requirements, I need to support PE binary formats. To do this I've been using Cygwin's GDB version 8.3.1-1. Note: the ...
1
vote
1answer
53 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 ...
1
vote
0answers
77 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 ...
0
votes
1answer
304 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
0answers
47 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
1answer
61 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 ...
0
votes
0answers
39 views

picoCTF challenge “leap-frog” - issues between gdb and binary

I'm trying to complete the picoCTF 2019 "leap-frog" challenge: Binary: https://2019shell1.picoctf.com/static/ff335b3bb19a0112bdd86ca8b4f0b473/rop Source: https://2019shell1.picoctf.com/...
0
votes
0answers
73 views

IDA debug Android native app receive SIGPWR signal cannot resume

I'm trying to debug an Unity game app mono. First i use frida to spawn app launch and attach app pid, second i pause app process,and then i run android_server with IDA take breakpoints in, finally ...
1
vote
1answer
150 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
1answer
63 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
vote
1answer
52 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
1answer
152 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 ...
0
votes
0answers
28 views

How to paint running code with Ida gdb-server

I running IDA that is connected to gdb-server and I am using idapython with sark. I want to paint all lines that are running (while debug) in IDA. How can I do that?
2
votes
2answers
47 views

How to call to function while debug

When I debugging remote process with gdb-server and Ida, and put breakpoint in the code, when the process stopped at this breakpoint how can I call to function and after that return to my code ?
1
vote
1answer
246 views

How can I get my shellcode to work outside of GDB?

I'm working inside a Warzone VM with no ALSR or NX bit. The program I'm trying to exploit is really simple: #include <stdlib.h> #include <stdio.h> #include <string.h> /* * ...
1
vote
1answer
42 views

GDB exited when running library

I'm new with gdb and I have spent hours looking for direction but I can't find any. I need to analyze an executable to find how this program process the arguments and where the output came from. I ...
0
votes
0answers
115 views

Help explain warning messages when running gdb

[System: mac mojave 10.14.6, gdb 9.1 installed via brew] I have recently installed gdb and am a newb user. After many hours of searching, I got it working by following the instructions from https://...
0
votes
1answer
42 views

Debug process that use /dev/watchdog

I want to debug a process with gdb, but the problem is that process pings /dev/watchdog so when I tried to debug it, it stop the process for longer than the watchdog interval so the system is ...
-1
votes
2answers
62 views

Is address in program can change

I talking about linux arch. When I open program in Ida (statically ) I can see all instructions address like 0x20da mov r8 r2 When I want use that address to breakpoint (for example with ptrace or ...
0
votes
1answer
109 views

How to detect which shared libraries a binary is actually using?

I have a stripped-down Linux-based embedded system where a closed-source program(32-bit ELF binary for MIPS) depends on several shared libraries. Two of those libraries are actually the same libcurl ...
0
votes
0answers
86 views

How to debug with gdb (rbreak) in order to obtain a callback to be used on C# interop

Well, I have several questions about this topic. I don't know if I'm using the right method to achieve what I need. I need to debug which exact method does something inside a process in order to ...
0
votes
0answers
77 views

Parsing C header files from DWARF Debug File

I have a Linux executable that has a linked .debug file containing DWARF debug info and I would like to find a way to parse C headers for types defined in the executable. Using gdb and ptype I can ...
0
votes
1answer
42 views

GDB disassembly - breakpoint problem

My question is, when i dont use any breakpoint it show the message saying "You made it, now keygen me!", but when i put a breakpoint in the main, or any other place it will show a message about ...
1
vote
1answer
39 views

Why does this x64 stack have other bytes and seems to be in reverse order?

I wrote the following small C program and you can also see the stack in the screenshot. My question is twofold: How come there are entire rows of other data between the 3 stack strings? Why is my ...
-1
votes
1answer
51 views

ASLR and it's effect

I was debugging some programs with gdb, I already set the disable-randomization to on, but I was having trouble, I set a break point and examined that the $sp is different everytime, what causes this ...
0
votes
1answer
308 views

GDB - Send Python output to the program after SIGINT

I am trying to learn GDB to better understand buffer overflows but I can't find an answer to my problem which is how can I send a Python-generated output to the program when the program asks for user ...
0
votes
1answer
93 views

How can I debug open source C code for Linux?

I want to debug & reverse engineer open source code such as this project. I usually use CLion to write and debug C code on Linux. I've also used GDB. What steps do I need to take to download a ...
2
votes
1answer
192 views

Why is there no call to strcpy in assembly?

I try to better understand assembly and currently playing around with some compiled c snippets. I have the following snippet: #include <stdio.h> #include <string.h> int main() { char ...
0
votes
1answer
699 views

Dumping the GOT with gdb at run time

I want to see how the plt stubs are being resolved at run time when lazy linking is used and how the GOT is changed along the way. How can I dump the GOT with gdb?
3
votes
3answers
4k views

GDB hangs when I try to run and debug a binary

When I type gdb a.out and then run inside the gdb itself I get stuck on the empty line: jericho-laptop:exploit.education jericho$ gdb a.out GNU gdb (GDB) 9.1 ... Reading symbols from a.out... (No ...
0
votes
0answers
89 views

Disassembly - First steps

I decided that I need to understand this more thoroughly, so am working in parallel with two resources: one more modern and one original from @Aleph1. In the essay, there is a basic code snippet, ...
0
votes
1answer
332 views

IDA Pro ignores condition in breakpoint

Look at the condition. It is supposed to break only when the R2 is 40, but it breaks in any call to this instruction. I'm using IDA Pro 7.2.181105, debugging with Remote GDB Debugger, an ARMv4T code. ...
1
vote
0answers
27 views

Debug only one thread with ida-gdb server

If I want to debug process in embedded that running linux , I can run gdb-server in embedded and attach to process with Ida. The problem is if this process has 1 thread that can't stop over than x ...

1
2 3 4 5