Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

miasm

Use case

Reverse engineering framework in Python.

Explanation

See miasm and miasm.re.

Examples:

Usage

$ pip install miasm
from miasm.expression.expression import ExprId, ExprInt
from miasm.expression.simplifications import expr_simp

x = ExprId("x", 64)
k = lambda v: ExprInt(v, 64)

e = (x ^ k(0x32a86d)) + ((x & k(0x32a86d)) * k(2))
e = e.replace_expr({x: k(0)})

print(expr_simp(e))
$ python simplify.py
0x32A86D

References:

  • https://github.com/cea-sec/miasm/blob/master/doc/expression/expression.ipynb
  • https://github.com/cea-sec/miasm/blob/master/example/expression/simplification_add.py