VMProfiler  v1.8
vmprofiler is a c++ library which is used to statically analyze VMProtect 2 polymorphic virtual machines. This project is inherited in vmprofiler-qt, vmprofiler-cli, and vmemu.
Namespaces | Typedefs | Enumerations | Functions | Variables
transform.hpp File Reference
#include <Zydis/Zydis.h>
#include <functional>
#include <map>
#include <stdexcept>
#include <vmutils.hpp>

Go to the source code of this file.

Namespaces

 vm
 
 vm::transform
 

Typedefs

template<typename T >
using vm::transform::transform_t = std::function< T(T, T) >
 transform function, such as ADD, SUB, BSWAP... etc... More...
 
using vm::transform::map_t = std::map< transform::type, zydis_decoded_instr_t >
 map of transform type to zydis decoded instruction of the transform... More...
 

Enumerations

enum class  vm::transform::type {
  vm::transform::generic0 , vm::transform::rolling_key , vm::transform::generic1 , vm::transform::generic2 ,
  vm::transform::generic3 , vm::transform::update_key
}
 type of transformation... More...
 

Functions

template<class T >
vm::transform::__ROL__ (T value, int count)
 rotate left template function take from IDA SDK... More...
 
u8 vm::transform::__ROL1__ (u8 value, int count)
 rotate left a one byte value... More...
 
u16 vm::transform::__ROL2__ (u16 value, int count)
 rotate left a two byte value... More...
 
u32 vm::transform::__ROL4__ (u32 value, int count)
 rotate left a four byte value... More...
 
u64 vm::transform::__ROL8__ (u64 value, int count)
 rotate left an eight byte value... More...
 
u8 vm::transform::__ROR1__ (u8 value, int count)
 rotate right a one byte value... More...
 
u16 vm::transform::__ROR2__ (u16 value, int count)
 rotate right a two byte value... More...
 
u32 vm::transform::__ROR4__ (u32 value, int count)
 rotate right a four byte value... More...
 
u64 vm::transform::__ROR8__ (u64 value, int count)
 rotate right an eight byte value... More...
 
bool vm::transform::valid (zydis_mnemonic_t op)
 determines if the given mnemonic is a valid transformation... More...
 
void vm::transform::inverse_transforms (transform::map_t &transforms, transform::map_t &inverse)
 inverse operand decryption transformations... More...
 
auto vm::transform::inverse_transforms (std::vector< zydis_decoded_instr_t > &instrs) -> bool
 inverse transformations given a vector of them... More...
 
auto vm::transform::apply (std::uint8_t bitsize, ZydisMnemonic op, std::uint64_t a, std::uint64_t b) -> std::uint64_t
 
bool vm::transform::has_imm (const zydis_decoded_instr_t *instr)
 determines if a given decoded instruction has a second operand that is an immediate value... More...
 

Variables

template<class T >
const auto vm::transform::_bswap
 
template<class T >
const auto vm::transform::_add = []( T a, T b ) -> T { return a + b; }
 
template<class T >
const auto vm::transform::_xor = []( T a, T b ) -> T { return a ^ b; }
 
template<class T >
const auto vm::transform::_sub = []( T a, T b ) -> T { return a - b; }
 
template<class T >
const auto vm::transform::_neg = []( T a, T b ) -> T { return a * -1; }
 
template<class T >
const auto vm::transform::_not = []( T a, T b ) -> T { return ~a; }
 
template<class T >
const auto vm::transform::_ror
 
template<class T >
const auto vm::transform::_rol
 
template<class T >
const auto vm::transform::_inc = []( T a, T b ) -> T { return a + 1; }
 
template<class T >
const auto vm::transform::_dec = []( T a, T b ) -> T { return a - 1; }
 
template<class T >
std::map< zydis_mnemonic_t, transform_t< T > > vm::transform::transforms
 
std::map< zydis_mnemonic_t, zydis_mnemonic_tvm::transform::inverse