资源预览内容
第1页 / 共2页
第2页 / 共2页
亲,该文档总共2页全部预览完了,如果喜欢就下载吧!
资源描述
使用010Editor 解析二进制文件,非常的方便,支持模板和脚本解析,目前我所用的是模板解析。1。 模板的编写方法模板的编写语法跟 C/C+相似,下面介绍几个我不同之处,并给出我用过的一个例子:(1)内置数据类型的定义前要加 local。local int i = 0;local unsigned j = 0;(2)几个关键的函数。FSeek,FTell,FEof:FSeek(Addr);/ 定位到指定地址 Addr FTell();/取得文件长度while(!FEof()/分析到文件结尾(3)支持的字符串。char, wchar_tchar s; 动态匹配其长度。(4)例子:01typedefstruct tagHEAD0203 intcount;04 intpyDataAddr;05 inthzDataAddr;06HEAD;0708typedef struc ttagINDEX09 intpyIndex;10 inthzIndex;11INDEX;1213typedef structtagPY14 stringpy;15PY;1617typedefstructtagHZ18 stringpy;19HZ;2021HEADhead;22INDEXindexshead.count;23local in ti;24local int len;25local intaddr;2627struct28 for (i=0; ihead.count; i+)29 30 / addr = head.pyDataAddr + indexsi.pyIndex;31 / FSeek( addr );32 PYpy;33 34PY_DATA;3536struct37 for (i=0; ihead.count-1; i+)38 39 /addr = head.hzDataAddr + indexsi.hzIndex;40 / FSeek( addr );41 len= (indexsi+1.hzIndex-indexsi.hzIndex) /2;42 struct43 wchar_thzlen;44 hz;45 46 struct47 wchar_thz;48 hz;49HZ_DATA;
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号