首页
社区
课程
招聘
[原创]不断完善的idc,我写的,请大家试用,并给意见
发表于: 2009-11-10 11:45 19342

[原创]不断完善的idc,我写的,请大家试用,并给意见

2009-11-10 11:45
19342

#include <idc.idc>

static create_log(logname)
{
        auto filename,flag,fp;
        flag="w";
        filename="f:\\"+logname;
         //Warning("Sorry,%s not found in database",filename);
        fp=fopen(filename,flag);
          if (fp==0)
    {
     printf("creat file lose");
     }
     else
             {
                     printf("creat file successfully!");
                     writestr(fp,logname+" has been created\n");
                           fclose(fp);
                }
                return filename;
}
//------------------------------------------------

static findspecialcodetest(need_func,logname)
{
  auto func,addr,xref,source,filep,filename,flag;
printf(logname);
  flag="a+";
  filep=fopen(logname,flag);
if (filep!=0)
    {
            writestr(filep,need_func+"is found in database\n");
     printf("creat file successfully");
   fclose(filep);
        }
  

}

//------------------------------------------------------
static findspecialcode(need_func,logname)
{
  auto func,addr,xref,source,filep,filename,flag;

  flag="a+";
  
  func=LocByName(need_func);
  if (func==BADADDR)
   {return;
   Warning("Sorry,%s not found in database",need_func);
   }
  else
   {
    Message("%s is found in database\n",need_func);
  filep=fopen(logname,flag);
   if (filep!=0)
    { writestr(filep,need_func+" is found in database\n");
     printf("creat file successfully");
   fclose(filep);
}
  else {printf("creat file lose");}   
   }
     
   
/* below is detail process
  else{
    for (addr=RfirstB(func);addr !=BADADDR;addr=RnextB(func,addr))
     {
      xref=XrefType();
      if (xref==fl_CN||xref==fl_CF)
      {
       source= GetFunctionName(addr);
       Message("%s is called from )x%x in %s \n",need_func,addr,source);
      }
     }
*/
}

//------------------------------------------------
static oscmd(cstr)
{
Exec (cstr);
   
}

//------------------------------------------------
static printf(cstr)
{
Message("***************%s*********************** \n",cstr);
}

//------------------------------------------------

static main()
{

auto i,filename,filenamex,filepath,filep,temp;
filename=GetInputFile();
printf(filename);
//creat log file
i = strstr(filename,".");
  if ( i != -1 )
          {
                    i = i + 1;
                    temp=substr(filename,0,i);//temp = xxxx.
                    //printf(temp+"log");//
                    filename=temp+"log";
   
    //return filename;     // get type of the resource
           }
//create a log  
filenamex=create_log(filename);

//-----------------------------------------------------
Message("****************************************** \n");
Message("This is syr ida script to find special code \n");
//-----------------------限制程序功能函数-------------------------
printf("限制程序功能函数");
findspecialcode("EnableMenuItem",filenamex);
findspecialcode("EnableWindow",filenamex);
//----------对话框函数-----------------------------------
printf("对话框函数");
findspecialcode("CreateDialog",filenamex);
findspecialcode("CreateDialogParam",filenamex);
findspecialcode("CreateDialogIndirect",filenamex);
findspecialcode("CreateDialogIndirectParam",filenamex);
findspecialcode("DialogBox",filenamex);
findspecialcode("DialogBoxParam",filenamex);
findspecialcode("DialogBoxIndirect",filenamex);
findspecialcode("DialogBoxIndirectParam",filenamex);
findspecialcode("EndDialog",filenamex);
findspecialcode("MessageBox",filenamex);
findspecialcode("MessageBoxW",filenamex);
findspecialcode("MessageBoxEx",filenamex);
findspecialcode("MessageBoxIndirect",filenamex);
findspecialcode("GetDlgItemInt",filenamex);
findspecialcode("GetDlgItemText",filenamex);
findspecialcode("GetDlgItemTextA",filenamex);
findspecialcode("Hmemcpy",filenamex);
//磁盘处理函数
printf("磁盘处理函数");
findspecialcode("GetDiskFreeSpaceA",filenamex);
findspecialcode("GetDiskFreeSpaceExA",filenamex);
findspecialcode("GetDriveTypeA",filenamex);
findspecialcode("GetLogicalDrives",filenamex);
findspecialcode("GetFullPathNameA",filenamex);
findspecialcode("GetVolumeInformationA",filenamex);
findspecialcode("GetWindowsDirectoryA",filenamex);
findspecialcode("GetSystemDirectoryA",filenamex);
//4、文件处理函数
printf("4、文件处理函数");
findspecialcode("CreateFileA",filenamex);
findspecialcode("OpenFile",filenamex);
findspecialcode("ReadFile",filenamex);
findspecialcode("ReadFileEx",filenamex);
findspecialcode("WriteFile",filenamex);
findspecialcode("WriteFileEx",filenamex);
findspecialcode("SetFilePointer",filenamex);
findspecialcode("SetEndOfFile",filenamex);
findspecialcode("CloseHandle",filenamex);
findspecialcode("_lcreat",filenamex);
findspecialcode("_lopen",filenamex);
findspecialcode("_lread",filenamex);
findspecialcode("_lwrite",filenamex);
findspecialcode("_llseek",filenamex);
findspecialcode("_lclose",filenamex);
findspecialcode("_hread",filenamex);
findspecialcode("_hwrite",filenamex);
findspecialcode("OpenFileMappingA",filenamex);
findspecialcode("CreateFileMappingA",filenamex);
findspecialcode("MapViewOfFile",filenamex);
findspecialcode("MapViewOfFileEx",filenamex);
findspecialcode("CreateDirectoryA",filenamex);
findspecialcode("CreateDirectoryExA",filenamex);
findspecialcode("RemoveDirectoryA",filenamex);
findspecialcode("SetCurrentDirectoryA",filenamex);
findspecialcode("MoveFileA",filenamex);
findspecialcode("DeleteFileA",filenamex);
findspecialcode("CopyFileA",filenamex);
findspecialcode("CompareFileTime",filenamex);
findspecialcode("SetFileAttributesA",filenamex);
findspecialcode("FindFirstFileA",filenamex);
findspecialcode("FindNextFileA",filenamex);
findspecialcode("FindClose",filenamex);
findspecialcode("SearchPathA",filenamex);
findspecialcode("GetBinaryTypeA",filenamex);
findspecialcode("GetFileAttributesA",filenamex);
findspecialcode("GetFileSize",filenamex);
findspecialcode("GetFileTime",filenamex);
findspecialcode("GetFileType",filenamex);
//注册表处理函数
printf("注册表处理函数");
findspecialcode("RegOpenKeyA",filenamex);
findspecialcode("RegOpenKeyExA",filenamex);
findspecialcode("RegCreateKeyA",filenamex);
findspecialcode("RegCreateKeyExA",filenamex);
findspecialcode("RegDeleteKeyA",filenamex);
findspecialcode("RegDeleteValueA",filenamex);
findspecialcode("RegQueryValueA",filenamex);
findspecialcode("RegQueryValueExA",filenamex);
findspecialcode("RegSetValueA",filenamex);
findspecialcode("RegSetValueExA",filenamex);
findspecialcode("RegCloseKey",filenamex);
//时间处理函数
printf("时间处理函数");
findspecialcode("CompareFileTime",filenamex);
findspecialcode("GetFileTime",filenamex);
findspecialcode("GetLocalTime",filenamex);
findspecialcode("GetSystemTime",filenamex);
findspecialcode("GetTickCount",filenamex);
findspecialcode("SetFileTime",filenamex);
findspecialcode("SetLocalTime",filenamex);
findspecialcode("SetSystemTime",filenamex);
//7、进程函数
printf("7、进程函数");
findspecialcode("CreateProcessA",filenamex);
findspecialcode("ExitProcess",filenamex);
findspecialcode("FindExecutableA",filenamex);
findspecialcode("FreeLibray",filenamex);
findspecialcode("GetCurrentProcess",filenamex);
findspecialcode("GetCurrentProcessId",filenamex);
findspecialcode("GetCurrentThread",filenamex);
findspecialcode("GetExitCodeProces",filenamex);
findspecialcode("GetExitCodeThread",filenamex);
findspecialcode("GetModuleHandleA",filenamex);
findspecialcode("GetPriorityClassA",filenamex);
findspecialcode("LoadLibraryA",filenamex);
findspecialcode("LoadLibraryExA",filenamex);
findspecialcode("LoadModule",filenamex);
findspecialcode("TerminateProcess",filenamex);
//
printf("8、断点设置列表");
findspecialcode("GetPrivateProfileString",filenamex);
findspecialcode("GetPrivateProfileInt",filenamex);
findspecialcode("WritePrivateProfileString",filenamex);
findspecialcode("WritePrivateProfileInt",filenamex);
//-------------------------------------------------------

}

-----------------------------------------------------------------------

*version 2
用户可以自主输入要查询的win32 api 函数,及相应的variable;

*显示出指定win32 api 的variable参数的内存中的值

因为api 有 W,A之分 要修改showtext()
*举例用MessageBoxW ,的第二个参数 lpText


[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

上传的附件:
收藏
免费 7
支持
分享
最新回复 (13)
雪    币: 101
活跃值: (88)
能力值: ( LV2,RANK:140 )
在线值:
发帖
回帖
粉丝
2
不错,有了雏形了。
2009-11-10 14:22
0
雪    币: 74
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
还没用过,支持一下先,呵呵
2009-11-16 00:08
0
雪    币: 335
活跃值: (10)
能力值: ( LV8,RANK:120 )
在线值:
发帖
回帖
粉丝
4
/*        加入快捷键,使用更方便
    AddHotkey("Shift-D", "CleanItemColor");
    AddHotkey("Shift-G", "GreenItem");标记为green
           AddHotkey("Shift-A", "AppendCommHotkey");在原注释后加附注
    AddHotkey("Shift-D", "RedItem");标记为red
    AddHotkey("Shift-Ctrl-F", "show_win32api");查找制定的api函数
    usage:1.execut the script ;
                                    2.hotkey (ex. Shift-D,)
*/

Shift-G
Shift-D
Shift-R
有时会没动静,但只要重新按那个齿轮状的图标,就好了
上传的附件:
2009-11-16 15:14
0
雪    币: 1844
活跃值: (35)
能力值: ( LV3,RANK:30 )
在线值:
发帖
回帖
粉丝
5
哦,为你的继续而顶
2009-11-16 17:27
0
雪    币: 335
活跃值: (10)
能力值: ( LV8,RANK:120 )
在线值:
发帖
回帖
粉丝
6
谢谢,更好还能给点意见,最好能给个工作
2009-11-16 18:47
0
雪    币: 160
活跃值: (272)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
7
这个东西好,要改成能多API的抓就好了
2012-4-27 09:07
0
雪    币: 454
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
8
我感觉在看天书!唉。。。隔行如隔天啊
2012-4-27 09:27
0
雪    币: 1737
活跃值: (110)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
9
期待楼主继续~~
2012-4-27 09:28
0
雪    币: 18
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
10
楼主请继续加油
2012-4-27 09:35
0
雪    币: 615
活跃值: (172)
能力值: ( LV9,RANK:140 )
在线值:
发帖
回帖
粉丝
11
这个东西真不错!适合搞木马病毒行为分析,谢谢楼主分享.........
2012-4-27 14:30
0
雪    币: 24
活跃值: (11)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
12
发现这个脚本,其实还是有点问题的,除了A和W,很多函数是没有这些区分的,比如ExitProcess等等,但是不兼容这些
2012-8-30 10:57
0
雪    币: 882
活跃值: (350)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
13
mark了
2013-12-5 01:10
0
雪    币: 197
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
14
哎呀,谁能告诉我该如何入门啊 ???
2014-4-13 18:04
0
游客
登录 | 注册 方可回帖
返回
//