static void idaapi ct_object_explorer_popup(TCustomControl *v, void *ud) { set_custom_viewer_popup_menu(v, NULL); add_custom_viewer_popup_item(v, "Make VTBL_Srtruct", "S", make_vtbl_struct_cb, ud); add_custom_viewer_popup_item(v, "Show RTTI objects list", "R", show_rtti_window_cb, ud); add_custom_viewer_popup_item(v, "Show all XREFS to VTBL", "X", show_vtbl_xrefs_window_cb, ud); }
//-------------------------------------------------------------------------- // This callback handles various hexrays events. static int idaapi callback(void *, hexrays_event_t event, va_list va) { switch ( event ) { case hxe_right_click: { vdui_t &vu = *va_arg(va, vdui_t *); // add new command to the popup menu add_custom_viewer_popup_item(vu.ct, "Display Graph", hotkey_dg, display_graph, &vu); add_custom_viewer_popup_item(vu.ct, "Object Explorer", hotkey_ce, display_objects, &vu); add_custom_viewer_popup_item(vu.ct, "REconstruct Type", hotkey_rt, reconstruct_type, &vu); add_custom_viewer_popup_item(vu.ct, "Jump to Disasm", hotkey_gd, decompiled_line_to_disasm, &vu); } break; case hxe_keyboard: { vdui_t &vu = *va_arg(va, vdui_t *); int keycode = va_arg(va, int); // check for the hotkey if (keycode == hotcode_dg) return display_graph(&vu); if (keycode == hotcode_ce) return display_objects(&vu); if (keycode == hotcode_rt) return reconstruct_type(&vu); if (keycode == hotcode_gd) return decompiled_line_to_disasm(&vu); } break; case hxe_double_click: { vdui_t &vu = *va_arg(va, vdui_t *); decompile_func(vu); } break; default: break; } return 0; }