-
Notifications
You must be signed in to change notification settings - Fork 79
Expand file tree
/
Copy pathCapstone.h
More file actions
41 lines (33 loc) · 849 Bytes
/
Capstone.h
File metadata and controls
41 lines (33 loc) · 849 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#pragma once
#pragma once
#ifndef _CAPSTONE_H_
#define _CAPSTONE_H_
#include "capstone/include/capstone/capstone.h"
#ifdef _WIN64 // 64位平台编译器会自动定义这个宏
#pragma comment(lib,"capstone\\64\\capstone.lib")
#else
#pragma comment(lib,"capstone\\32\\capstone.lib")
#endif
class Capstone
{
public:
Capstone();
virtual ~Capstone();
public:
// 初始化反汇编引擎
void InitCapstone();
// 显示反汇编信息
void ShowAssembly(const void* pAddr, int nLen);
void AnalyOpcodeHlper(const void* pAddr, int nLen);
int AnalyencodeVmHlper(cs_insn* ins, unsigned int rankey);
private:
// 反汇编引擎句柄
csh Handle;
// 错误信息
cs_err err;
// 保存反汇编得到的指令的缓冲区首地址
cs_insn* pInsn;
// 结构体内存
cs_opt_mem OptMem;
};
#endif