What happens when the eip register reaches its maximum value?

The eip register is 32 bits and is incremented for each new instruction. So what happens when it reaches its maximum value for a 32-bit number: 4294967295.

+3


source to share


1 answer


Typically, you don't let this happen. % eip does not grow unconditionally; this affected the flow control instructions (eg jmp

, call

, bcc

etc.).

In practice, this behavior is unpredictable. The% eip overflow causes an error on some processors. On some others, it silently wraps itself to zero.



These discrepancies led to the famous exploit of the (original) Xbox Boot ROM, as the development kits used AMD processors (which were accused of wraparound) while the production hardware used Intel processors (which it doesn't). For more information, see Hacking the Xbox: An Introduction to Reverse Engineering , on page 140.

+6


source







All Articles