diff options
Diffstat (limited to 'miasm2/analysis/binary.py')
| -rw-r--r-- | miasm2/analysis/binary.py | 15 |
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: |