Exemplo n.º 1
0
/**
 * @brief   Initialization callback for IDA.
 * @return  A @c PLUGIN_ constant from loader.hpp.
 */
int idaapi init()
{
    if (!is_idaq()) return PLUGIN_SKIP;
    msg("[" PLUGIN_NAME "] " PLUGIN_TEXTUAL_VERSION " by athre0z loaded!\n");

    try
    {
        Core::instance();
    }
    catch (const std::runtime_error &e)
    {
        msg("[" PLUGIN_NAME "][ERROR] Cannot load plugin: %s\n", e.what());
        return PLUGIN_UNL;
    }

    return PLUGIN_KEEP;
}
Exemplo n.º 2
0
//--------------------------------------------------------------------------
int idaapi init(void)
{
  // gui version?
  if ( callui(ui_get_hwnd).vptr == NULL && !is_idaq() )
    return PLUGIN_SKIP;


  char buf[10];
  get_kernel_version(buf, sizeof(buf));
  int v1, v2;
  if ( qsscanf(buf, "%d.%d", &v1, &v2) != 2 || v1*10+v2 < 55 )
  {
    warning("Sorry, the callgraph plugin required IDA v5.5 or higher\n");
    return PLUGIN_SKIP;
  }

  if ( !add_menu_item(CMD_MENU "Function calls", CMD_NAME, NULL, SETMENU_APP, run_plugin, NULL) )
  {
    msg("Failed to register menu item for <" CMD_NAME "> plugin! Please access it from the plugins submenu");
    return PLUGIN_SKIP;
  }

  return PLUGIN_KEEP;
}
Exemplo n.º 3
0
//--------------------------------------------------------------------------
int idaapi init(void)
{
  return ( callui(ui_get_hwnd).vptr != NULL || is_idaq() ) ? PLUGIN_OK : PLUGIN_SKIP;
}