0

is there any way that input values (integers in my case) effect the memory address of registers? I have a problem where I need two addresses to be equivalent, but I cannot figure out how my input influences the addresses, if at all. I am reverse engineering some assembly code.

%rbx = 0x7fffffffe1c0
%rbp = 0x7fffffffe1d0
add $0x4, %rbx   ===> makes %rbx 0x7fffffffe1c4
cmp %rbp, %rbx   ===> need ZF to be set, it isn't
je 0x400f53 <out_of_danger>

Both values are pushed to stack at start of function, and %rsp is involved in a lea instruction. Input that works is 0 1 1 1 1 _ (unsure about 6th number)

Assembly code

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
jope
  • 33
  • 6
  • 2
    It's a loop. `rbx` will be incremented repeatedly until it hits `rbp`. It's a `for(rbx = rsp; rbx != rbp; rbx += 4)` The addresses are not affected by the input. The loop is iterating the six numbers entered. – Jester Feb 21 '23 at 13:39
  • BTW, _" Input that works is 0 1 1 1 1"_ definitely can't be true. – Jester Feb 21 '23 at 13:53
  • @Jester It's getting me furthest in the execution, but maybe some digits are not right. – jope Feb 21 '23 at 16:09
  • @Jester doesn't cmp %rbp, $rbx compare the addresses? How can this condition be met via input, then? – jope Feb 21 '23 at 16:11
  • That will be met automatically. It's iterating the array. Will be true once the whole array has been processed. Does not depend on the input values. – Jester Feb 21 '23 at 16:12
  • figured it out @Jester. Thanks for the help – jope Feb 21 '23 at 16:36

0 Answers0