I have created a plugin/idascript (ida-batch_decompile) that aims to make it easier to decompile a target including images referenced as imports or any other decompilable files in the targets project dir. Optionally it also adds some helpful annotations to the pseudocode. In order to make this as convenient as possible I've added a Dialog that helps in enumerating target files and allows to select files for decompiliation from within ida pro. For the selection I'm using a variant of the Choose2
control that I borrowed from EiNSTeiN.
What I'd like to have is a way to dynamically add items (e.g. on button click) to an already displayed Choose2
list control. For some reason, this does not work, newly added items are not displayed unless I manually right-click/refresh
on that listview control. I tried calling Chooser2.Refresh(), Form.Refresh()
without any luck. The only workaround that kind of works is to close the form, add items to the listview and re-exec that form in order for it to show up. This is kind of ugly (see gif 1).
def OnButtonLoad(self, code=0):
# superdirty close, propagate, execute hack, otherwise listview would not be updated
self.Close(0)
# add items to listview
self.propagateItems(enumerate_other=True, enumerate_imports=True)
self.Execute()
--?-- What is the correct way to add items to an already existing Choose2
listcontrol and have it refresh without having to Close(); Execute()
the whole form?
I was searching for something like
Chooser.items.add(newItem)
Chooser.Refresh()
but that does not seem to refresh the listview control.