Skip to content

Instantly share code, notes, and snippets.

@dguido
Created March 7, 2013 01:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dguido/5104701 to your computer and use it in GitHub Desktop.
Save dguido/5104701 to your computer and use it in GitHub Desktop.
Heap spray code snippet from lcamtuf's ref_fuzz5 JavaScript DOM fuzzer
function heap_spray() {
if (MEGS == 0 || R(2) == 0) return;
if (!spray_str) {
var spray_str = "ABCDABCD";
for (var i=0;i<21;i++) spray_str += spray_str; /* 16M */
}
window.name = Math.random() + spray_str + Math.random();
eval("window.name=''");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment