mirror of
https://github.com/cemu-project/idapython.git
synced 2024-11-24 10:09:20 +01:00
fbb5bfabd6
What's new: - added the decompiler bindings - Expose simpleline_t type to IDAPython. That lets the user to set the bgcolor & text for each line in the decompilation. - Wrapped new functions from the IDA SDK Various fixes: for non-code locations, idc.GetOpnd() would create instructions instead of returning empty result - idb_event::area_cmt_changed was never received in IDB_Hooks (and descendants) - idb_event::ti_changed, and idb_event::op_ti_changed notifications were not accessible in IDAPython - op_t.value was truncated to 32 bits under IDA64. - print_tinfo() wouldn't return a valid string. - readsel2() was not usable. - read_selection() was buggy for 64-bit programs. - StructMembers() considered holes in structures, and didn't properly iterate through the whole structure definition. - There was no way to call calc_switch_cases() from IDAPython. - when using multi-select/multi-edit choosers, erroneous event codes could be sent at beginning & end of batch deletion of lines. - When, in a PluginForm#OnCreate, the layout of IDA was requested to change (for example by starting a debugging session), that PluginForm could be deleted and create an access violation. - tinfo_t objects created from IDAPython could cause an assertion failure at exit time. - Usage of IDAPython's DropdownListControl was broken.
27 lines
596 B
Python
27 lines
596 B
Python
import idaapi
|
|
|
|
def main():
|
|
if not idaapi.init_hexrays_plugin():
|
|
return False
|
|
|
|
print "Hex-rays version %s has been detected" % idaapi.get_hexrays_version()
|
|
|
|
f = idaapi.get_func(idaapi.get_screen_ea());
|
|
if f is None:
|
|
print "Please position the cursor within a function"
|
|
return True
|
|
|
|
cfunc = idaapi.decompile(f);
|
|
if cfunc is None:
|
|
print "Failed to decompile!"
|
|
return True
|
|
|
|
sv = cfunc.get_pseudocode();
|
|
for sline in sv:
|
|
print idaapi.tag_remove(sline.line);
|
|
|
|
return True
|
|
|
|
if main():
|
|
idaapi.term_hexrays_plugin();
|