diff options
| author | Ajax <commial@gmail.com> | 2015-03-19 10:12:42 +0100 |
|---|---|---|
| committer | Ajax <commial@gmail.com> | 2015-03-19 10:12:42 +0100 |
| commit | 84832715898091f0da98e49502e45fdd77bc5748 (patch) | |
| tree | f15b31e16e70cb9b46312f349f198d06f28c9d6a /miasm2/analysis/binary.py | |
| parent | 9adbbb771d946523f5fa140ec38e0292d5a76ee5 (diff) | |
| download | miasm-84832715898091f0da98e49502e45fdd77bc5748.tar.gz miasm-84832715898091f0da98e49502e45fdd77bc5748.zip | |
LoaderELF: Add `guess_arch` and link it to ContainerELF.arch
Diffstat (limited to '')
| -rw-r--r-- | miasm2/analysis/binary.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/miasm2/analysis/binary.py b/miasm2/analysis/binary.py index 27ae9ce7..98dd7b6a 100644 --- a/miasm2/analysis/binary.py +++ b/miasm2/analysis/binary.py @@ -158,7 +158,8 @@ class ContainerELF(Container): "Container abstraction for ELF" def parse(self, data, vm=None): - from miasm2.jitter.loader.elf import vm_load_elf, preload_elf + from miasm2.jitter.loader.elf import \ + vm_load_elf, preload_elf, guess_arch from elfesteem import elf_init # Parse signature @@ -174,6 +175,9 @@ class ContainerELF(Container): except Exception, error: raise ContainerParsingException('Cannot read ELF: %s' % error) + # Guess the architecture + self._arch = guess_arch(self._executable) + # Build the bin_stream instance and set the entry point try: self._bin_stream = bin_stream_elf(self._executable.virt) |