miasm
Reverse engineering framework
cpu.py File Reference

Classes

class  miasm.core.cpu.bitobj
 
class  miasm.core.cpu.reg_info
 
class  miasm.core.cpu.reg_info_dct
 
class  miasm.core.cpu.bs
 
class  miasm.core.cpu.dum_arg
 
class  miasm.core.cpu.bsopt
 
class  miasm.core.cpu.bsi
 
class  miasm.core.cpu.bs_divert
 
class  miasm.core.cpu.bs_name
 
class  miasm.core.cpu.bs_mod_name
 
class  miasm.core.cpu.bs_cond
 
class  miasm.core.cpu.bs_swapargs
 
class  miasm.core.cpu.m_arg
 
class  miasm.core.cpu.m_reg
 
class  miasm.core.cpu.reg_noarg
 
class  miasm.core.cpu.mn_prefix
 
class  miasm.core.cpu.metamn
 
class  miasm.core.cpu.instruction
 
class  miasm.core.cpu.cls_mn
 
class  miasm.core.cpu.imm_noarg
 
class  miasm.core.cpu.imm08_noarg
 
class  miasm.core.cpu.imm16_noarg
 
class  miasm.core.cpu.imm32_noarg
 
class  miasm.core.cpu.imm64_noarg
 
class  miasm.core.cpu.int32_noarg
 
class  miasm.core.cpu.bs8
 

Namespaces

 miasm.core.cpu
 

Functions

def miasm.core.cpu.literal_list (l)
 
def miasm.core.cpu.gen_reg (reg_name, sz=32)
 
def miasm.core.cpu.gen_reg_bs (reg_name, reg_info, base_cls)
 
def miasm.core.cpu.gen_regs (rnames, env, sz=32)
 
def miasm.core.cpu.int2expr (tokens)
 
def miasm.core.cpu.parse_op (tokens)
 
def miasm.core.cpu.parse_id (tokens)
 
def miasm.core.cpu.ast_parse_op (tokens)
 
def miasm.core.cpu.ast_id2expr (a)
 
def miasm.core.cpu.ast_int2expr (a)
 
def miasm.core.cpu.neg_int (tokens)
 
def miasm.core.cpu.cb_int (tokens)
 
def miasm.core.cpu.cb_parse_id (tokens)
 
def miasm.core.cpu.cb_op_not (tokens)
 
def miasm.core.cpu.merge_ops (tokens, op)
 
def miasm.core.cpu.cb_op_and (tokens)
 
def miasm.core.cpu.cb_op_xor (tokens)
 
def miasm.core.cpu.cb_op_sign (tokens)
 
def miasm.core.cpu.cb_op_div (tokens)
 
def miasm.core.cpu.cb_op_plusminus (tokens)
 
def miasm.core.cpu.cb_op_mul (tokens)
 
def miasm.core.cpu.isbin (s)
 
def miasm.core.cpu.int2bin (i, l)
 
def miasm.core.cpu.myror32 (v, r)
 
def miasm.core.cpu.myrol32 (v, r)
 
def miasm.core.cpu.swap16 (v)
 
def miasm.core.cpu.swap32 (v)
 
def miasm.core.cpu.perm_inv (p)
 
def miasm.core.cpu.gen_bsint (value, l, args)
 
def miasm.core.cpu.branch2nodes (branch, nodes=None)
 
def miasm.core.cpu.factor_one_bit (tree)
 
def miasm.core.cpu.factor_fields (tree)
 
def miasm.core.cpu.factor_fields_all (tree)
 
def miasm.core.cpu.graph_tree (tree)
 
def miasm.core.cpu.add_candidate_to_tree (tree, c)
 
def miasm.core.cpu.add_candidate (bases, c)
 
def miasm.core.cpu.getfieldby_name (fields, fname)
 
def miasm.core.cpu.getfieldindexby_name (fields, fname)
 
def miasm.core.cpu.swap_uint (size, i)
 
def miasm.core.cpu.swap_sint (size, i)
 
def miasm.core.cpu.sign_ext (v, s_in, s_out)
 

Variables

 miasm.core.cpu.log = logging.getLogger("cpuhelper")
 
 miasm.core.cpu.console_handler = logging.StreamHandler()
 
 miasm.core.cpu.LPARENTHESIS = pyparsing.Literal("(")
 
 miasm.core.cpu.RPARENTHESIS = pyparsing.Literal(")")
 
 miasm.core.cpu.integer = pyparsing.Word(pyparsing.nums).setParseAction(lambda tokens: int(tokens[0]))
 
 miasm.core.cpu.hex_word = pyparsing.Literal('0x') + pyparsing.Word(pyparsing.hexnums)
 
 miasm.core.cpu.hex_int = pyparsing.Combine(hex_word).setParseAction(lambda tokens: int(tokens[0], 16))
 
tuple miasm.core.cpu.str_int_pos = (hex_int | integer)
 
tuple miasm.core.cpu.str_int_neg
 
tuple miasm.core.cpu.str_int = str_int_pos | str_int_neg
 
 miasm.core.cpu.logicop = pyparsing.oneOf('& | ^ >> << <<< >>>')
 
 miasm.core.cpu.signop = pyparsing.oneOf('+ -')
 
 miasm.core.cpu.multop = pyparsing.oneOf('* / %')
 
 miasm.core.cpu.plusop = pyparsing.oneOf('+ -')
 
 miasm.core.cpu.notop = pyparsing.oneOf('!')
 
 miasm.core.cpu.andop = pyparsing.oneOf('&')
 
 miasm.core.cpu.orop = pyparsing.oneOf('|')
 
 miasm.core.cpu.xorop = pyparsing.oneOf('^')
 
 miasm.core.cpu.shiftop = pyparsing.oneOf('>> <<')
 
 miasm.core.cpu.rotop = pyparsing.oneOf('<<< >>>')
 
 miasm.core.cpu.mulop = pyparsing.oneOf('*')
 
 miasm.core.cpu.divop = pyparsing.oneOf('/')
 
 miasm.core.cpu.variable = pyparsing.Word(pyparsing.alphas + "_$.", pyparsing.alphanums + "_")
 
tuple miasm.core.cpu.operand = str_int | variable
 
 miasm.core.cpu.base_expr
 
int miasm.core.cpu.default_prio = 0x1337
 
int miasm.core.cpu.total_scans = 0