about summary refs log tree commit diff stats
path: root/miasm2/analysis/binary.py
diff options
context:
space:
mode:
Diffstat (limited to 'miasm2/analysis/binary.py')
-rw-r--r--miasm2/analysis/binary.py4
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