Theodosius  v3.0
Jit linker, mapper, obfuscator, and mutator
Public Member Functions | Static Public Member Functions | List of all members
theo::obf::transform::operation_t Class Reference

operation_t is the base class for all types of transformations. classes that inherit this class are singleton and simply call the super constructor (operation_t::operation_t). More...

#include <operation.hpp>

Inheritance diagram for theo::obf::transform::operation_t:
theo::obf::transform::add_op_t theo::obf::transform::rol_op_t theo::obf::transform::ror_op_t theo::obf::transform::sub_op_t theo::obf::transform::xor_op_t

Public Member Functions

 operation_t (transform_t op, xed_iclass_enum_t type)
 explicit constructor for operation_t More...
 
std::vector< std::uint8_t > native (const xed_decoded_inst_t *inst, std::uint32_t imm)
 generates a native transform instruction given an existing instruction. it works like so: More...
 
xed_iclass_enum_t inverse ()
 gets the inverse operation of the current operation. More...
 
transform_tget_transform ()
 gets a pointer to the lambda function which contains the transform logic. More...
 
xed_iclass_enum_t type ()
 gets the operation type. such as XED_ICLASS_ADD, XED_ICLASS_SUB, etc... More...
 

Static Public Member Functions

static std::size_t random (std::size_t lowest, std::size_t largest)
 generate a random number in a range. More...
 

Detailed Description

operation_t is the base class for all types of transformations. classes that inherit this class are singleton and simply call the super constructor (operation_t::operation_t).

Constructor & Destructor Documentation

◆ operation_t()

theo::obf::transform::operation_t::operation_t ( transform_t  op,
xed_iclass_enum_t  type 
)
inlineexplicit

explicit constructor for operation_t

Parameters
oplambda function when executed applies transformations.
typetype of transformation, such as XOR, ADD, SUB, etc...

Member Function Documentation

◆ get_transform()

transform_t* theo::obf::transform::operation_t::get_transform ( )
inline

gets a pointer to the lambda function which contains the transform logic.

Returns
a pointer to the lambda function which contains the transform logic.

◆ inverse()

xed_iclass_enum_t theo::obf::transform::operation_t::inverse ( )
inline

gets the inverse operation of the current operation.

Returns
the inverse operation of the current operation.

◆ native()

std::vector<std::uint8_t> theo::obf::transform::operation_t::native ( const xed_decoded_inst_t *  inst,
std::uint32_t  imm 
)
inline

generates a native transform instruction given an existing instruction. it works like so:

mov rax, &MessageBoxA ; original instruction with relocation

; this function takes the first operand and out of the original ; instruction and uses it to generate a transformation.

xor rax, 0x39280928 ; this would be an example output for the xor ;operation.

Parameters
instinstruction with a relocation to generate a transformation for.
immrandom 32bit number used in the generate transform.
Returns
returns the bytes of the native instruction that was encoded.

◆ random()

static std::size_t theo::obf::transform::operation_t::random ( std::size_t  lowest,
std::size_t  largest 
)
inlinestatic

generate a random number in a range.

Parameters
lowestlowest value of the range.
largesthighest value of the range.
Returns
a random value in a range.

◆ type()

xed_iclass_enum_t theo::obf::transform::operation_t::type ( )
inline

gets the operation type. such as XED_ICLASS_ADD, XED_ICLASS_SUB, etc...

Returns
the operation type. such as XED_ICLASS_ADD, XED_ICLASS_SUB, etc...

The documentation for this class was generated from the following file: