⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dumpinfo.idc

📁 《加密与解密》随书光盘(三)工具 本书在第一版的基础上,更新了第一版中的过时内容。 本书共分三个部分。 第一部分介绍与加密和解密技术相关的基础知识。 第二部分全面讲述各种最新的软件加密与解密技
💻 IDC
📖 第 1 页 / 共 4 页
字号:
        }                                   
    
    //Create TEXT string
    } else {
        if      (oOption & TYP_REG_FCOM)  oTypTxt = "(Reg FCom)";
        else if (oOption & TYP_RPT_FCOM)  oTypTxt = "(Rpt FCom)";
        else if (oOption & TYP_REG_ICOM)  oTypTxt = "(Reg ICom)";
        else if (oOption & TYP_RPT_ICOM)  oTypTxt = "(Rep ICom)";
        else if (oOption & TYP_ANT_LINE)  oTypTxt = "(AntLn#";
        else if (oOption & TYP_POS_LINE)  oTypTxt = "(PosLn#";
        else if (oOption & TYP_USR_NAME)  oTypTxt = "(UserName)";
        else if (oOption & TYP_STR_CODE)  oTypTxt = "(StrCode";    
        else if (oOption & TYP_STR_DATA)  oTypTxt = "(Str Data)";    

        if ((oOption & TYP_ANT_LINE) || (oOption & TYP_POS_LINE)) {
            outTxt = form("%a %s%2d)\t%s\n", oEA, oTypTxt, oNum, oTxt);
        
        }else if (oOption & TYP_STR_CODE) {
            outTxt = form("%a %s%d)\t%s\n", oEA, oTypTxt, oNum, oTxt);
        
        }else if (oOption & TYP_STR_DATA) {
            outTxt = form("%a %s\t%s\n", oEA, oTypTxt, oTxt);
        }else outTxt = form("%a %s\t%s\n", oEA, oTypTxt, oTxt);
    }

    //Output to File
    if (oOption & OPT_MAK_FILE) {
        fprintf(oFileH, outTxt);

    //Output to Message Window
    } else {
        Message (outTxt);
    }

    oLineX++;
    return oLineX;
}

//__________________________________________________________________________________________________
//哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌
//FUNCTION: findInfo(lonh fOption, handle fFile, long fCurEA, long fEndEA)
//--------------------------------------------------------------------------------------------------
//PURPOSE: To find, retrieve and sometimes format the desired information.
//--------------------------------------------------------------------------------------------------
//NOTES:
//  fOption -   (long)      Holds option and type info
//  fFileH  -   (handle)    File Handle
//  fCurEA  -   (long)      Starting/Current EA
//  fEndEA  -   (long)      Ending EA
//  
//  i, j, k -   (long?)     Counters
//  fSrtEA  -   (long)      Starting EA
//  fTmpEA  -   (long)      Temporary EA used for gathering string bytes.
//  fTxt    -   (char*)     Holds String to be written
//  fNum    -   (long)      Holds Ant/Pos Line #, _OR_ 1st/2nd Operand _OR_ Length of String
//  fFlags  -   (long)      Holds the flags for the current EA
//  fLineX  -   (long)      Number of written lines.
//  ProgNum -   (long)      Progress Number
//  ProgPer -   (long)      Progress Percent (5%)
//  ProgDot -   (long)      Progress * Mark  (1%)
//--------------------------------------------------------------------------------------------------

static findInfo(fOption, fFileH, fCurEA, fEndEA) {
    auto i, j, k, fSrtEA, fTmpEA, fNum, fTxt, fFlags, fLineX, ProgNum, ProgPer, ProgDot;

    SetStatus(IDA_STATUS_WORK);                                         //Set Status: 'Busy'
    ProgPer = 4;                                                        //Initial Percent
    ProgDot = 0;                                                        
    Message("\nPercent Complete:  0 ");                                 
    fSrtEA = fCurEA;                                                    //Save Start for %Prog
    fNum = 0;
    fLineX = 0;
    
    while ( (fCurEA != BADADDR) && (fCurEA < fEndEA) ) {
        fFlags = GetFlags(fCurEA);
        if ( (fFlags & FF_COMM) || (fFlags & FF_LINE) || (fFlags & FF_NAME) ||\
        (fFlags & FF_0OFF) || (fFlags & FF_1OFF)) {                             //Big IF
            for (i=0; i < 10; i++) {
                fOption = fOption & 0x0000FFFFL;                                //Clear BitMask        
                fTxt = FALSE;                                                   //Clear Text
                fNum = 0;
                //Type 0:  Regular Function Comment
                if ( (i==0) && (fOption & OPT_REG_FCOM)) {
                    if (fFlags & FF_FUNC) {
                        fOption = fOption + TYP_REG_FCOM;                       //Set Type
                        fTxt = GetFunctionCmt(fCurEA, 0);                       //Get Comment
                    }                                                           
                //Type 1:  Repeatable Function Comment                          
                }else if ( (i==1) && (fOption & OPT_RPT_FCOM) ) {               
                    if (fFlags & FF_FUNC) {
                        fOption = fOption + TYP_RPT_FCOM;                       //Set Type
                        fTxt = GetFunctionCmt(fCurEA, 1);                       //Get Comment
                    }                                                           
                //Type 2:  Regular Indented Comment                             
                }else if ( (i==2) && (fOption & OPT_REG_ICOM) ){                
                    if (fFlags & FF_COMM)  {                                    
                        fOption = fOption + TYP_REG_ICOM;                       //Set Type
                        fTxt = Comment(fCurEA);                                 //Get Comment
                    }                                                           
                //Type 3:  Repeatable Indented Comment                          
                }else if ( (i==3) && (fOption & OPT_RPT_ICOM)) {                
                    if (fFlags & FF_COMM)  {                                    
                        fOption = fOption + TYP_RPT_ICOM;                       //Set Type
                        fTxt = RptCmt(fCurEA);                                  //Get Comment
                    }                                                           
                //Type 4:  Anterior Line                                        
                }else if ( (i==4) && (fOption & OPT_ANT_LINE) ){                
                    if (fFlags & FF_LINE)  {                                    
                        fOption = fOption + TYP_ANT_LINE;                       //Set Type
                        for (k=998; k >=0; k--) if (LineA(fCurEA,k)!="") break; //Find Last Line
                        for(j=0;j <= k; j++) {                                  //LineA() bug >1000t
                            fTxt = LineA(fCurEA, j);                            //Get Ant Line j
                            fLineX = writeLine(fOption, fFileH, fCurEA, fTxt, j, fLineX);
                        }
                    }
                //Type 5:  posterior Line
                }else if ( (i==5) && (fOption & OPT_POS_LINE) ){
                    if (fFlags & FF_LINE)  {
                        fOption = fOption + TYP_POS_LINE;                       //Set Type
                        for (k=998; k >=0; k--) if (LineB(fCurEA,k)!="") break; //Find Last Line
                        for(j=0;j <= k; j++) {                                  //Get All Lines
                            fTxt = LineB(fCurEA, j);                            //Get Pos Line j
                            fLineX = writeLine(fOption, fFileH, fCurEA, fTxt, j, fLineX);
                        }
                    }
                //Type 6: User Defined Names
                }else if ( (i==6) && (fOption & OPT_USR_NAME) ){
                    if (fFlags & FF_NAME)  {
                        fOption = fOption + TYP_USR_NAME;                       //Set Type
                        fTxt = Name(fCurEA);                                    //Get Name
                    }
                //Type 7: String References in CODE Opnd0
                }else if ( (i==7)  && (fOption & OPT_STR_CODE) ){
                    //isCode(F) // is code byte?
                    if (fFlags & FF_0OFF) {                                     //Test First Operand
                        fTxt = GetOpnd(fCurEA,0);                               //Get 1st Op Name
                        if ((substr(fTxt,0,11) == "offset str_") || \
                        (substr(fTxt,0,8) == "offset a")) {
                            fTxt = substr(fTxt,7,-1);                           //Trim "offset "
                            fOption = fOption + TYP_STR_CODE;                   //Set Type
                            fTmpEA = LocByName(fTxt);                           //Get String EA
                            fNum = ItemSize(fTmpEA);                            //Get String Length
                            fTxt = form("\"");                                  //Add Quote (")
                            for (j=0; j<=fNum; j++) {                           //Get Each Str Byte
                                fTxt = fTxt + byteValue(GetFlags(fTmpEA));      //Append Byte to Str
                                fTmpEA = fTmpEA + 1;                            //Inc EA by 1 Byte
                            }
                            fTxt = fTxt + form("\"");                           //Add End Quote (")
                            fNum = 0;                                           //Set num for Code0
                        }else fTxt = FALSE;                                     //Delete if not Str
                        if (fOption & OPT_IDC_FILE) fTxt = FALSE;               //Delete if IDC
                    }
                //Type 7: String References in CODE Opnd1
                }else if ( (i==8)  && (fOption & OPT_STR_CODE) ){
                    if (fFlags & FF_1OFF) {                                     //Test Second Opernd
                        fTxt = GetOpnd(fCurEA,1);                               //Get 2nd Op Name
                        if ((substr(fTxt,0,11) == "offset str_") || \
                        (substr(fTxt,0,8) == "offset a")) {
                            fTxt = substr(fTxt,7,-1);                           //Trim "offset "
                            fOption = fOption + TYP_STR_CODE;                   //Set Type
                            fTmpEA = LocByName(fTxt);                           //Get String EA
                            fNum = ItemSize(fTmpEA);                            //Get String Length
                            fTxt = form("\"");                                  //Add Quote (")
                            for (j=0; j<=fNum; j++) {                           //Get Each Str Byte
                                fTxt = fTxt + byteValue(GetFlags(fTmpEA));      //Append Byte  to Str
                                fTmpEA = fTmpEA + 1;                            //Inc EA by 1 Byte
                            }
                            fTxt = fTxt + form("\"");                           //Add End Quote (")
                            fNum = 1;                                           //Set num for Code1
                        }else fTxt = FALSE;                                     //Delete if not Str
                        if (fOption & OPT_IDC_FILE) fTxt = FALSE;               //Delete if IDC
                    }
                //Type 8: String References in DATA
                }else if ( (i==9)  && (fOption & OPT_STR_DATA) ){
                    //isData(F) // is data byte?
                    if (fFlags & FF_NAME) {                                     //Test for Name
                        fTxt = Name(fCurEA);                                    //Get Name
                        if ((substr(fTxt,0,4) == "str_") || (substr(fTxt,0,1) == "a")) {
                            fOption = fOption + TYP_STR_DATA;                   //Set Type
                            fTmpEA = fCurEA;                                    //Set Str EA
                            fNum = ItemSize(fTmpEA);                            //Get String Length
                            fTxt = form("\"");                                  //Add Quote (")
                            for (j=0; j<=fNum; j++) {                           //Get Each Str Byte
                                fTxt = fTxt + byteValue(GetFlags(fTmpEA));      //Append Byte to Str
                                fTmpEA = fTmpEA + 1;                            //Inc EA by 1 Byte
                            }
                            fTxt = fTxt + form("\"");                           //Add End Quote (")
                        }else fTxt = FALSE;                            
                    }
                }
                
                //Filter Output
                if ( (fTxt != FALSE) && (fOption & OPT_USE_FLTR) ) fTxt = xFilter(fTxt);
                
                //Write Output
                if ( (fTxt != FALSE) && (i != 4) && (i!=5) ){                   //Print ?

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -