diff options
| author | Camille Mougey <commial@gmail.com> | 2018-05-14 13:53:04 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-05-14 13:53:04 +0200 |
| commit | d7c7527fbc4dea0f340402b62e7146b1d1916d2a (patch) | |
| tree | 45413ece50186f74a046ef2e2f30b4df8a19b963 /example/symbol_exec/single_instr.py | |
| parent | f6e1c074f6a17b6a895dcf5352c213a1b6bacb99 (diff) | |
| parent | ab3635f44ab45e22150bc373e33b7cf11ea46f63 (diff) | |
| download | miasm-d7c7527fbc4dea0f340402b62e7146b1d1916d2a.tar.gz miasm-d7c7527fbc4dea0f340402b62e7146b1d1916d2a.zip | |
Merge pull request #734 from serpilliere/enhance_parser
Enhance parser
Diffstat (limited to 'example/symbol_exec/single_instr.py')
| -rw-r--r-- | example/symbol_exec/single_instr.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/example/symbol_exec/single_instr.py b/example/symbol_exec/single_instr.py index e5637ad8..22a48fc6 100644 --- a/example/symbol_exec/single_instr.py +++ b/example/symbol_exec/single_instr.py @@ -2,18 +2,22 @@ from miasm2.core.bin_stream import bin_stream_str from miasm2.ir.symbexec import SymbolicExecutionEngine from miasm2.analysis.machine import Machine +from miasm2.core.asmblock import AsmSymbolPool START_ADDR = 0 machine = Machine("x86_32") +symbol_pool = AsmSymbolPool() + + # Assemble and disassemble a MOV ## Ensure that attributes 'offset' and 'l' are set -line = machine.mn.fromstring("MOV EAX, EBX", 32) +line = machine.mn.fromstring("MOV EAX, EBX", symbol_pool, 32) asm = machine.mn.asm(line)[0] # Get back block bin_stream = bin_stream_str(asm) -mdis = machine.dis_engine(bin_stream) +mdis = machine.dis_engine(bin_stream, symbol_pool=symbol_pool) mdis.lines_wd = 1 asm_block = mdis.dis_block(START_ADDR) |