Miasm2
 All Classes Namespaces Files Functions Variables Typedefs Properties Macros
Classes | Functions | Variables
miasm2.arch.x86.disasm Namespace Reference

Classes

class  dis_x86
 
class  dis_x86_16
 
class  dis_x86_32
 
class  dis_x86_64
 

Functions

def cb_x86_callpop
 
def cb_x86_disasm
 

Variables

list cb_x86_funcs = [cb_x86_callpop]
 

Function Documentation

def miasm2.arch.x86.disasm.cb_x86_callpop (   mn,
  attrib,
  pool_bin,
  cur_bloc,
  offsets_to_dis,
  symbol_pool 
)
1000: call 1005
1005: pop

Will give:

1000: push 1005
1005: pop

Definition at line 6 of file disasm.py.

6 
7 def cb_x86_callpop(mn, attrib, pool_bin, cur_bloc, offsets_to_dis, symbol_pool):
8  """
9  1000: call 1005
10  1005: pop
11 
12  Will give:
13 
14  1000: push 1005
15  1005: pop
16 
17  """
18 
19  if len(cur_bloc.lines) < 1:
20  return
21  l = cur_bloc.lines[-1]
22  if l.name != 'CALL':
23  return
24  dst = l.args[0]
25  if not (isinstance(dst, ExprId) and isinstance(dst.name, asm_label)):
26  return
27  if dst.name.offset != l.offset + l.l:
28  return
29  l.name = 'PUSH'
30  cur_bloc.bto = set()
31  cur_bloc.add_cst(dst.name.offset, asm_constraint.c_next, symbol_pool)
32 
def miasm2.arch.x86.disasm.cb_x86_disasm (   mn,
  attrib,
  pool_bin,
  cur_bloc,
  offsets_to_dis,
  symbol_pool 
)

Definition at line 36 of file disasm.py.

36 
37 def cb_x86_disasm(mn, attrib, pool_bin, cur_bloc, offsets_to_dis, symbol_pool):
38  for func in cb_x86_funcs:
39  func(mn, attrib, pool_bin, cur_bloc, offsets_to_dis, symbol_pool)
40 

Variable Documentation

list miasm2.arch.x86.disasm.cb_x86_funcs = [cb_x86_callpop]

Definition at line 33 of file disasm.py.