Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: x-terminal does not work properly gdb.attach #2359

Closed
wants to merge 1 commit into from
Closed

fix: x-terminal does not work properly gdb.attach #2359

wants to merge 1 commit into from

Conversation

cnitlrt
Copy link

@cnitlrt cnitlrt commented Feb 28, 2024

env

No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.6 LTS
Release:	20.04
Codename:	focal
python --version                                                                                                                                                      130 ↵
Python 3.8.10

When I tried to use attach in x-terminal, I found that I could not attach normally. After attaching, it always ran the script directly. Through tracing, I found that run_in_new_terminal returned the wrong gdb_pid.

//gcc test.c -o 1
#include <stdio.h>
int main(){
    puts("hello world");
    char buf[0x20] = {0};
    read(0,buf,0x20);
    puts("hello world");
    read(0,buf,0x20);
}

test.py

from pwn import*
context.log_level = "debug"
# context.terminal = ["tmux","split","-h"]
p = process('./1')
p.send("bbbb")
attach(p)
p.send("aaaa")
p.interactive()

image

@cnitlrt cnitlrt closed this Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant