Skip to content

Instantly share code, notes, and snippets.

@stryku
Last active March 26, 2017 19:30
Show Gist options
  • Select an option

  • Save stryku/d44cec38c13b02259bb1099e9d3564ff to your computer and use it in GitHub Desktop.

Select an option

Save stryku/d44cec38c13b02259bb1099e9d3564ff to your computer and use it in GitHub Desktop.
template <typename reg_token, typename mem_size_token, typename mem_ptr_reg, typename mem_ptr_const, typename plus_minus_token, typename ...rest_of_tokens>
struct matcher_impl<tuple<
tokens::tok_mov,
reg_token,
tokens::tok_comma,
mem_size_token,
tokens::tok_ptr,
tokens::tok_square_bracket_open,
mem_ptr_reg,
plus_minus_token,
mem_ptr_const,
tokens::tok_square_bracket_close,
rest_of_tokens...>>
{
static constexpr auto instruction_type = is_plus<plus_minus_token> ? inst::id_t::MOV_REG_MEM__mem_eq_reg_plus_const
: inst::id_t::MOV_REG_MEM__mem_eq_reg_minus_const;
using instruction = values_container<
inst::to_size<instruction_type>,
token_to_reg_val<reg_token>,
token_to_reg_val<mem_ptr_reg>,
string_to_int<mem_ptr_const>,
memory::to_size<mem_size_decoder<mem_size_token>>>;
static constexpr auto eip_change = get_eip_change<instruction_type>;
using instruction_tokens = tuple<
tokens::tok_mov,
reg_token,
tokens::tok_comma,
mem_size_token,
tokens::tok_ptr,
tokens::tok_square_bracket_open,
mem_ptr_reg,
plus_minus_token,
mem_ptr_const,
tokens::tok_square_bracket_close>;
using rest_of_tokens_t = tuple<rest_of_tokens...>;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment