-
Notifications
You must be signed in to change notification settings - Fork 15
/
seniorvmhandle.hpp
179 lines (143 loc) · 5.37 KB
/
seniorvmhandle.hpp
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
/*
*
* Copyright (C) Mon May 20 00:07:29 2013 XiaoWei
*
*
*
*/
#ifndef _SENIORVMHANDLE_H_
#define _SENIORVMHANDLE_H_
//²Ù×÷×éºÏ
#include "VMHandle.h"
#include "PCode.hpp"
#include "VOperand.hpp"
class SeniorVMHandle
{
public:
SeniorVMHandle();
SeniorVMHandle(PCode *p);
~SeniorVMHandle( );
bool super_protect;
long get_code_size();
void link_pcode(PCode *p);
void set_protect_grade(bool b );
char push_operand( pVOperand o );
char pop_operand(pVOperand o);
void b_not_and(long _register1 = 0,long _register2 = 0,bool is_data = false);
void w_not_and(long _register1 = 0,long _register2 = 0,bool is_data = false);
void d_not_and(long _register1 = 0,long _register2 = 0,bool is_data = false);
void q_not_and(long _register1 = 0,long _register2 = 0,bool is_data = false);
char v_not_and(pVOperand o1,pVOperand o2 );
void b_not(long _register,bool is_data = false);
void w_not(long _register,bool is_data = false);
void d_not(long _register,bool is_data = false);
void q_not(long _register,bool is_data = false);
char v_not( pVOperand o1 );
void b_and(long _register1,long _register2,bool is_data = false);
void w_and(long _register1,long _register2,bool is_data = false);
void d_and(long _register1,long _register2,bool is_data = false);
void q_and(long _register1,long _register2,bool is_data = false);
char v_and( pVOperand o1,pVOperand o2 );
void b_or(long _register1,long _register2,bool is_data = false);
void w_or(long _register1,long _register2,bool is_data = false);
void d_or(long _register1,long _register2,bool is_data = false);
void q_or(long _register1,long _register2,bool is_data = false);
char v_or( pVOperand o1,pVOperand o2 );
void b_xor(long _register1,long _register2,bool is_data = false);
void w_xor(long _register1,long _register2,bool is_data = false);
void d_xor(long _register1,long _register2,bool is_data = false);
void q_xor(long _register1,long _register2,bool is_data = false);
char v_xor( pVOperand o1,pVOperand o2 );
void b_shl(long _register,char n,bool is_data = false);
void w_shl(long _register,char n,bool is_data = false);
void d_shl(long _register,char n,bool is_data = false);
void q_shl(long _register,char n,bool is_data = false);
char v_shl( pVOperand o1,pVOperand o2 );
void b_shr(long _register,char n,bool is_data = false);
void w_shr(long _register,char n,bool is_data = false);
void d_shr(long _register,char n,bool is_data = false);
void q_shr(long _register,char n,bool is_data = false);
char v_shr( pVOperand o1,pVOperand o2 );
void b_push_imm(char n);
void w_push_imm(short n);
void d_push_imm(int n);
void a_push_imm(long n);
void q_push_imm(long n);
char v_push_imm( pVOperand o1 );
void b_push_imm_sx(char n);
void w_push_imm_sx(short n);
void d_push_imm_sx(int n);
void b_push_imm_zx(char n);
void w_push_imm_zx(short n);
void d_push_imm_zx(int n);
void b_copy_stack();
void w_copy_stack();
void d_copy_stack();
void q_copy_stack();
void pushf();
void pushad();
void popad();
void popf();
void exit();
void start();
void save_vm_context();
void recover_vm_context();
void b_read_mem( );
void w_read_mem( );
void d_read_mem( );
void q_read_mem( );
void b_write_mem( );
void w_write_mem( );
void d_write_mem( );
void q_write_mem( );
void b_add_b(long _register1,long _register2);
void b_add(long _register1,long _register2,bool is_data = false);
void w_add(long _register1,long _register2,bool is_data = false);
void d_add_d(long _register1,long _register2);
void d_add(long _register1,long _register2,bool is_data = false);
void q_add(long _register1,long _register2,bool is_data = false);
char v_add( pVOperand o1,pVOperand o2 );
void b_sub(long _register1,long _register2);
void w_sub(long _register1,long _register2);
void d_sub(long _register1,long _register2);
void q_sub(long _register1,long _register2);
char v_sub(pVOperand o1,pVOperand o2 );
void b_div(long _register1,long _register2);
void w_div(long _register1,long _register2);
void d_div(long _register1,long _register2);
void q_div(long _register1,long _register2);
void push(long _register,bool _disable = true);
void pop(long _register);
void b_cmp(long _register1,long _register2);
void w_cmp(long _register1,long _register2);
void d_cmp(long _register1,long _register2);
void q_cmp(long _register1,long _register2);
void r_get_mem(
long _register_index,
long _register_base,
long _scale,
long _lval);
void * get_code_buf( );
void push_vesp( );
void db( unsigned char b );
void dw( unsigned short w );
void dd( unsigned int d );
void dq( unsigned long q );
void set_pc( );
void set_key( long _key );
void upset_register_array( RegisterStore & r );
PCode *pcode;
void mov(pVOperand o1,pVOperand o2);
void test(pVOperand o1,pVOperand o2);
void lea(pVOperand o1,pVOperand o2);
void cmp(pVOperand o1,pVOperand o2);
void sar(pVOperand o1,pVOperand o2);
void cdq(pVOperand o1);
void div(pVOperand o1);
void sar(pVOperand o1);
void imul(pVOperand o1,pVOperand o2,pVOperand o3);
void jnz(long addr1,long addr2);
void jz(long addr1,long addr2);
};
#endif /* _SENIORVMHANDLE_H_ */