diff options
| author | serpilliere <serpilliere@users.noreply.github.com> | 2020-08-31 09:27:56 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-31 09:27:56 +0200 |
| commit | 06239dde95cd984548deb40e9945d8bd85d83425 (patch) | |
| tree | 2fb59bca2aada9280fb1aecd2ebdd633a23cdc4b /example/symbol_exec/depgraph.py | |
| parent | 5d8beb271d9890241a6d61dd476fab26ca37ebbf (diff) | |
| parent | 24ce193b8bad352853a9c5589f6fdcf5177d5466 (diff) | |
| download | miasm-06239dde95cd984548deb40e9945d8bd85d83425.tar.gz miasm-06239dde95cd984548deb40e9945d8bd85d83425.zip | |
Merge pull request #1274 from serpilliere/dont_gen_locationdb
Avoid generate default locationdb
Diffstat (limited to 'example/symbol_exec/depgraph.py')
| -rw-r--r-- | example/symbol_exec/depgraph.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/example/symbol_exec/depgraph.py b/example/symbol_exec/depgraph.py index c7b9017f..8285452e 100644 --- a/example/symbol_exec/depgraph.py +++ b/example/symbol_exec/depgraph.py @@ -10,6 +10,7 @@ from miasm.analysis.machine import Machine from miasm.analysis.binary import Container from miasm.analysis.depgraph import DependencyGraph from miasm.expression.expression import ExprMem, ExprId, ExprInt +from miasm.core.locationdb import LocationDB parser = ArgumentParser("Dependency grapher") parser.add_argument("filename", help="Binary to analyse") @@ -33,10 +34,10 @@ parser.add_argument("--json", help="Output solution in JSON", action="store_true") args = parser.parse_args() - +loc_db = LocationDB() # Get architecture with open(args.filename, "rb") as fstream: - cont = Container.from_stream(fstream) + cont = Container.from_stream(fstream, loc_db) arch = args.architecture if args.architecture else cont.arch machine = Machine(arch) @@ -50,8 +51,8 @@ for element in args.element: except KeyError: raise ValueError("Unknown element '%s'" % element) -mdis = machine.dis_engine(cont.bin_stream, dont_dis_nulstart_bloc=True) -ir_arch = machine.ira(mdis.loc_db) +mdis = machine.dis_engine(cont.bin_stream, dont_dis_nulstart_bloc=True, loc_db=loc_db) +ir_arch = machine.ira(loc_db) # Common argument forms init_ctx = {} |