zoukankan      html  css  js  c++  java
  • IDA IDC Tutorials: Additional Auto-Commenting

    https://www.hex-rays.com/products/ida/support/tutorials/idc/autocomment.shtml

    This program creates a segment at paragraph 0x40 and comments the BIOS data area. You should load and execute this file to see the names of BIOS data area variables.

    //-------------------------------------------------------------------------
    static CW(off,name,cmt) {
      auto x;
      x = [ 0x40, off ];
      MakeWord(x);
      MakeName(x,name);
      MakeRptCmt(x,cmt);
    }
    
    //-------------------------------------------------------------------------
    static CD(off,name,cmt) {
      auto x;
      x = [ 0x40, off ];
      MakeDword(x);
      MakeName(x,name);
      MakeRptCmt(x,cmt);
    }
    
    //-------------------------------------------------------------------------
    static CB(off,name,cmt) {
      auto x;
      x = [ 0x40, off ];
      MakeByte(x);
      MakeName(x,name);
      MakeRptCmt(x,cmt);
    }
    
    //-------------------------------------------------------------------------
    static CmtBdata() {
     CW(0x000,"com_port_1","Base I/O address of 1st serial I/O port");
     CW(0x002,"com_port_2","Base I/O address of 2nd serial I/O port");
     CW(0x004,"com_port_3","Base I/O address of 3rd serial I/O port");
     CW(0x006,"com_port_4","Base I/O address of 4th serial I/O port");
    
     CW(0x008,"prn_port_1","Base I/O address of 1st parallel I/O port");
     CW(0x00A,"prn_port_2","Base I/O address of 2nd parallel I/O port");
     CW(0x00C,"prn_port_3","Base I/O address of 3rd parallel I/O port");
     CW(0x00E,"prn_port_4","Base I/O address of 4th parallel I/O port");
     MakeArray([0x40,0x01E ], 16 );
     CB(0x03E,"dsk_recal_stat",     "Recalibrate floppy drive bits
    "
                    "   3       2       1       0
    "
                    "drive-3 drive-2 drive-1 drive-0
    "
                    "
    "
                    "bit 7 = interrupt flag");
    CW(0x0CE,"days_since1_80",     "Days since 1-Jan-1980 counter");
     MakeArray(0x4AC,0xCE-0xAC);
    }
    
    //-------------------------------------------------------------------------
    static main() {
      if ( !SegCreate(0x400,0x4D0,0x40,0,0,2) ) {
        Warning("Can't create BIOS data segment.");
        return;
      }
      SegRename(0x400,"bdata");
      SegClass(0x400,"BIOSDATA");
      CmtBdata();
    }
    #include <idc.idc>
    
    //-------------------------------------------------------------------------
    static CW(off,name,cmt) {
      auto x;
      x = 0x400 + off;
      MakeWord(x);
      MakeName(x,name);
      MakeRptCmt(x,cmt);
    }
    
    //-------------------------------------------------------------------------
    static CD(off,name,cmt) {
      auto x;
      x = 0x400 + off;
      MakeDword(x);
      MakeName(x,name);
      MakeRptCmt(x,cmt);
    }
    
    //-------------------------------------------------------------------------
    static CB(off,name,cmt) {
      auto x;
      x = 0x400 + off;
      MakeByte(x);
      MakeName(x,name);
      MakeRptCmt(x,cmt);
    }
  • 相关阅读:
    谈谈关于PHP连接数据库的两种方法(PDO&Mysqli)
    关于Mui严格模式下的报错解决方案
    CSS常用选择器的认识
    HTML汇总以及CSS的一些开端
    LAMP架构之PHP-FPM 服务器 转
    httpd配置
    notapai++ 使用小技巧
    转载-notepad++ zend-coding使用
    Apache下的配置文件httpd.conf、httpd-vhosts.conf 转
    Apache本机不同端口多站点配置:httpd-vhosts.conf(转载)
  • 原文地址:https://www.cnblogs.com/shangdawei/p/3316079.html
Copyright © 2011-2022 走看看