GenGdl File via IDC

要生成gdl文件可以使用idc脚本,也可以使用sdk的相关函数,但是函数使用比较复杂,其实是俺自己都没搞清楚那个东东该咋玩。丢银啊。 sad

相关的函数有两个:

// Generate a flow chart GDL file
// outfile - output file name. GDL extension will be used
// title - graph title
// ea1 - beginning of the area to flow chart
// ea2 - end of the area to flow chart. if ea2 == BADADDR
// then ea1 is treated as an address within a function.
// That function will be flow charted.
// flags - combination of CHART_... constants
 
success GenFuncGdl(string outfile, string title, long ea1, long ea2, long flags);

// Generate a function call graph GDL file
// outfile - output file name. GDL extension will be used
// title - graph title
// ea1 - beginning of the area to flow chart
// ea2 - end of the area to flow chart. if ea2 == BADADDR
// then ea1 is treated as an address within a function.
// That function will be flow charted.
// flags - combination of CHART_GEN_GDL, CHART_WINGRAPH, CHART_NOLIBFUNCS
 
success GenCallGdl(string outfile, string title, long flags);

简单测试代码:

#include <ida.idc>
#include <idc.idc>
 
static main()
{
auto str_gdlpath;
str_gdlpath = GetIdbPath();
str_gdlpath = substr(str_gdlpath,0,strlen(str_gdlpath)-4)+".gdl";
GenCallGdl(str_gdlpath, "Call Gdl", CHART_WINGRAPH);
Message("Gdl file have been saved to %s",str_gdlpath);
}

 

原创文章,转载请注明: 转载自 obaby@mars

本文标题: 《GenGdl File via IDC》

本文链接地址: http://www.h4ck.org.cn/2012/03/gengdl-file-via-idc/

You may also like

发表评论

电子邮件地址不会被公开。 必填项已用*标注