-1

I'm trying to figure out a puzzle based on the existing values in the assembly registries.

I keep running into trouble at this line

cmp    %sil,0x12(%rdi)
jne    ...

The 12th offset for %rdi and %sil do in fact contain the same values when I examine them in the debugger, but the program still jumps because the values are considered not equal.

The only thing I can think of is that the previous comparisons were using cmpb instead of cmp and that %sil being the 1-byte version for %rsiis being compared against an 8-byte value.

Can someone tell me if I'm thinking about this correctly? If so, the input for the solution is a string so how would I change the input to accommodate for this?

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
Matthew
  • 57
  • 1
  • 9
  • `0x12` (hex) is not 12 (decimal). It's the 18th byte after `(%rdi)`. This `cmp` is a `cmpb`, the byte operand-size is implied by the register operand so the disassembler omitted it. – Peter Cordes Oct 14 '20 at 09:43
  • ohhhhhhhhhhhhh, I see. Thank you – Matthew Oct 14 '20 at 09:46

1 Answers1

1
0x12(%rdi) 

Is the hex representation for a decimal not the offset itself

Matthew
  • 57
  • 1
  • 9