# Detect stack spills and reloads and hide their exact offset and whether
# they used the stack pointer or frame pointer.
asm = SCRUB_X86_SPILL_RELOAD_RE.sub(r'{{[-0-9]+}}(%\1{{[sb]}}p)\2', asm)
- # Generically match the stack offset of a memory operand.
- asm = SCRUB_X86_SP_RE.sub(r'{{[0-9]+}}(%\1)', asm)
+ if getattr(args, 'x86_scrub_sp', True):
+ # Generically match the stack offset of a memory operand.
+ asm = SCRUB_X86_SP_RE.sub(r'{{[0-9]+}}(%\1)', asm)
if getattr(args, 'x86_scrub_rip', False):
# Generically match a RIP-relative memory operand.
asm = SCRUB_X86_RIP_RE.sub(r'{{.*}}(%rip)', asm)
'--extra_scrub', action='store_true',
help='Always use additional regex to further reduce diffs between various subtargets')
parser.add_argument(
+ '--x86_scrub_sp', action='store_true', default=True,
+ help='Use regex for x86 sp matching to reduce diffs between various subtargets')
+ parser.add_argument(
+ '--no_x86_scrub_sp', action='store_false', dest='x86_scrub_sp')
+ parser.add_argument(
'--x86_scrub_rip', action='store_true', default=True,
- help='Use more regex for x86 matching to reduce diffs between various subtargets')
+ help='Use more regex for x86 rip matching to reduce diffs between various subtargets')
parser.add_argument(
'--no_x86_scrub_rip', action='store_false', dest='x86_scrub_rip')
parser.add_argument(