zoukankan      html  css  js  c++  java
  • 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 );
    }

  • 相关阅读:
    JVM内存管理概述与android内存泄露分析
    android中activity.this跟getApplicationContext的区别
    Android广播机制概述
    android中shape属性大全
    android studio视频教学
    四十六、android中的Bitmap
    访问限制:由于对必需的库 C:/Program Files/Java/jre6/lib/rt.jar 具有一定限制,因此无法访问类型。。
    优质博客内容链接
    java日期格式大全 format SimpleDateFormat
    java中equals与==的区别
  • 原文地址:https://www.cnblogs.com/shangdawei/p/3317620.html
Copyright © 2011-2022 走看看