标签:blog http io ar 2014 art cti div
//枚举光标当前所在位置的函数包含的指令的数量
//
#include <idc.idc>
static main()
{
auto func,end,count,inst;
func = GetFunctionAttr(ScreenEA(),FUNCATTR_START); //获取包含光标位置的起始地址
if(func != -1)
{
end = GetFunctionAttr(func,FUNCATTR_END); //获取函数的结束地址
count = 0;
inst = func;
while(inst < end) //获取的地址小于函数结束地址
{
count++; //函数指令计数
inst = FindCode(inst,SEARCH_DOWN | SEARCH_NEXT); //查找指令
}
Warning("%s contains %d instructions\n",Name(func),count);
}
else
{
waring("No function found at location %x",ScreenEA());
}
}
结果如下:

枚举光标当前所在位置的函数包含的指令的数量,布布扣,bubuko.com
标签:blog http io ar 2014 art cti div
原文地址:http://www.cnblogs.com/M-Mr/p/3925196.html