2013-07-03 03:40:54 +02:00
|
|
|
import idaapi
|
|
|
|
|
|
|
|
def main():
|
2013-12-30 02:34:23 +01:00
|
|
|
if not idaapi.init_hexrays_plugin():
|
|
|
|
return False
|
2013-07-03 03:40:54 +02:00
|
|
|
|
2013-12-30 02:34:23 +01:00
|
|
|
print "Hex-rays version %s has been detected" % idaapi.get_hexrays_version()
|
2013-07-03 03:40:54 +02:00
|
|
|
|
2013-12-30 02:34:23 +01:00
|
|
|
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
|
2013-07-03 03:40:54 +02:00
|
|
|
|
2013-12-30 02:34:23 +01:00
|
|
|
sv = cfunc.get_pseudocode();
|
|
|
|
for i in xrange(0, sv.size()):
|
|
|
|
line = idaapi.tag_remove(str(sv[i]));
|
|
|
|
print line
|
|
|
|
|
|
|
|
return True
|
2013-07-03 03:40:54 +02:00
|
|
|
|
|
|
|
if main():
|
2013-12-30 02:34:23 +01:00
|
|
|
idaapi.term_hexrays_plugin();
|