Last active
June 26, 2022 19:55
-
-
Save huettenhain/eb463dd274e895d0fa4c5b0eaf83e220 to your computer and use it in GitHub Desktop.
A simple plugin to open the IDA Hex-Rays decompiler output to the right of all remaining tabs in a split view automatically.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import idaapi | |
import ida_hexrays | |
def runonce(function): | |
function._first_run = True | |
def wrapper(*args, **kwargs): | |
if function._first_run: | |
function._first_run = False | |
return function(*args, **kwargs) | |
return wrapper | |
def position_pseudocode(): | |
idaapi.set_dock_pos('Pseudocode-A', None, idaapi.DP_RIGHT) | |
idaapi.set_dock_pos('Graph overview', 'Output window', idaapi.DP_TAB) | |
idaapi.set_dock_pos('Functions window', 'Output window', idaapi.DP_TAB) | |
class PseudoCodeTabRight(idaapi.plugin_t): | |
flags = idaapi.PLUGIN_HIDE | |
comment = 'Opens the PseudoCode tab in a spearate pane to the right.' | |
help = 'The plugin triggers automatically when the decompiler is engaged for the first time.' | |
wanted_name = 'PseudoCodeTabRight' | |
wanted_hotkey = '' | |
def init(self): | |
def hexrays_event_callback(event, *args): | |
if event == idaapi.hxe_open_pseudocode: | |
position_pseudocode() | |
return 0 | |
if not idaapi.install_hexrays_callback(hexrays_event_callback): | |
return idaapi.PLUGIN_SKIP | |
return idaapi.PLUGIN_KEEP | |
def run(self, arg=0): | |
pass | |
def term(self): | |
pass | |
def PLUGIN_ENTRY(): | |
return PseudoCodeTabRight() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment