pwndbg / pwndbg

Exploit Development and Reverse Engineering with GDB Made Easy
https://pwndbg.re/
MIT License
7.22k stars 867 forks source link

Ghidra not working #947

Open 0zing opened 3 years ago

0zing commented 3 years ago

Trying to use the ghidra plugin from pwndbg I get: radare2 plugin r2ghidra must be installed and available from r2 or

I went on a long search and finally came close to the issue: pwndbg> python-interactive >>> import r2pipe >>> r2pipe >>> import pwndbg >>> pwndbg >>> import gdb >>> gdb >>> r2 = pwndbg.radare2.r2pipe() >>> r2.cmd("LD").split("\n") |ERROR| Invalid command 'D' (0x44) ['Usage: L[acio] [-name][ file]', '| L show this help', '| L blah.so load plugin file', '| L-duk unload core plugin by name', '| La list asm/anal plugins (aL, e asm.arch=??)', '| Lc list core plugins', '| Ld list debug plugins (same as dL)', '| LD list supported decompilers (e cmd.pdc=?)', '| Le list esil plugins', '| Lg list egg plugins', '| Lh list hash plugins (same as ph)', '| Li list bin plugins (same as iL)', '| Ll list lang plugins (same as #!)', '| LL lock screen', '| Lm list fs plugins (same as mL)', '| Lo list io plugins (same as oL)', '| Lp list parser plugins (e asm.parser=?)', ''] >>> r2.cmd("LD") 'pdc\npdg\n' >>> r2.cmd("LD").split("\n") ['pdc', 'pdg', ''] >>> r2.cmd("LD").split("\n") ['pdc', 'pdg', ''] Weird, right? It seems r2.cmd("LD") throws an error on first attempt, but on the second one, exact same command, it works fine and reports the pdg ghidra plugin back. Any ideas? Gonna try to fix this in my own pwndbg/pwndbg/ghidra.py by IDK just adding the check two times or something like that. But the bug is there...
disconnect3d commented 3 years ago

Hey, I am not familiar with the Ghidra integration but I'd be happy to merge a fix for this issue.

also cc: @anthraxx did u maybe work with this?