diff options
| author | Camille Mougey <camille.mougey@cea.fr> | 2014-11-03 18:04:20 +0100 |
|---|---|---|
| committer | Camille Mougey <camille.mougey@cea.fr> | 2014-11-03 18:04:20 +0100 |
| commit | 1c6b959a3a73580a74186f25e66d4844185f98d8 (patch) | |
| tree | 45604d01f2cb36d38b9de817192dc760fba22ddd /miasm2/analysis/binary.py | |
| parent | 7d0bdbcafda15a48b56669c978225f60f9ca80c9 (diff) | |
| download | miasm-1c6b959a3a73580a74186f25e66d4844185f98d8.tar.gz miasm-1c6b959a3a73580a74186f25e66d4844185f98d8.zip | |
Container: Fix import, refactor file reading
Diffstat (limited to 'miasm2/analysis/binary.py')
| -rw-r--r-- | miasm2/analysis/binary.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/miasm2/analysis/binary.py b/miasm2/analysis/binary.py index 7ea2ecc4..5c506280 100644 --- a/miasm2/analysis/binary.py +++ b/miasm2/analysis/binary.py @@ -1,6 +1,7 @@ import logging from miasm2.core.bin_stream import * +from elfesteem import pe_init, elf_init from miasm2.jitter.jitload import vm_load_pe, vm_load_elf from miasm2.jitter.csts import PAGE_READ @@ -23,7 +24,8 @@ class Container(object): "Instanciate a container and parse the binary" # Initialisation - data = open(filename).read() + with open(filename) as fdesc: + data = fdesc.read() log.info('load binary') e, bs, ep = None, None, None |