能力值:
(RANK:990 )
|
-
-
2 楼
以前哪位转过一个IDC文件(loamms?不太记得了),当时保存了一下。附件不传了,自己看源码吧:
#include "idc.idc"
static ElementExist(arrayid,size,val) { auto i,v; for(i=0;i<size;i++) { v=GetArrayElement(AR_LONG,arrayid,i); if(v==val) return 1; } return 0; } static GenFuncIns(st,arrayid,size) { auto start,end,i,ins,x,xt,funcend; start=st; end=FindFuncEnd(start); for(i=start;i<end;) { ins=GetDisasm(i); for(x=Rfirst(i);x!=BADADDR;x=Rnext(i,x)) { xt=XrefType(); if(xt == fl_CN && !ElementExist(arrayid,size,x)) { SetArrayLong(arrayid,size,x); size++; } } i=ItemEnd(i);/*FindCode(i,1);*/ //Message(form("%s\r\n",ins)); } return size; } static main() { auto arrayid,size,pos,st,file,funcend,path; st=ScreenEA(); path = GetIdbPath(); path = substr(path, 0, strlen(path) - 4) + "Part.asm"; file=fopen(path,"w+"); if(st==BADADDR) { Warning("You should choose a start place!"); return; } arrayid=CreateArray("gen_func_ins"); if(arrayid<0) { arrayid=GetArrayId("gen_func_ins"); } pos=0; SetArrayLong(arrayid,pos,st); size=1; for(pos=0;pos<size;pos++) { st=GetArrayElement(AR_LONG,arrayid,pos); Message(form("proc:%8.8x\r\n",st)); funcend=FindFuncEnd(st); if (funcend!=BADADDR) { Message("writting asm code... %s \n",path); GenerateFile(OFILE_ASM,file, st,funcend, 0); } else { Message(form("proc:%8.8x Write false\r\n",st)); } size=GenFuncIns(st,arrayid,size); } DeleteArray(arrayid); fclose(file); Message("All done, exiting...\n"); }
|
能力值:
( LV9,RANK:530 )
|
-
-
3 楼
好,谢谢啊,我研究看看
|