Ever since the first person wrote out 5318008 on a calculator, nerds have been hiding secret numbers inside of your PC, and using them to negotiate secret handshakes between applications and files. Today we take a quick look at some of the more entertaining examples. What are Magic Numbers? Most programming languages use a 32-bit integer type to represent certain types of data behind the scenes — internally the number is stored in RAM or used by the CPU as 32 ones and zeros, but in the source code it would be written out in either regular decimal format, or as hexadecimal format, which uses the numbers 0 through 9 and the letters A through F. When the operating system or an application wants to determine the type of a file, it can look to the beginning of the file for a special marker that signifies the type of the file. For instance, a PDF file might start with the hex value 0x255044462D312E33, which equals “%PDF-1.3” in ASCII format, or a ZIP file starts with 0x...
Comments