mahaloz / decomp2dbg

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

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

Closed j4k0xb closed 4 months ago

j4k0xb commented 1 year 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 1 year 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 1 year ago

Confirmed it doesn't crash anymore with GEF disabled

mahaloz commented 4 months ago

Hi @j4k0xb, I've rechecked this on the latest GEF and latest d2d. It appears to be fixed now. If not, feel free to reopen.