I am trying to reverse engineer some assembly code into C. I have the following bit of assembly code that I am trying to decipher:
lea 0x1(%rbx), %eax add 0x0(%rbp, %rbx, 4), %eax cmp %eax, 0x4(%rbp, %rbx,4) And my interpretation line by line is as follows:
- %eax = %rbx + 1
- %eax = %rbp + 4*%rbx + 0
- Compare %eax to %rbp + 4*%rbx + 4
I know that the first three of six iterations yield 1, 2, 4 respectively, but I can't figure out what formula is yielding those values. Can someone please tell me how I went wrong in deciphering this?