-2

in the cusco challenge of microcorruption CTF I noticed that after line 453a the sp adds 16 to the sp value while on line 4476 it adds only 8. why does it happen?

by the way if there are easier challenges you know of to practice my reverse engineering skills i would really appreciate a link thanks!

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
omriMB
  • 1
  • 2
  • 2
    `0x10` (the number "`10`" in hexadecimal) has the value 16 (in decimal). `0x8` is "`8`" in hexadecimal, which has the value 8 (in decimal). – ecm Oct 07 '21 at 13:19
  • Please add the code you are referring to so that we have the full context. – Michael Oct 07 '21 at 13:43
  • 1
    `sp` isn't measured in bits, it's an integer. And if used as an address, each increment is a new *byte* of memory, not a bit. (Unless it's pointing into a bit-addressable region of memory, which some microcontrollers do have). – Peter Cordes Oct 07 '21 at 21:43
  • Related: hex vs. decimal confusion for x86-64 stack pointers: [Intel 64 bits, strange RSP behavior](https://stackoverflow.com/q/35958737) – Peter Cordes Oct 02 '22 at 21:08

1 Answers1

3

Hexadecimal. 0x10 is 16; 0x8 is 8.

Joshua
  • 40,822
  • 8
  • 72
  • 132