Repository navigation
Expand file tree
/
Copy pathvirtualmachine.h
More file actions
66 lines (55 loc) · 1.56 KB
/
Copy pathvirtualmachine.h
File metadata and controls
66 lines (55 loc) · 1.56 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
* Copyrigth (C) Mon May 20 10:36:14 2013 XiaoWei
*
* handsomexiaowei@gmail.com
*/
#ifndef _VIRTUALMACHINE_H_
#define _VIRTUALMACHINE_H_
#include <list>
#include "VMHandle.h"
#include "PCode.hpp"
#include "AsmJit/AsmJit.h"
using namespace std;
typedef struct PCODE_BLOCK_INFO
{
long entry; //vm_initµÄµØÖ·
long pcode_base; //pcodeµØÖ·
unsigned char *buf;
unsigned long size;
AsmJit::Assembler a;
}pcode_block_info, *ppcode_block_info;
typedef struct VIRTUAL_MACHINE_CODE_INFO
{
unsigned char *buf;
unsigned long size;
unsigned long base; //ÐéÄâ»ú»ùÖ·
}VirtualMachineCode,*pVirtualMachineCode;
class VirtualMachine
{
public:
VirtualMachine( );
VirtualMachine(long base);
VirtualMachine(long base, bool sign);
~VirtualMachine( );
vm_handle handle_pcode;
vm_handle & get_vm_handle_table()
{
return handle_pcode;
}
VMHandle handle;
VMHandle & get_vm_handle()
{
return handle;
}
void build_vm_handle(long base );
void full_handle_table(long base, long table_offset);
list <handle_info> handle_info_list;
ppcode_block_info add_new_function( long base,PCode *code ,long ret_address,long v_key,long decryption_key);
ppcode_block_info create_function_head(long reloc_base, long base, PCode *code, long v_key, long decryption_key);
long dispatch_base;
list <ppcode_block_info> pcode_list;
void init(AsmJit::Assembler &a);
void add_pcode(AsmJit::Assembler &a,PCode *code,long base,long ret_address,long v_key,long decryption_key);
VirtualMachineCode vm_info;
};
#endif /* _VIRTUALMACHINE_H_ */