Skip to content

Commit

Permalink
Update and rename dumper(include_in_page).js to dumper.js
Browse files Browse the repository at this point in the history
  • Loading branch information
a0zhar authored Mar 6, 2023
1 parent d87af40 commit cc3cef7
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions dumper(include_in_page).js → dumper.js
Original file line number Diff line number Diff line change
@@ -1,21 +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

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);
/* Over at the server, we split this string into 2 parts
([filename].bin, [filedata]) and using this, we no
longer need to manually change the filename inside the
server.js file. */
webSock.send(`${name}.bin,${buffer});
bytesLeft -= chunkSize;
bytesRead += chunkSize;
buffer = null;
Expand Down

0 comments on commit cc3cef7

Please sign in to comment.