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.
29 lines
594 B
29 lines
594 B
3 years ago
|
#pragma once
|
||
|
#include <iostream>
|
||
|
#include <cstdint>
|
||
|
#include <vector>
|
||
|
#include <functional>
|
||
|
|
||
|
struct _vinstr_meta
|
||
|
{
|
||
|
std::string name;
|
||
|
|
||
|
bool has_imm;
|
||
|
std::uintptr_t imm;
|
||
|
};
|
||
|
|
||
|
using callback_t = std::function<bool(_vinstr_meta*)>;
|
||
|
|
||
|
// this singleton class contains all the
|
||
|
// information for parsed virtual instructions...
|
||
|
class parse_t
|
||
|
{
|
||
|
public:
|
||
|
static auto get_instance() -> parse_t*;
|
||
|
void add_vinstr(std::string vinstr_name);
|
||
|
void add_vinstr(std::string vinstr_name, std::uintptr_t imm_val);
|
||
|
bool for_each(callback_t callback);
|
||
|
private:
|
||
|
parse_t();
|
||
|
std::vector<_vinstr_meta> vinstrs;
|
||
|
};
|