mahaloz / decomp2dbg

A plugin to introduce interactive symbols into your debugger from your decompiler
BSD 2-Clause "Simplified" License
586 stars 37 forks source link

pwntools gdb: 'NoneType' object has no attribute 'lfile' #77

Open j4k0xb opened 8 months ago

j4k0xb commented 8 months ago

gdb 13.1 gef 2023.08 ghidra 10.4

It can't connect to ghidra when gdb is launched from https://github.com/Gallopsled/pwntools. Only with gdb ./test or gdb --pid $(pidof test) it works.

Reproduction:

#include <stdio.h>

int main() {
  printf("Hello, World!\n");
  return 0;
}
gcc test.c -o test
pwn template test > exploit.py
python exploit.py GDB
gef➤  decompiler connect ghidra
Python Exception <class 'AttributeError'>: 'NoneType' object has no attribute 'lfile'
Error occurred in Python: 'NoneType' object has no attribute 'lfile'
mahaloz commented 8 months ago

@j4k0xb thanks for the easy to reproduce example! My theory is that this is actually a GEF bug. I haven't been able to test without yet though. Can you disable GEF and see if you can still reproduce this crash?

j4k0xb commented 8 months ago

Confirmed it doesn't crash anymore with GEF disabled