• AskUsingForm_c函数


    IDA SDK里面提供的UI(user interface)函数 AskUsingForm_c,该函数弹出一个对话框,而对话框的外观形式,就由此函数的第一个参数form(const char *类型)指定。

      static const char *dialog = // 
      "STARTITEM 0
    " // dont change
      "This is the title
    
    " // dialog title
      "This is static text
    " // static text
      "<String:A:32:32::>
    "  //need char[MAXSTR]
      "<Decimal:D:10:10::>
    "//sval_t*
      "<#No leading 0x#Hex:M:8:10::>
    "//uval_t*
      "<Button:B::::>
    "//formcb_t
      "<##Radio Buttons##Radio 1:R>
    "
      "<Radio 2:R>>
    "//ushort* number of selected radio
      "<##Check Boxes##Check 1:C>
    "
      "<Check 2:C>>
    ";//ushort* bitmask of checks
    void idaapi button_func(TView *fields[], int code)
    { 
      msg("The button was pressed!
    ");
    }
    
    void __stdcall IDP_run(int arg)
    { 
      char input[MAXSTR];
      sval_t dec = 0;
      uval_t hex = 0xdeadbeef;
      ushort radio = 1;
      ushort checkmask = 3;
      qstrncpy(input, "initial value", sizeof(input));
      if (AskUsingForm_c(dialog, input, &dec, &hex, button_func, &radio, &checkmask) == 1)
      { 
        msg("The input string was: %s
    ", input);
        msg("Decimal: %d, Hex %x
    ", dec, hex);
        msg("Radio button %d is selected
    ", radio);
        for (int n = 0; checkmask; n++)
        { 
          if (checkmask & 1)
          { 
            msg("Checkbox %d is checked
    ", n);
          }
          checkmask >>= 1;
        }
      }
    
      return;
    }

    static const char *dialog1 = // 
      "This is the title
    
    "// dialog title
      "<##Radio Buttons##Radio 1:R>
    "
      "<Radio 2:R>>
    "//ushort* number of selected radio
      "<##Radio Buttons##Radio 1:R>
    "
      "<Radio 2:R>>
    "//ushort* number of selected radio
      "<##Check Boxes##Check 1:C>
    "
      "<Check 2:C>>
    "//ushort* bitmask of checks
      "<##Check Boxes##Check 1:C>
    "
      "<Check 2:C>>
    ";//ushort* bitmask of checks
    
    static void idaapi show_dialog1( void )
    {
      ushort bitMask, bitMask1 =0;
      ushort btnIndex, bitIndex1;
      int ok = AskUsingForm_c( dialog1, &btnIndex, &bitIndex1, &bitMask, &bitMask1 );
    }

  • 相关阅读:
    关于ip层的作用网址链接
    转载 TCPIP学习笔记之概述
    转载pll工作模式解析
    关于modelsim添加库的说明
    转载.Avalon-MM 阿窝龙妹妹应用笔记
    转载.怎样在Quartus II中转化HDL文件为bsf文件?
    niosii boot过程
    转载--傅里叶级数的几何意义 – 巧妙记忆公式的方法
    第十三篇:带缓冲的IO( 标准IO库 )
    第十二章:Linux中权限控制实例
  • 原文地址:https://www.cnblogs.com/shangdawei/p/3317620.html
Copyright © 2020-2023  润新知