try different ISA as fallback when parsing without --arch flag, use SKX as x86 default and enhanced ISA detection heuristic

This commit is contained in:
JanLJL
2020-11-02 15:33:50 +01:00
parent 3a92803e73
commit 36cf3be579
2 changed files with 16 additions and 3 deletions

View File

@@ -24,7 +24,7 @@ class BaseParser(object):
"""Detect the ISA of the assembly based on the used registers and return the ISA code."""
# Check for the amount of registers in the code to determine the ISA
# 1) Check for xmm, ymm, zmm, rax, rbx, rcx, and rdx registers in x86
heuristics_x86ATT = [r'%[xyz]mm[0-9]', r'%r[abcd]x[0-9]']
heuristics_x86ATT = [r'%[xyz]mm[0-9]', r'%[er][abcd]x[0-9]']
# 2) check for v and z vector registers and x/w general-purpose registers
heuristics_aarch64 = [r'[vz][0-9][0-9]?\.[0-9][0-9]?[bhsd]', r'[wx][0-9]']
matches = {'x86': 0, 'aarch64': 0}