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

📄 cc2ida.idc

📁 一个小编辑器
💻 IDC
字号:
/* ******************************************************************** **
** @@ CC2IDA.IDC
** @  Copyrt : Aleph
** @  Author : Aleph
** @  Modify :
** @  Update : 20 Aug 2003
** @  Notes  : Simple script to "import" CC report file to IDA database
** ******************************************************************** */

//    BTW, you can save all lines appearing in the messages window to a file.
//    Just set an enviroment variable:
//
//          set IDALOG=ida.log
//
//    I always have this variable set, it is great help in the development.
//
//    Copyright (c) by Ilfak Guilfanov.

//////////////////////////////////////////////////////////////////////////
static GetFlag(Line)
{
   return substr(Line,19,20);
}
//////////////////////////////////////////////////////////////////////////
static GetAddress(Line)
{
   return xtol(substr(Line,20,28));
}
//////////////////////////////////////////////////////////////////////////
static GetText(Line)
{
   auto  LL;

   LL = substr(Line,42,-1);
   LL = substr(LL,0,strstr(LL,"\n"));

   return LL;
}
//////////////////////////////////////////////////////////////////////////
static main(void)
{
   auto     File;
   auto     Handle;
   auto     Line;
   auto     Flag;
   auto     Adr;
   auto     Text;

   File = AskFile(Handle,"MapFile.CC","*.CC");

   Handle = fopen(File,"rt");

   if (Handle == 0)
   {
      Warning("Error open input file %s",File);
      return;
   }

   Message("Proceed Input File: %s\n",File);

   while (1)
   {
      Line = readstr(Handle);

      if (Line == -1)
         break;

      // Parse String
      Flag = GetFlag(Line);

      if (Flag == ".")
      {  
         Adr  = GetAddress(Line);
         Text = GetText(Line);

         if (MakeComm(Adr,Text) != 1)
            Message("Err: MakeComm() at adr %08X - %s\n",Adr,Text);
         else
            Message("Commented at adr %08X - %s\n",Adr,Text);
      }
   }
      
   fclose(Handle);

   Warning("Done");
}

/* ******************************************************************** **
**                End of File
** ******************************************************************** */

⌨️ 快捷键说明

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