View Single Comment

Thu Feb 21 19 10:47am
Rating: 1 (Updated 2 times)

This is an example of an integer overflow bug. To understand it, think about how the numbers we use everyday work. When count up, we'll eventually get to 9 and then 10. That is to say we overflowed the 1s digit and incremented the 10s digit.

Now let's say you were playing a board game where your character had a one digit number to represent health and the other to represent attack. They're written next to each other. You have 8 health and 4 attack. You draw a card that says that you get +3 health. But because you happen to be an unfeeling robot who can't understand context; instead of moving the number over and writing 11, you increment your attack when trying to add up your new health. Now you have 5 attack and 1 health.

For computers, their digits can be thought of as being from 0-255 (or perhaps -128-127... or perhaps 0-65535... or perhaps... well you get the idea). So when you go past your limit, you overflow into the next byte. This byte likely has a different meaning. This is also how many console exploits work. They overflow into protected memory and manipulate the game into calling this memory as instructions.