x86 negative immediate matches positive immediate
-0x8 is not being considered different than 0x8 as an immediate.
Possibly needs to update the re_imm regex to capture -
Current regex:
re_imm=re.compile(r"-?(0x[0-9a-f]+|[0-9]+)|([\?$_][^ \t,]+)")
Scratch: https://decomp.me/scratch/3rDWd
Image:
After spending some time on this, it seems that the stack regex (re_sprel) actually needs to be updated to capture - if it exists. The diff is related to %ebp which is a stack register.
Current: re_sprel=re.compile(r"-?(0x[0-9a-f]+|[0-9]+)(?=\((%ebp|%esi)\))")
Changed: re_sprel=re.compile(r"(-?0x[0-9a-f]+|[0-9]+)(?=\((%ebp|%esi)\))")
The other regexes might need to be updated too?
re_imm does not capture - either. re_imm=re.compile(r"-?(0x[0-9a-f]+|[0-9]+)|([\?$_][^ \t,]+)")