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>
|
| 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_t * | get_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 std::size_t | random (std::size_t lowest, std::size_t largest) |
| generate a random number in a range. More...
|
|
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).
◆ operation_t()
theo::obf::transform::operation_t::operation_t |
( |
transform_t |
op, |
|
|
xed_iclass_enum_t |
type |
|
) |
| |
|
inlineexplicit |
explicit constructor for operation_t
- Parameters
-
op | lambda function when executed applies transformations. |
type | type of transformation, such as XOR, ADD, SUB, etc... |
◆ 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
-
inst | instruction with a relocation to generate a transformation for. |
imm | random 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
-
lowest | lowest value of the range. |
largest | highest 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: