Disassembly Engine and Others
很多时候其实大多数时间,我们并不会需要使用到反汇编引擎,不过这不代表我们不会使用。
一个简单的例子,使用了Hacker Disassembler Engine。使用HDE时需要使用C9x标准中的stdint.h头文件。
#include "stdafx.h"
#include "../HDE32/hde32.h"
#include <Windows.h>
#pragma comment(lib, "../Debug/hde32.lib")
int _tmain(int argc, _TCHAR* argv[])
{
hde32s hdInfo;
DWORD Addr;
__asm{
fldz
fstenv[esp-0x0C]
pop ebx
mov Addr, ebx
}
void *code = (void *)Addr;
//code = (void *)(0x004113C0+1);
unsigned int len = hde32_disasm(code,&hdInfo);
printf("length: 0x%02x\n", len);
printf("opcode: 0x%02x\n", hdInfo.opcode);
system("pause");
return 0;
}
编译运行时需要关闭编译器运行时检查功能。主要功能是获取到当前EIP(具体指fldz指令所在地址),然后使用HDE反汇编,返回结果为长度和第一位的OPcode值。
除了HDE,我们还可以使用Ollydbg的反汇编引擎Disasm。具体的VC代码可以见作者的Google Code。使用HDE主要是对API Hook时作用更大一些。
结果如下:
------------------------------
文章的授權使用CC BY-ND2.5協議。凡是標示“轉載”的文章,均來源於網絡並儘可能標註作者。如果有侵犯您的權益,請及時聯繫刪除或者署名、授權。
Gtalk/Email: cmd4shell [at] gmail.com