Magic Numbers in Microsoft Visual C++

Microsoft Visual C++, in Debug mode, uses some magic numbers to make our lives easier when we attempt to dereference invalid memory. Here’s a list of the ones I’ve found useful. I’ve included some from Google’s V8, since I ran into 0x1baddead0baddeaf this one time.

  • 0xabababab – Marks “no man’s land” guard bytes surrounding heap memory allocated by HeapAlloc().
  • 0xcccccccc – Uninitialized stack memory.
  • 0xcdcdcdcd – Uninitialized heap memory allocated by malloc().
  • 0xbaadf00d – Uninitialized heap memory.
  • 0xfdfdfdfd – Marks “no man’s land” guard bytes surrounding allocated heap memory.
  • 0xfeeefeee – Used by HeapFree() to mark freed heap memory
  • 0xdddddddd – Freed heap memory
  • 0xdeadbeedbeadbeef, 0x1baddead0baddeaf, 0x1baffed00baffedf, 0x1beefdad0beefdaf,0xbadbaddbbadbaddb, 0xbeefdeadbeefdeef, 0xfeed1eaffeed1eaf, 0xdeadbeef, 0xbaddeaf, 0xbaffedf,0xbeefdaf, 0xbeefdeef, 0xbadbaddb, 0xfeed1eaf, 0xbadc0de, 0xca11bac – Memory freed by Google’s V8 Javascript engine. (ref)

See Also