edb-debugger
edb-debugger copied to clipboard
Python scripting
I'd like to have a plugin which can run a user supplied python script. The scripts don't need to have access to the entire edb plugin API. We can probably get away with (for starters):
get/set register state, read/write memory, list of memory regions, maybe a PyQt reference to the MainWindow
which would allow some basic analysis from any scripts, and do some possible integration with the GUI. From there, we can make the python code gain features that the normal plugin API has on a piecemeal basis.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
I like this idea! I think we should embrace the future and support Python3 only.
Another option is to have some sort of IPC server which can do request/responses to edb, then users can script it however they want, and we can provide 'official' libs. Although that sounds suspiciously like gdbserver.
Yea, I'm fine with going Python3 only. If someone REALLY wants Python2 support, they are free to hack that into the plugin. I honestly think the difference will be almost entirely in what version of libpyton we compile against.
Adding general remote control to edb is also interesting, I think that if we wanted to this, Qt's implementation of DBUS may be the way to do it, I'm not 100% sure though. For now, I think a simply scripting plugin will do, and we'll see about a more generalized approach sometime in the future.
It looks like we would need to use Python Stable ABI. If we do that then we should be able to make our binaries happy with a system libpython or a conda environment python.
I'm working on this feature:
https://github.com/owerosu/edb-debugger/tree/python-plugin
For now, there is a skeleton that allows to execute python commands and exports two APIs from edb.
This is fantastic progress! Thanks for the effort!
Looking forward to this. I was interested in writing an angr target for edb but the scripting interface is a must. It would allow using edb to debug/step through the code concretely but then use angr for some analysis.
Sorry for stalling progress, I don't have much time these days Any help would be appreciated btw :)
No worries! I completely understand how much of a time commitment open source can be. Take your time, I'll help as much as I can. Also, don't feel like it has to cover the entire API 100% completely to be worth a PR. Maybe get just the basic functionality (read registers, read memory) and once that's in, I can expand on it too.
But really, no rush beyond people just thinking it'll be awesome when it comes :-)