void SeniorVMHandle::b_shr(long _register,char n,bool is_data) { if ( is_data ) b_push_imm( _register ); else push(_register); b_push_imm(n); db(HANDLE.b_shr.handle); }
void SeniorVMHandle::b_add(long _register1,long _register2,bool is_data) { push(_register1); if ( is_data ) b_push_imm( _register2 ); else push(_register2); db(HANDLE.b_add.handle); }
void SeniorVMHandle::q_shl(long _register,char n,bool is_data) { if ( is_data ) q_push_imm( _register ); else push(_register,false); b_push_imm(n); db(HANDLE.q_shl.handle); }
void SeniorVMHandle::b_add_b(long _register1,long _register2) { d_push_imm(0); pop(T_TMP_REGISTER3); b_and(_register1,_register2); pop(T_INVALID); b_xor(_register1,_register2); pop(T_INVALID); pop(T_TMP_R8_1H); b_push_imm(1<<7); pop(T_TMP_R8_1L); pop(T_TMP_R8_2H); b_and(T_TMP_R8_2H,T_TMP_R8_1L); pop(T_INVALID); pop(T_TMP_R8_3L); d_shr(T_TMP_REGISTER3,7); pop(T_INVALID); pop(T_TMP_REGISTER3); d_or(T_TMP_REGISTER3,T_TMP_EFLAG); pop(T_INVALID); pop(T_TMP_EFLAG); d_push_imm(0); pop(T_TMP_REGISTER3); b_push_imm(1<<3); pop(T_TMP_R8_3H); b_and(T_TMP_R8_3H,T_TMP_R8_2H); pop(T_INVALID); pop(T_TMP_R8_2L); b_shl(T_TMP_R8_2L,1); pop(T_INVALID); pop(T_TMP_R8_3L); d_or(T_TMP_REGISTER3,T_TMP_EFLAG); pop(T_INVALID); pop(T_TMP_EFLAG); b_shl(T_TMP_R8_2H,1); pop(T_INVALID); pop(T_TMP_R8_2H); }
void SeniorVMHandle::b_not_and(long _register1,long _register2,bool is_data) { if (is_data) { b_push_imm( _register2 ); push( _register1 ); db( GET_HANDLE( b_nand ) ); return; } if (_register1 == 0 || _register2 == 0) { db(HANDLE.b_nand.handle); return; } push(_register2); push(_register1); db(HANDLE.b_nand.handle); }
void SeniorVMHandle::b_not(long _register,bool is_data) { if (is_data) { b_push_imm( _register ); b_copy_stack(); db( GET_HANDLE( b_nand ) ); } if (_register == 0) { db(HANDLE.b_nand.handle); return; } push(_register); db(HANDLE.push_stack_top_base.handle); db(HANDLE.b_read_mem.handle); db(HANDLE.b_nand.handle); }
void SeniorVMHandle::q_shr(long _register,char n) { push(_register,false); b_push_imm(n); db(HANDLE.q_shr.handle); }
void SeniorVMHandle::d_shl(long _register,char n) { push(_register,false); b_push_imm(n); db(HANDLE.d_shl.handle); }
char SeniorVMHandle::push_operand( pVOperand o ) { if (o == NULL) { return 0; } if (o->is_mem( )) { r_get_mem( o->_mem.base,o->_mem.index,o->_mem.scale,o->_mem.lval ); switch (o->_mem.size ) { case 1: db( GET_HANDLE( b_read_mem ) ); return 1; break; case 2: db( GET_HANDLE( w_read_mem ) ); return 2; break; case 4: db( GET_HANDLE( d_read_mem ) ); return 4; break; #ifdef PROTECT_X64 case 8: db( GET_HANDLE( q_read_mem ) ); return 8; break; #endif } } else if (o->is_reg( )) { push( o->_reg.base ); if (o->_reg.base & T_E32X) { return 4; } else if (o->_reg.base & T_16X) { return 2; } else if ( o->_reg.base & T_8L || o->_reg.base & T_8H) { return 1; } else return 8; } else if (o->is_imm( )) { switch( o->_imm.size ) { case 1: b_push_imm(o->_imm.value); return 1; break; case 2: w_push_imm( o->_imm.value ); return 2; break; case 4: d_push_imm( o->_imm.value ); return 4; break; #ifdef PROTECT_X64 case 8: q_push_imm( o->_imm.value ); return 8; break; #endif } } else if (o->is_none( )) { return 0; } else { cout << "未知操作数\r\n" << endl; throw; return -1; } return 0; }