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
17 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 ...
0
votes
0answers
22 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
44 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
38 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
1answer
31 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
38 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
36 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 ...
4
votes
1answer
1k views

GDB find string strange results

I'm playing with gdb and strange things are happening. I wanted to find some address in memory where string "/bin/sh" is located, and gdb says it found it. But when I examine the memory there, the ...
0
votes
0answers
34 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/...
2
votes
1answer
289 views

Why do we need to know the address of shellcode?

I have read many articles regarding the buffer overflow exploit. Everywhere its written as follow. "It's difficult to know the starting address of the shellcode" Why do we need to know the address ...
1
vote
2answers
584 views

pwntools shellcode narnia2

I'm trying to solve the narnia2 challenge on overthewire. I read a guide for help and managed to overwrite the stack with A's using some python $(python -c "print 'A'*132 + '\xef\xbe\xad\xde'") ...
0
votes
0answers
39 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
58 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
48 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 (...
0
votes
1answer
62 views

What's wrong with my mitm to support rr commands with gdbserver on IDA?

First of here is the gdb remote protocol doc. The idea of the below script is the following - you enter an actual command (one that will be send as a direct packet see packets) in the gdb window then ...
2
votes
2answers
344 views

Can't trace MIPS embedded device remotely

I'm trying to debug a remote device using gdbserver and IDA Pro. I'm attached to the correct PID and I'm able to step through instructions until the point where I redirect $pc to my ROP chain. At the ...
0
votes
1answer
36 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
26 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?
1
vote
3answers
2k 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 ...
2
votes
2answers
43 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
81 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
votes
2answers
58 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 ...
1
vote
1answer
35 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
77 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
0answers
29 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 ...
0
votes
1answer
50 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
49 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
47 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 ...
2
votes
0answers
1k views

IDA Pro GDB QEMU Tricore setup

I have added the lines below to IDA 6.95\cfg\gdb_arch.cfg to try to get QEMU Tricore debugging in IDA Pro, using an ARM tutorial as the basis (page 2): https://www.hex-rays.com/products/ida/support/...
2
votes
1answer
76 views

Arrangement of variables on the stack - out of order?

I was practicing some reverse engineering crack-mes as part of our university curriculum, and I have a question around the arrangement of variables on the stack. I have a very basic C++ code, like ...
0
votes
1answer
34 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
34 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
41 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
127 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
0answers
17 views

compile gdb with python 3 for gef-ida-interact

I'm trying to use GEF's IDA-interact which has issues with python2. I'm using android-ndk-r20b/prebuilt/linux-x86_64/bin/gdb - v7.11 using Python engine 2.7 How do I compile gdb with python 3.x ? I ...
0
votes
1answer
73 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 ...
0
votes
0answers
21 views

Using Gdb-Server with Ida 7.4 failed

I have gdb-server to arm , downloded from https://github.com/therealsaumil/static-arm-bins/blob/master/gdbserver-armel-static-8.0.1. When I use Ida 6.6 to connect remotly to this gdb-server that work ...
2
votes
1answer
106 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 ...
1
vote
2answers
265 views

new process id generated during gdb debug

I debug a ELF32 executable in Ubntu 14, I set gdb breakpoint in main, after i click run, the program generate a new process 13050 and exited, I can't use info register to display value and continue ...
0
votes
3answers
2k views

Use GCC and objdump to disassemble any hex to assembly code

What would be the best way (also fewer steps) to generate assembly code for a given hex code ? For e.g., if we know the architecture is x86, and given hex value 0x55, what is the best way to generate ...
0
votes
1answer
215 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?
18
votes
3answers
15k 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 ...
0
votes
0answers
87 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, ...
85
votes
17answers
109k views

Decent GUI for GDB

Learning the GDB commands is on my bucket-list, but in the meantime is there a graphical debugger for *nix platforms that accepts Windbg commands, and has similar functionality? For example, the ...
0
votes
1answer
205 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. ...
4
votes
3answers
5k views

Can not continue debugging after SIGTRAP

I am trying to debug an iOS app with gdb and when I hit a breakpoint I get this error, and can not continue. Program received signal SIGTRAP, Trace/breakpoint trap. [Switching to process 190 thread ...
24
votes
4answers
33k 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 ...
6
votes
2answers
8k views

Fixing corrupt ELF header field “e_shnum” for use in GDB

If the ELF header which usually can be read using readelf has been manually manipulated, let's say by increasing the value for the "Size of section headers" the binary still can be executed and works ...
1
vote
0answers
17 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
vote
1answer
263 views

how watchpoint on register works

GDB has an option to set watchpoint on register*, how does it work ? what happens during context switching ? why the only implementation is for mips ? Is there a way to make it work for lldb also ? *...

1
2 3 4 5