asm-differ
asm-differ copied to clipboard
x86 relocation offset incorrectly applied
The relocation for cmpl $0x3, 0x18c is being applied to $0x3 rather than 0x18c.
curState is at offset 0x18c of g_Supervisor and is being compared to 3 in the source code while asm-differ is treating $0x3 as an offset rather than an immediate.
decomp.me scratch link: https://decomp.me/scratch/Og700
Source code:
asm-differ output:
objdump output:
Related code in asm-differ: https://github.com/simonlindholm/asm-differ/blob/main/diff.py#L1915
Changing the regex from (^|(?<=\*)|(?<=\$))0x[0-9a-f]+ to (^|(?<=\*)|(?<!\$))0x[0-9a-f]+ captures the correct value in cmpl $0x3, 0x18c.
It may cause issues in other instructions though.