forked from IDontCode/Theodosius
parent
78f2b39b71
commit
9199d5bef7
@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
#include <obf/transform/operation.hpp>
|
||||
|
||||
namespace theo::obf::transform {
|
||||
class sub_op_t : public operation_t {
|
||||
explicit sub_op_t()
|
||||
: operation_t([&](std::size_t val,
|
||||
std::size_t imm) -> std::size_t { return val - imm; },
|
||||
XED_ICLASS_SUB) {}
|
||||
|
||||
public:
|
||||
static sub_op_t* get() {
|
||||
static sub_op_t obj;
|
||||
return &obj;
|
||||
}
|
||||
};
|
||||
} // namespace theo::obf::transform
|
@ -1,9 +1,10 @@
|
||||
#pragma once
|
||||
#include <comp/obf/transform/add_op.hpp>
|
||||
#include <comp/obf/transform/operation.hpp>
|
||||
#include <comp/obf/transform/sub_op.hpp>
|
||||
#include <obf/transform/add_op.hpp>
|
||||
#include <obf/transform/operation.hpp>
|
||||
#include <obf/transform/sub_op.hpp>
|
||||
|
||||
namespace theo::comp::obf::transform {
|
||||
std::map<operation_t::type_t, operation_t*> operations = {
|
||||
{operation_t::type_t::add_op, add_op_t::get()}};
|
||||
namespace theo::obf::transform {
|
||||
inline std::map<xed_iclass_enum_t, operation_t*> operations = {
|
||||
{XED_ICLASS_ADD, add_op_t::get()},
|
||||
{XED_ICLASS_SUB, sub_op_t::get()}};
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
#include <obf/transform/add_op.hpp>
|
||||
|
||||
namespace theo::obf::transform {
|
||||
add_op_t* add_op_t::get() {
|
||||
static add_op_t obj;
|
||||
return &obj;
|
||||
}
|
||||
|
||||
std::vector<std::uint8_t> add_op_t::native(xed_inst_t* inst, std::size_t imm) {
|
||||
auto op = xed_inst_operand(inst, 0);
|
||||
auto reg = xed_operand_reg(op);
|
||||
return {};
|
||||
}
|
||||
} // namespace theo::comp::obf::transform
|
Loading…
Reference in new issue