You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
2.2 KiB
45 lines
2.2 KiB
#include <vmprofiler.hpp>
|
|
|
|
namespace vm::handler::profile
|
|
{
|
|
vm::handler::profile_t jmp = {
|
|
// MOV ESI, [RBP]
|
|
// ADD RSI, RAX
|
|
// MOV RBX, RSI
|
|
// ADD RSI, [RBP]
|
|
"JMP",
|
|
JMP,
|
|
NULL,
|
|
{ { // MOV ESI, [RBP]
|
|
[]( const zydis_decoded_instr_t &instr ) -> bool {
|
|
return instr.mnemonic == ZYDIS_MNEMONIC_MOV &&
|
|
instr.operands[ 0 ].type == ZYDIS_OPERAND_TYPE_REGISTER &&
|
|
instr.operands[ 0 ].reg.value == ZYDIS_REGISTER_ESI &&
|
|
instr.operands[ 1 ].type == ZYDIS_OPERAND_TYPE_MEMORY &&
|
|
instr.operands[ 1 ].mem.base == ZYDIS_REGISTER_RBP;
|
|
},
|
|
// ADD RSI, RAX
|
|
[]( const zydis_decoded_instr_t &instr ) -> bool {
|
|
return instr.mnemonic == ZYDIS_MNEMONIC_ADD &&
|
|
instr.operands[ 0 ].type == ZYDIS_OPERAND_TYPE_REGISTER &&
|
|
instr.operands[ 0 ].reg.value == ZYDIS_REGISTER_RSI &&
|
|
instr.operands[ 1 ].type == ZYDIS_OPERAND_TYPE_REGISTER &&
|
|
instr.operands[ 1 ].reg.value == ZYDIS_REGISTER_RAX;
|
|
},
|
|
// MOV RBX, RSI
|
|
[]( const zydis_decoded_instr_t &instr ) -> bool {
|
|
return instr.mnemonic == ZYDIS_MNEMONIC_MOV &&
|
|
instr.operands[ 0 ].type == ZYDIS_OPERAND_TYPE_REGISTER &&
|
|
instr.operands[ 0 ].reg.value == ZYDIS_REGISTER_RBX &&
|
|
instr.operands[ 1 ].type == ZYDIS_OPERAND_TYPE_REGISTER &&
|
|
instr.operands[ 1 ].reg.value == ZYDIS_REGISTER_RSI;
|
|
},
|
|
// ADD RSI, [RBP]
|
|
[]( const zydis_decoded_instr_t &instr ) -> bool {
|
|
return instr.mnemonic == ZYDIS_MNEMONIC_ADD &&
|
|
instr.operands[ 0 ].type == ZYDIS_OPERAND_TYPE_REGISTER &&
|
|
instr.operands[ 0 ].reg.value == ZYDIS_REGISTER_RSI &&
|
|
instr.operands[ 1 ].type == ZYDIS_OPERAND_TYPE_MEMORY &&
|
|
instr.operands[ 1 ].mem.base == ZYDIS_REGISTER_RBP;
|
|
} } } };
|
|
} // namespace vm::handler::profile
|