Skip to content

Instantly share code, notes, and snippets.

@comp500
Created February 19, 2020 04:22
Show Gist options
  • Save comp500/1f148389fec3bdb577ea24534a0d4570 to your computer and use it in GitHub Desktop.
Save comp500/1f148389fec3bdb577ea24534a0d4570 to your computer and use it in GitHub Desktop.
how 2 break discord
// literally just throwing this code here because I need to sleep
(() => {
let handler = {
get: function(target, name) {
console.log("getName " + name);
return target[name];
}
};
//let old = window.webpackJsonp;
//window.webpackJsonp = new Proxy(old, handler);
for (let i = 0; i < window.webpackJsonp.length; i++) {
//old[i] = (...args) => {
// console.log(i);
// return old[i](...args);
//};
window.webpackJsonp[i][1] = new Proxy(window.webpackJsonp[i][1], handler);
}
let handler2 = {
get: function(target, name) {
console.log("wpjpGet " + name);
if (name == "push") {
return el => {
console.log(el);
if (el instanceof Array && value.length == 2) {
el[1] = new Proxy(el[1], handler);
}
target.push(el);
};
}
return target[name];
},
set: function(target, property, value, receiver) {
console.log("wpjpSet " + property);
if (value instanceof Array && value.length == 2) {
value[1] = new Proxy(value[1], handler);
}
target[property] = value;
}
};
let old = window.webpackJsonp;
window.webpackJsonp = new Proxy(old, handler2);
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment