what does “dead beef” mean?

前端 未结 9 1700
醉酒成梦
醉酒成梦 2020-12-22 20:51

What does the word \"dead beef\" mean? I read it from a interview question. It has something to do with ipv6. I figured it could be a random hex number used for examples, li

相关标签:
9条回答
  • 2020-12-22 20:58

    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. From Wikipedia:

    0xDEADBEEF ("dead beef") is used by IBM RS/6000 systems, Mac OS on 32-bit PowerPC processors and the Commodore Amiga as a magic debug value. On Sun Microsystems' Solaris, it marks freed kernel memory. On OpenVMS running on Alpha processors, DEAD_BEEF can be seen by pressing CTRL-T.

    The number 0xDEADBEEF is equal to the less recognisable decimal number 3735928559 (unsigned) or -559038737 (signed).

    0 讨论(0)
  • 2020-12-22 21:00

    It's a magic number used in various places because it also happens to be readable in English, making it stand out. There's a partial list on Wikipedia.

    0 讨论(0)
  • 2020-12-22 21:02

    It is also used for debugging purposes.

    Here is a handy list of some of these values:

    http://en.wikipedia.org/wiki/Magic_number_%28programming%29#Magic_debug_values

    0 讨论(0)
  • 2020-12-22 21:06

    Since IPv6-Adresses are written in Hex-notation you can use "Hexspeak" (numbers 0-9 and letters a-f) in Adresses.

    There are a number of words you can use as valid adresses to better momorize them.

    If you ping6 www.facebook.com -n you will get something like "2a03:2880:f01c:601:face:b00c:0:1".

    Here are some examples:

    • :affe:: (Affe - German for Monkey - seen at a vlan for management board)
    • :1bad:babe:: (one bad babe - seen at a smtp-honeypot)
    • :badc:ab1e:: (bad cable - seen as subnet for a unsecure vlan)
    • :da7a:: (Data - seen for fileservers)
    • :d1a1:: (Dial - seen for VPN Dial-In)
    0 讨论(0)
  • 2020-12-22 21:08

    0xDEADBEEF is normally filled in the memory arrays so that any exception when wrongly pointed or to know buffer over runs etc.,

    0 讨论(0)
  • 2020-12-22 21:10

    It was used as a pattern to store in memory as a series of hex bytes (0xde, 0xad, 0xbe, 0xef). You could see if memory was corrupted because of hardware failure, buffer overruns, etc.

    0 讨论(0)
提交回复
热议问题