IDA controllable disassembly graph

399 views
Skip to first unread message

Nir Izraeli

unread,
Jun 5, 2012, 8:01:28 AM6/5/12
to idapython
HI,

I'm interested in displaying a second "disassembly" window that
contains my own disassembly listings, which doesn't exist in the
analyzed binary.
the best idea i had up till now was to insert the second disassembly
listings into the analyzed IDB in a different code segment.
this will work but it is sub-optimal.

i've seen IDAPython has a few graph classes, but it doesn't have a
disassembly graph classes. the only function which that seemed
relevant was the open_disassembly_graph for which i couldn't control
the actual disassembly, while the best thing for me would be to have a
disassembly graph that i could insert the binary code from memory
without them being present in the IDB.

another option would be to be able to use AddNode in a disassembly
window

i much rather have it in IDAPython, but i am willing to add the python
bindings or write it in C if necessary.

thanks!

Steve Coleman

unread,
Jun 5, 2012, 9:17:16 AM6/5/12
to idap...@googlegroups.com, Nir Izraeli
You probably would do well to read this:

IDA Pro, Python and Qt
http://www.hexblog.com/?p=229

In short, IDA 6.0+ now allows Qt interaction through the PySide Python
library. It can be used to make interactive Qt windows compatible with
the IDA Pro 6.x Qt UI.

http://www.pyside.org/

You will need to remember though that IDA is still single threaded, so
multiple access to the database could corrupt it if multiple writes
occur simultaneously.

nir izraeli

unread,
Jun 5, 2012, 9:50:34 AM6/5/12
to Steve Coleman, idap...@googlegroups.com
hi Steve,
thanks for the reply!

i have read this blog post (as well as another one related to the subject) and i have been doing a bit of QT using pyside in IDA.
however,  i want to use IDA's internal disasssembly graphs capabilities (so it would look the same but also to save development time).

i was able to create graphs with IDAPython's GraphViewer, and i was able to create controls using pyside. but it seems i cannot find a way to get some kind of QT/Pyside handle for the disassembly view i've created so i could manipulate it.
i don't want to create my own PluginForm or GraphViewer sub-classes, i want to create a "DisassemblyGraph" subclass.

moreover, i'd prefer using a higher-level API to create nodes, rather then creating them using bare QT API (since a lot of the coloring/etc is done by IDA and i wish to keep it the same). obviously i can handle without it.

Steve Coleman

unread,
Jun 5, 2012, 11:08:47 AM6/5/12
to nir izraeli, idap...@googlegroups.com
I'm just getting started looking into Qt/PySide with IDA myself, so I
certainly can not give a definitive answer here, just at guess, but I
would look into something like:

Module idaapi TForm find_tform(caption)
locate a form by its title
e.g. frm = _idaapi.find_tform(title)


Module idaapi :: Class PluginForm
FormToPyQtWidget(form, ctx=<module '__main__' from 'hrdoc.py'>)
Use this method to convert a TForm* to a QWidget to be used by PySide

Doing it with PySide is a little bit beyond me at the moment, but it
should be doable. Qt can not enumerate windows in other apps, but
because a plugin is inside of IDA, so it should be possible to enumerate
all IDA child windows.
Reply all
Reply to author
Forward
0 new messages