miasm
Reverse engineering framework
miasm.core.parse_asm Namespace Reference

Classes

class  Directive
 
class  DirectiveAlign
 
class  DirectiveDontSplit
 
class  DirectiveSplit
 

Functions

def guess_next_new_label (loc_db)
 
def asm_ast_to_expr_with_size (arg, loc_db, size)
 
def parse_txt (mnemo, attrib, txt, loc_db)
 

Variables

dictionary declarator
 
dictionary size2pck
 
 EMPTY_RE = re.compile(r'\s*$')
 
 COMMENT_RE = re.compile(r'\s*;\S*')
 
 LOCAL_LABEL_RE = re.compile(r'\s*(\.L\S+)\s*:')
 
 DIRECTIVE_START_RE = re.compile(r'\s*\.')
 
 DIRECTIVE_RE = re.compile(r'\s*\.(\S+)')
 
 LABEL_RE = re.compile(r'\s*(\S+)\s*:')
 
 FORGET_LABEL_RE = re.compile(r'\s*\.LF[BE]\d\s*:')
 
int STATE_NO_BLOC = 0
 
int STATE_IN_BLOC = 1
 

Function Documentation

◆ asm_ast_to_expr_with_size()

def miasm.core.parse_asm.asm_ast_to_expr_with_size (   arg,
  loc_db,
  size 
)
Here is the caller graph for this function:

◆ guess_next_new_label()

def miasm.core.parse_asm.guess_next_new_label (   loc_db)
Generate a new label
@loc_db: the LocationDB instance
Here is the caller graph for this function:

◆ parse_txt()

def miasm.core.parse_asm.parse_txt (   mnemo,
  attrib,
  txt,
  loc_db 
)
Parse an assembly listing. Returns an AsmCfg instance

@mnemo: architecture used
@attrib: architecture attribute
@txt: assembly listing
@loc_db: the LocationDB instance used to handle labels of the listing
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ COMMENT_RE

miasm.core.parse_asm.COMMENT_RE = re.compile(r'\s*;\S*')

◆ declarator

dictionary miasm.core.parse_asm.declarator
Initial value:
1 = {'byte': 8,
2  'word': 16,
3  'dword': 32,
4  'qword': 64,
5  'long': 32,
6  }

◆ DIRECTIVE_RE

miasm.core.parse_asm.DIRECTIVE_RE = re.compile(r'\s*\.(\S+)')

◆ DIRECTIVE_START_RE

miasm.core.parse_asm.DIRECTIVE_START_RE = re.compile(r'\s*\.')

◆ EMPTY_RE

miasm.core.parse_asm.EMPTY_RE = re.compile(r'\s*$')

◆ FORGET_LABEL_RE

miasm.core.parse_asm.FORGET_LABEL_RE = re.compile(r'\s*\.LF[BE]\d\s*:')

◆ LABEL_RE

miasm.core.parse_asm.LABEL_RE = re.compile(r'\s*(\S+)\s*:')

◆ LOCAL_LABEL_RE

miasm.core.parse_asm.LOCAL_LABEL_RE = re.compile(r'\s*(\.L\S+)\s*:')

◆ size2pck

dictionary miasm.core.parse_asm.size2pck
Initial value:
1 = {8: 'B',
2  16: 'H',
3  32: 'I',
4  64: 'Q',
5  }

◆ STATE_IN_BLOC

int miasm.core.parse_asm.STATE_IN_BLOC = 1

◆ STATE_NO_BLOC

int miasm.core.parse_asm.STATE_NO_BLOC = 0