Exemple #1
0
 def init(self):
     if ida_hexrays.init_hexrays_plugin():
         print(
             "Hex-rays version %s has been detected, Structure offsets ready to use"
             % ida_hexrays.get_hexrays_version())
         ida_kernwin.register_action(
             ida_kernwin.action_desc_t("vds17:strchoose",
                                       "Structure offsets",
                                       func_stroff_ah_t(), "Shift+T"))
         return ida_idaapi.PLUGIN_KEEP  # keep us in the memory
    def init(self):
        if not ida_hexrays.init_hexrays_plugin():
            print("pyhexraysdeob: no decompiler, skipping")
            return ida_idaapi.PLUGIN_SKIP
        print("Hex-rays version %s has been detected, %s ready to use" %
              (ida_hexrays.get_hexrays_version(), self.wanted_name))

        import sys
        modules_path = os.path.join(my_dirname, "pyhexraysdeob_modules")
        if not modules_path in sys.path:
            sys.path.append(modules_path)

        return ida_idaapi.PLUGIN_OK
Exemple #3
0
def main():
    if not ida_hexrays.init_hexrays_plugin():
        return False

    print("Hex-rays version %s has been detected" %
          ida_hexrays.get_hexrays_version())

    f = ida_funcs.get_func(ida_kernwin.get_screen_ea())
    if f is None:
        print("Please position the cursor within a function")
        return True

    cfunc = ida_hexrays.decompile(f)
    if cfunc is None:
        print("Failed to decompile!")
        return True

    sv = cfunc.get_pseudocode()
    for sline in sv:
        print(ida_lines.tag_remove(sline.line))

    return True
Exemple #4
0
            vu.refresh_view(True)
        # END REGION8

        return 1

    def update(self, ctx):
        return ida_kernwin.AST_ENABLE_FOR_WIDGET if \
            ctx.widget_type == ida_kernwin.BWN_PSEUDOCODE else \
            ida_kernwin.AST_DISABLE_FOR_WIDGET


# --------------------------------------------------------------------------
if ida_hexrays.init_hexrays_plugin():
    print(
        "Hex-rays version %s has been detected, Structure offsets ready to use"
        % ida_hexrays.get_hexrays_version())
    ida_kernwin.register_action(
        ida_kernwin.action_desc_t("vds17:strchoose", "Structure offsets",
                                  func_stroff_ah_t(), "Shift+T"))
else:
    print('vds17: Hex-rays is not available.')
"""
# A few notes about the VDS17 sample

You can find two VDS17 samples in the IDA Pro install directory:

    python/examples/hexrays/vds17.py
    plugins/hexrays_sdk/plugins/vds17

The former is an IDAPython plugin and the latter is a C++ IDA Pro plugin.
Actually they have the same functionality.