diff options
| author | serpilliere <serpilliere@users.noreply.github.com> | 2014-11-04 10:27:00 +0100 |
|---|---|---|
| committer | serpilliere <serpilliere@users.noreply.github.com> | 2014-11-04 10:27:00 +0100 |
| commit | 1aa333eba9f9bee1c8716fca291e3e080ea66a50 (patch) | |
| tree | 633425e451700154a44767eebeeae0abe49fe4c2 /example/disasm_03.py | |
| parent | b1225bc72bebdf0ac0b1ac83509e122574b2c7cc (diff) | |
| parent | 1a09c007ae8f6a391a90fa4ef4aa14c71ed672f6 (diff) | |
| download | miasm-1aa333eba9f9bee1c8716fca291e3e080ea66a50.tar.gz miasm-1aa333eba9f9bee1c8716fca291e3e080ea66a50.zip | |
Merge pull request #3 from commial/feature-binary
[Feature] Binary: Container
Diffstat (limited to 'example/disasm_03.py')
| -rw-r--r-- | example/disasm_03.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/example/disasm_03.py b/example/disasm_03.py index 08b209a1..1141dc55 100644 --- a/example/disasm_03.py +++ b/example/disasm_03.py @@ -1,20 +1,16 @@ import sys -from elfesteem import pe_init from miasm2.arch.x86.disasm import dis_x86_32 from miasm2.core.asmbloc import bloc2graph -from miasm2.core.bin_stream import bin_stream_pe +from miasm2.analysis.binary import Container if len(sys.argv) != 3: print 'Example:' print "%s box_upx.exe 0x410f90" % sys.argv[0] sys.exit(0) -fname = sys.argv[1] ad = int(sys.argv[2], 16) -e = pe_init.PE(open(fname).read()) -bs = bin_stream_pe(e.virt) - -mdis = dis_x86_32(bs) +cont = Container.from_stream(open(sys.argv[1])) +mdis = dis_x86_32(cont.bin_stream) # inform the engine not to disasm nul instructions mdis.dont_dis_nulstart_bloc = True blocs = mdis.dis_multibloc(ad) |