最近下到了一篇反汇编引擎使用的例子,贴出来,大家共享吧。
#include
#include
#include "disasm.h"
#pragma comment(lib,"Decode.lib")
void main(void)
{
FILE *fs;
fs =fopen("test.bin","r");
if(!fs) {printf("file error\n");return;}
char buf[1000];
int read = fread(buf,11,1,fs);//test.bin为11个字节大小
fclose(fs);
//------
DISASSEMBLY dis;
char *Linear=buf;//Pointer to linear address
DWORD Index=0;// Index of opcoded to decode
while(Index<11)
{
memset(&dis,0,sizeof(DISASSEMBLY));
dis.Address = Index;
Decode(&dis,Linear,&Index);
printf("%s index=%d\n",dis.Assembly,Index);
}
}
|
文件: |
linra.20070610191133.rar |
大小: |
47KB |
下载: |
下载 | |
阅读(2818) | 评论(0) | 转发(0) |