-
-
[分享]IA-32、IA-64、MIPS、ARM反汇编引擎
-
发表于:
2013-2-26 06:55
7699
-
[分享]IA-32、IA-64、MIPS、ARM反汇编引擎
从某个开源项目里面挖出来的,反汇编功能不全,现在分享给大家,如果有朋友添加了代码,可不可以发送一份给我。先谢谢了。
void Disassembler::testDisassembler()
{
#ifdef IA_32_PROCESSOR
this->testIa32Disassembler();
#elif IA_64_PROCESSOR
this->testIa64Disassembler();
#elif ARM_PROCESSOR
this->testArmDisassembler();
#endif
}
void Disassembler::testIa32Disassembler()
{
#ifdef IA_32_PROCESSOR
printf("test IA-32:\n");
char out[256] = {0};
unsigned char inst[] = {0x8B, 0xC6};
int length = sizeof(inst);
for(int i = 0; i<length;)
{
int len = this->m_bler.Decode(out,&inst[i]);
printf("%s\n",out);
i+=len;
}
#endif
}
void Disassembler::testIa64Disassembler()
{
#ifdef IA_64_PROCESSOR
printf("test IA-64:\n");
char out[256] = {0};
unsigned char inst[] = {0x48,0x83,0xec,0x28,0x48,0x83,0xf9,0xff};
int length = sizeof(inst);
for(int i = 0; i<length;)
{
int len = this->m_bler.Decode(out,&inst[i]);
printf("%s\n",out);
i+=len;
}
#endif
}
void Disassembler::testArmDisassembler()
{
#ifdef ARM_PROCESSOR
printf("test Arm:\n");
char *out[256] = {0};
unsigned char inst[] = {0xE3,0xA0,0x00,0x00}; //error code
armDisassembler bler;
int length = sizeof(inst);
for(int i = 0; i<length;)
{
int len = bler.Decode(&inst[i]);
printf("%s\n",this->m_bler.GetAssemblyCode());
i+=len;
}
#endif
}
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课