现在的位置: 首页 > 综合 > 正文

Dead beaf

2013年06月24日 ⁄ 综合 ⁄ 共 1766字 ⁄ 字号 评论关闭

Hexspeak, like leetspeak, is a novelty form of variant English spelling using the hexadecimal numbers. Created by programmers who wanted a magic number, hexspeak words can serve as a clear and unique identifier with which to mark memory or data.

Using hexadecimal notation, which includes the digits 0123456789ABCDEF, it is possible to spell several words. Further words can be made by treating some of the decimal numbers as letters - the digit "0" can represent the letter "O", and "1" can represent the letters "I" or "L". Less commonly, "5" can represent "S", "7" represent "T", "12" represent "R" and "6" or "9" can represent "G" or "g" respectively. Numbers such as 2 or 8 can be used in a manner similar to leet orrebuses; e.g. the word "defecate" can be expressed either as DEFECA7E or DEFEC8. (2 bears a resemblance to Z, but because that letter is the least used in the English language, such a usage is very rare.)[citation needed]

0xDEADBEAF ("dead beaf") is part of the signature code of Jazz Jackrabbit 2 tileset files.[14] Level files have less room for their signatures and use 0xBABE("babe") instead.

 

It's a made up expression using only the letters A-F, often used when a recognisable hexadecimal number is required. Some systems use it for various purposes such as showing memory which has been freed and should not be referenced again. In a debugger this value showing up could be a sign that you have made an error.

 

It's used because if the value winds up in a pointer, it will likely raise a fault in several ways. The value has several significant benefits. First, likely an address of DEADBEEF is out of the address range of system (we're talking last century systems now) regardless of the system's endian.

Second, it is more likely to fault on systems that require even boundry alignments for non-byte data access. Faulting happens because both of the 16 bit value's halves are odd, thus it will cause a fault if it's the pointer value when fetching 16 or 32 bit value as they need an even address pointer. Old assembler hacks like me would use it to fill memory before releasing.

抱歉!评论已关闭.