about summary refs log tree commit diff stats
path: root/miasm2/analysis/binary.py
diff options
context:
space:
mode:
authorCamille Mougey <camille.mougey@cea.fr>2014-11-03 17:38:25 +0100
committerCamille Mougey <camille.mougey@cea.fr>2014-11-03 17:38:25 +0100
commit7d0bdbcafda15a48b56669c978225f60f9ca80c9 (patch)
tree1d16f06aca1b19d02c27af17888b9a15a8b671eb /miasm2/analysis/binary.py
parentb4745bf9980db9aee566a16f3725a9bd2d887860 (diff)
downloadfocaccia-miasm-7d0bdbcafda15a48b56669c978225f60f9ca80c9.tar.gz
focaccia-miasm-7d0bdbcafda15a48b56669c978225f60f9ca80c9.zip
Container: Refactor and comment
Diffstat (limited to 'miasm2/analysis/binary.py')
-rw-r--r--miasm2/analysis/binary.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/miasm2/analysis/binary.py b/miasm2/analysis/binary.py
index 77f1610d..7ea2ecc4 100644
--- a/miasm2/analysis/binary.py
+++ b/miasm2/analysis/binary.py
@@ -1,20 +1,33 @@
-from miasm2.core.bin_stream import *
 import logging
+
+from miasm2.core.bin_stream import *
 from miasm2.jitter.jitload import vm_load_pe, vm_load_elf
 from miasm2.jitter.csts import PAGE_READ
 
+
 log = logging.getLogger("binary")
 console_handler = logging.StreamHandler()
 console_handler.setFormatter(logging.Formatter("%(levelname)-5s: %(message)s"))
 log.addHandler(console_handler)
 log.setLevel(logging.ERROR)
 
+
 class Container(object):
+    """Container abstraction layer
+
+    This class aims to offer a common interface for abstracting container
+    such as PE and ELF.
+    """
+
     def __init__(self, filename, vm = None, addr = None):
+        "Instanciate a container and parse the binary"
+
+        # Initialisation
         data = open(filename).read()
         log.info('load binary')
         e, bs, ep = None, None, None
 
+        # Parse container header and instanciate common elements
         if data.startswith('MZ'):
             try:
                 if vm is not None: