Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/host/ida/ui/decompiler_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ def populate_form(self):
for phase in decompilation_phase:
self.phase_selection.addItem(phase)

self.phase_selection.setCurrentIndex(decompiler.STEP_DECOMPILED)
# case sensitive for step_decompiled and setCurrentIndex argument should be integer,
# so why not just (0)???
self.phase_selection.setCurrentIndex(0)
self.phase_selection.currentIndexChanged.connect(self.phase_selected)

self.parent.setLayout(layout)
Expand All @@ -80,12 +82,15 @@ def phase_selected(self, index):
self.decompile(index)
return

def decompile(self, wanted_step=decompiler.STEP_DECOMPILED):
def decompile(self, wanted_step=None):

if not wanted_step:
wanted_step = decompiler.step_decompiled

dis = host.dis.available_disassemblers['ida'].create()
d = decompiler.decompiler_t(dis, self.ea)

for step in d.steps():
for step in d.STEPS():
print 'Decompiler step: %u - %s' % (step, decompilation_phase[step])
if step >= wanted_step:
break
Expand Down