idapro反汇编学习(一)
实例代码
#include "stdafx.h"
#include <string.h>#include <stdlib.h>
#include <stdio.h>
#include <wtypes.h>
//x64 //8字节对齐
class CTestC
{
char ch; //1+3
virtual void fun(){} //8
void test(){}
int n ; //4
};
//sizeof(CTestC);// 16;
class CTestD
{
virtual void fun(){}
};
class CTest
{
virtual void fun(){}
char ch[5];
int n ;
short m_d;
};
//sizeof(CTest);
int _tmain(int argc, _TCHAR* argv[])
{
int nSize = sizeof(CTestD);
int t = sizeof(CTestC);
char *ptest = new char[20];
char ch[] = {"test "};
delete []ptest;
strcpy_s(ptest,sizeof(ch),ch);
printf(ptest);
return 0;
}
2、生成exe 和pdb (如果有对应pdb文件你会发现意外惊喜的!!!)
3、启动IDA Pro (32-bit) 将test_task.exe 拖到IDA Pro 一路确定即可。
4、按快捷键f5可以看到伪代码哦!!
效果如图:
接下来你懂得!!!
下一篇:
多任务学习算法及代码实现