added more lifters...

merge-requests/11/head
_xeroxz 4 years ago
parent 1840945596
commit 0699518ae9

@ -16,10 +16,17 @@ namespace vm::lifters
return { vtil::register_virtual, ( size_t )context_offset / 8, size * 8, ( context_offset % 8 ) * 8 }; return { vtil::register_virtual, ( size_t )context_offset / 8, size * 8, ( context_offset % 8 ) * 8 };
} }
extern lifter_t lregq; extern lifter_t lregq, lregdw;
extern lifter_t addq, adddw, addw; extern lifter_t addq, adddw, addw;
extern lifter_t sregq, sregdw, sregw;
inline std::map< vm::handler::mnemonic_t, lifter_callback_t > all = { inline std::map< vm::handler::mnemonic_t, lifter_callback_t > all = {
lregq, addq, adddw, addw // lreg lifters...
}; lregq, lregdw,
// add lifters...
addq, adddw, addw,
// sreg lifters...
sregq, sregdw, sregw };
} // namespace vm::lifters } // namespace vm::lifters

@ -7,4 +7,10 @@ namespace vm::lifters
vm::handler::LREGQ, []( vtil::basic_block *blk, vm::instrs::virt_instr_t *vinstr ) { vm::handler::LREGQ, []( vtil::basic_block *blk, vm::instrs::virt_instr_t *vinstr ) {
blk->push( make_virtual_register( vinstr->operand.imm.u, 8 ) ); blk->push( make_virtual_register( vinstr->operand.imm.u, 8 ) );
} }; } };
}
lifter_t lregdw = {
// push vregX
vm::handler::LREGDW, []( vtil::basic_block *blk, vm::instrs::virt_instr_t *vinstr ) {
blk->push( make_virtual_register( vinstr->operand.imm.u, 4 ) );
} };
} // namespace vm::lifters

@ -0,0 +1,22 @@
#include <vmlifters.hpp>
namespace vm::lifters
{
lifter_t sregq = {
// pop vregX
vm::handler::SREGQ, []( vtil::basic_block *blk, vm::instrs::virt_instr_t *vinstr ) {
blk->pop( make_virtual_register( vinstr->operand.imm.u, 8 ) );
} };
lifter_t sregdw = {
// pop vregX
vm::handler::SREGDW, []( vtil::basic_block *blk, vm::instrs::virt_instr_t *vinstr ) {
blk->pop( make_virtual_register( vinstr->operand.imm.u, 4 ) );
} };
lifter_t sregw = {
// pop vregX
vm::handler::SREGW, []( vtil::basic_block *blk, vm::instrs::virt_instr_t *vinstr ) {
blk->pop( make_virtual_register( vinstr->operand.imm.u, 2 ) );
} };
} // namespace vm::lifters
Loading…
Cancel
Save