diff options
Diffstat (limited to 'miasm2/jitter/loader/pe.py')
| -rw-r--r-- | miasm2/jitter/loader/pe.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/miasm2/jitter/loader/pe.py b/miasm2/jitter/loader/pe.py index a3834d03..7c11b9c5 100644 --- a/miasm2/jitter/loader/pe.py +++ b/miasm2/jitter/loader/pe.py @@ -406,3 +406,13 @@ class libimp_pe(libimp): all_ads = all_ads[i + 1:] return new_lib + +# machine -> arch +PE_machine = {0x14c: "x86_32", + 0x8664: "x86_64", + } + +def guess_arch(pe): + """Return the architecture specified by the PE container @pe. + If unknown, return None""" + return PE_machine.get(pe.Coffhdr.machine, None) |