What happens when the eip register reaches its maximum value?
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.
source to share