diff options
| author | Ajax <commial@gmail.com> | 2015-03-19 10:17:09 +0100 |
|---|---|---|
| committer | Ajax <commial@gmail.com> | 2015-03-19 10:17:09 +0100 |
| commit | 621bd32bfc95cb34ee6b7dee6e64b9f23b480c22 (patch) | |
| tree | 09cbb45cf9d3f130653308e6c957376c6ea0565b /miasm2/analysis/binary.py | |
| parent | 84832715898091f0da98e49502e45fdd77bc5748 (diff) | |
| download | miasm-621bd32bfc95cb34ee6b7dee6e64b9f23b480c22.tar.gz miasm-621bd32bfc95cb34ee6b7dee6e64b9f23b480c22.zip | |
LoaderPE: Add `guess_arch` and link it to ContainerPE.arch
Diffstat (limited to 'miasm2/analysis/binary.py')
| -rw-r--r-- | miasm2/analysis/binary.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/miasm2/analysis/binary.py b/miasm2/analysis/binary.py index 98dd7b6a..c71c5e9b 100644 --- a/miasm2/analysis/binary.py +++ b/miasm2/analysis/binary.py @@ -122,9 +122,8 @@ class Container(object): class ContainerPE(Container): "Container abstraction for PE" - def parse(self, data, vm=None): - from miasm2.jitter.loader.pe import vm_load_pe, preload_pe + from miasm2.jitter.loader.pe import vm_load_pe, preload_pe, guess_arch from elfesteem import pe_init # Parse signature @@ -145,6 +144,9 @@ class ContainerPE(Container): self._executable.NTsig.signature_value != 0x4550: raise ContainerSignatureException() + # 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_pe(self._executable.virt) |