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.
vmprofiler/include/vmlifters.hpp

25 lines
914 B

#include <vmp2.hpp>
#include <vmprofiles.hpp>
#include <vtil/vtil>
namespace vm::lifters
{
using lifter_callback_t = std::function< void( vtil::basic_block *, vm::instrs::virt_instr_t * ) >;
using lifter_t = std::pair< vm::handler::mnemonic_t, lifter_callback_t >;
// taken from
// https://github.com/can1357/NoVmp/blob/6c23c9a335f70e8d5ed6299668fd802f2314c896/NoVmp/vmprotect/il2vtil.cpp#L66
inline constexpr vtil::register_desc make_virtual_register( uint8_t context_offset, uint8_t size )
{
fassert( ( ( context_offset & 7 ) + size ) <= 8 && size );
return { vtil::register_virtual, ( size_t )context_offset / 8, size * 8, ( context_offset % 8 ) * 8 };
}
extern lifter_t lregq;
extern lifter_t addq, adddw, addw;
inline std::map< vm::handler::mnemonic_t, lifter_callback_t > all = {
lregq, addq, adddw, addw
};
} // namespace vm::lifters