update proxy release

This commit is contained in:
Cynthia Foxwell 2018-07-11 18:32:22 -06:00
parent 9297c285b1
commit 1d4fc955bf
4 changed files with 383 additions and 344 deletions

View File

@ -6,6 +6,12 @@
<meta property="og:description" content="Instructions for installing Lambda" />
<meta property="og:image" content="/lambda.png" />
<script>
function updatePayload() {
document.querySelector('code').innerText = `DiscordNative.globals.appSettings.set('UPDATE_ENDPOINT','https://proxy.xn--lmbda-2be.cf/api');DiscordNative.globals.appSettings.save();reloadElectronApp()`
}
</script>
<style>
@font-face {
font-family: 'IBMVGA8';
@ -45,9 +51,9 @@
<body>
<div>L&lambda;mbda</div>
<a href="https://gitlab.com/Cynosphere/lambda-patcher">Grab the Lambda Patcher</a>
Copy and paste the following string into your Discord console:
<br>
<p>Lambda does not have any Discord internal injection methods anymore.</p>
<code>please wait...</code>
<br>
<b>This is a fork of EndPwn3.</b>
</body>

View File

@ -17,7 +17,7 @@
*/
var internal = {
/*var internal = {
print: function (str) {
console.log(`%c[Customizer]%c ` + str, 'font-weight:bold;color:#0cc', '');
@ -120,3 +120,4 @@ exports = {
}
}
*/

View File

@ -16,286 +16,318 @@
https://github.com/endpwn/
*/
exports = {
manifest: {
replacements: [
{
signature: /{section:(\w)\.SectionTypes\.DIVIDER},{section:"logout",/g,
payload: '{section:$1.SectionTypes.DIVIDER},{section:"ENDPWN",label:"ΣndPwn Settings",element:window.BlankSettingsElement,color:"#0cc"},{section:$1.SectionTypes.DIVIDER},{section:"logout",'
}
],
},
init: function () {
if (window.$api === undefined && typeof $api != "undefined") {
console.warn(
"$api is defined, but window.$api is not! assuming we are running under epapi6 and exporting an empty object..."
);
exports = {};
} else
exports = {
manifest: {
replacements: [
{
signature: /{section:(\w)\.SectionTypes\.DIVIDER},{section:"logout",/g,
payload:
'{section:$1.SectionTypes.DIVIDER},{section:"ENDPWN",label:"ΣndPwn Settings",element:window.BlankSettingsElement,color:"#0cc"},{section:$1.SectionTypes.DIVIDER},{section:"logout",'
}
]
},
delete endpwn.settings.init;
init: function() {
delete endpwn.settings.init;
var currentSection = '';
var currentSection = "";
$api.events.listen('ENDPWN_PSEUDO_IPC', msg => {
$api.localStorage.set('customizer_signature', JSON.parse(msg.data).signature);
console.log(currentSection);
renderSettings(currentSection);
});
/*$api.events.listen('ENDPWN_PSEUDO_IPC', msg => {
$api.localStorage.set('customizer_signature', JSON.parse(msg.data).signature);
console.log(currentSection);
renderSettings(currentSection);
});*/
window.BlankSettingsElement = $api.util.findConstructor('FormSection', 'FormSection').FormSection;
window.BlankSettingsElement = $api.util.findConstructor(
"FormSection",
"FormSection"
).FormSection;
var buttons = $api.util.findFuncExports('button-', 'colorBlack');
var checkboxes = $api.util.findFuncExports('checkboxEnabled');
var misc = $api.util.findFuncExports('statusRed-', 'inputDefault');
var misc2 = $api.util.findFuncExports('multiInputField');
var headers = $api.util.findFuncExports('h5-', 'h5');
var buttons = $api.util.findFuncExports("button-", "colorBlack");
var checkboxes = $api.util.findFuncExports("checkboxEnabled");
var misc = $api.util.findFuncExports("statusRed-", "inputDefault");
var misc2 = $api.util.findFuncExports("multiInputField");
var headers = $api.util.findFuncExports("h5-", "h5");
var panels = wc.findFunc('flexChild-')[0].exports;
var panels2 = $api.util.findFuncExports('errorMessage-', 'inputWrapper');
var panels = wc.findFunc("flexChild-")[0].exports;
var panels2 = $api.util.findFuncExports(
"errorMessage-",
"inputWrapper"
);
function createVerticalPanel() {
return createElement("div")
.withClass(panels2.vertical, 'epButtonPanel')
}
function createHorizontalPanel() {
return createElement("div")
.withClass(panels.horizontal, 'epButtonPanel')
}
function createButton(name) {
return createElement('button')
.withContents(name)
.withClass(
buttons.button,
buttons.lookFilled,
buttons.colorBrand,
buttons.sizeSmall,
buttons.grow,
'epMargin'
function createVerticalPanel() {
return createElement("div").withClass(
panels2.vertical,
"epButtonPanel"
);
}
function createWarnButton(name) {
return createElement('button')
.withContents(name)
.withClass(
buttons.button,
buttons.lookOutlined,
buttons.colorYellow,
buttons.sizeSmall,
buttons.grow,
'epMargin'
);
}
function createDangerButton(name) {
return createElement('button')
.withContents(name)
.withClass(
buttons.button,
buttons.lookOutlined,
buttons.colorRed,
buttons.sizeSmall,
buttons.grow,
'epMargin'
);
}
function createH2(text) {
//h2-2gWE-o title-3sZWYQ size16-14cGz5 height20-mO2eIN weightSemiBold-NJexzi defaultColor-1_ajX0 defaultMarginh2-2LTaUL marginBottom20-32qID7
return createElement("h2")
.withClass(
headers.h2,
headers.title,
headers.size16,
headers.height20,
headers.weightSemiBold,
headers.defaultColor,
'epMargin'
)
.withText(text);
}
function createH5(text) {
return createElement("h5")
.withClass(
headers.h5,
headers.title,
headers.size12,
headers.height16,
headers.weightSemiBold
)
.withText(text);
}
function createInput(v) {
return createElement("input")
.withClass(
misc.inputDefault,
misc.input,
misc.size16,
'epMargin'
)
.modify(x => x.value = v)
}
//<input class="checkboxEnabled-CtinEn checkbox-2tyjJg" type="checkbox">
//switchEnabled-V2WDBB switch-3wwwcV valueUnchecked-2lU_20 value-2hFrkk sizeDefault-2YlOZr size-3rFEHg themeDefault-24hCdX
//switchEnabled-V2WDBB switch-3wwwcV valueChecked-m-4IJZ value-2hFrkk sizeDefault-2YlOZr size-3rFEHg themeDefault-24hCdX
function updateSwitch(s, w) {
if (s.checked) {
w.classList.remove(checkboxes.valueUnchecked.split(' ')[0]);
w.classList.add(checkboxes.valueChecked.split(' ')[0])
}
else {
w.classList.remove(checkboxes.valueChecked.split(' ')[0]);
w.classList.add(checkboxes.valueUnchecked.split(' ')[0])
function createHorizontalPanel() {
return createElement("div").withClass(
panels.horizontal,
"epButtonPanel"
);
}
}
function createSwitch(c, i) {
if (c === undefined) c = () => { };
if (i === undefined) i = false;
var s, w = createElement('div')
.withClass(
checkboxes.switch,
checkboxes.switchEnabled,
checkboxes.size,
checkboxes.sizeDefault,
checkboxes.themeDefault
)
.withChildren(
s = createElement("input")
function createButton(name) {
return createElement("button")
.withContents(name)
.withClass(
buttons.button,
buttons.lookFilled,
buttons.colorBrand,
buttons.sizeSmall,
buttons.grow,
"epMargin"
);
}
function createWarnButton(name) {
return createElement("button")
.withContents(name)
.withClass(
buttons.button,
buttons.lookOutlined,
buttons.colorYellow,
buttons.sizeSmall,
buttons.grow,
"epMargin"
);
}
function createDangerButton(name) {
return createElement("button")
.withContents(name)
.withClass(
buttons.button,
buttons.lookOutlined,
buttons.colorRed,
buttons.sizeSmall,
buttons.grow,
"epMargin"
);
}
function createH2(text) {
//h2-2gWE-o title-3sZWYQ size16-14cGz5 height20-mO2eIN weightSemiBold-NJexzi defaultColor-1_ajX0 defaultMarginh2-2LTaUL marginBottom20-32qID7
return createElement("h2")
.withClass(
headers.h2,
headers.title,
headers.size16,
headers.height20,
headers.weightSemiBold,
headers.defaultColor,
"epMargin"
)
.withText(text);
}
function createH5(text) {
return createElement("h5")
.withClass(
headers.h5,
headers.title,
headers.size12,
headers.height16,
headers.weightSemiBold
)
.withText(text);
}
function createInput(v) {
return createElement("input")
.withClass(
misc.inputDefault,
misc.input,
misc.size16,
"epMargin"
)
.modify(x => (x.value = v));
}
//<input class="checkboxEnabled-CtinEn checkbox-2tyjJg" type="checkbox">
//switchEnabled-V2WDBB switch-3wwwcV valueUnchecked-2lU_20 value-2hFrkk sizeDefault-2YlOZr size-3rFEHg themeDefault-24hCdX
//switchEnabled-V2WDBB switch-3wwwcV valueChecked-m-4IJZ value-2hFrkk sizeDefault-2YlOZr size-3rFEHg themeDefault-24hCdX
function updateSwitch(s, w) {
if (s.checked) {
w.classList.remove(checkboxes.valueUnchecked.split(" ")[0]);
w.classList.add(checkboxes.valueChecked.split(" ")[0]);
} else {
w.classList.remove(checkboxes.valueChecked.split(" ")[0]);
w.classList.add(checkboxes.valueUnchecked.split(" ")[0]);
}
}
function createSwitch(c, i) {
if (c === undefined) c = () => {};
if (i === undefined) i = false;
var s,
w = createElement("div")
.withClass(
checkboxes.checkbox,
checkboxes.checkboxEnabled
checkboxes.switch,
checkboxes.switchEnabled,
checkboxes.size,
checkboxes.sizeDefault,
checkboxes.themeDefault
)
.modify(x => x.type = 'checkbox')
.modify(x => x.checked = i)
.modify(x => x.onchange = () => {
updateSwitch(s, w);
c(s.checked);
})
)
updateSwitch(s, w);
return w;
}
.withChildren(
(s = createElement("input")
.withClass(
checkboxes.checkbox,
checkboxes.checkboxEnabled
)
.modify(x => (x.type = "checkbox"))
.modify(x => (x.checked = i))
.modify(
x =>
(x.onchange = () => {
updateSwitch(s, w);
c(s.checked);
})
))
);
updateSwitch(s, w);
return w;
}
function authorizeCustomizer() {
var endpoint = $api.internal.constants.API_HOST;
var url = `https://${endpoint}/oauth2/authorize?client_id=436715820970803203&redirect_uri=https%3A%2F%2Fendpwn.cathoderay.tube%2Fauth%2Fdiscord%2Fintegratedcallback&response_type=code&scope=identify`;
/*function authorizeCustomizer() {
var endpoint = $api.internal.constants.API_HOST;
var url = `https://${endpoint}/oauth2/authorize?client_id=436715820970803203&redirect_uri=https%3A%2F%2Fendpwn.cathoderay.tube%2Fauth%2Fdiscord%2Fintegratedcallback&response_type=code&scope=identify`;
var win = new window.electron.BrowserWindow({
width: 420,
height: 500,
transparent: false,
frame: false,
resizable: true,
nodeIntegration: true
});
win.loadURL(url);
}
var win = new window.electron.BrowserWindow({
width: 420,
height: 500,
transparent: false,
frame: false,
resizable: true,
nodeIntegration: true
});
win.loadURL(url);
}
function submitCustomizer(d, b) {
function submitCustomizer(d, b) {
fetch('https://endpwn.cathoderay.tube/set', {
headers: {
'Content-type': 'application/json'
},
method: 'POST',
body: JSON.stringify({
id: $me(),
signature: $api.localStorage.get('customizer_signature'),
discriminator: d,
bot: b
})
}).then(r => {
fetch('https://endpwn.cathoderay.tube/set', {
headers: {
'Content-type': 'application/json'
},
method: 'POST',
body: JSON.stringify({
id: $me(),
signature: $api.localStorage.get('customizer_signature'),
discriminator: d,
bot: b
})
}).then(r => {
r.text().then(k => {
$api.ui.showDialog({
title: 'Server Response',
body: k
r.text().then(k => {
$api.ui.showDialog({
title: 'Server Response',
body: k
});
});
endpwn.customizer.update();
});
endpwn.customizer.update();
}*/
});
function renderSettings(e) {
currentSection = e;
if ($("#ep_settings")) $("#ep_settings").remove();
}
if (e.section == "ENDPWN") {
var pane = $(".content-column.default");
if (!pane) return;
function renderSettings(e) {
//var needAuth = !$api.localStorage.get('customizer_signature');
currentSection = e;
if ($("#ep_settings")) $("#ep_settings").remove();
if (e.section == "ENDPWN") {
var pane = $(".content-column.default");
if (!pane) return;
var needAuth = !$api.localStorage.get('customizer_signature');
var content = createElement('div')
.withId('ep_settings')
.withClass('flex-vertical')
.withChildren(
createElement("div")
.withClass('epSettingsHeader')
.withText('ΣndPwn Settings')
)
.appendTo(pane);
if (!$api.localStorage.get('customizer_signature')) {
createHorizontalPanel()
var content = createElement("div")
.withId("ep_settings")
.withClass("flex-vertical")
.withChildren(
createButton("Authorize EndPwn Customizer")
.modify(x => x.onclick = authorizeCustomizer)
createElement("div")
.withClass("epSettingsHeader")
.withText("ΣndPwn Settings")
)
.appendTo(pane);
/*if (!$api.localStorage.get('customizer_signature')) {
createHorizontalPanel()
.withChildren(
createButton("Authorize EndPwn Customizer")
.modify(x => x.onclick = authorizeCustomizer)
)
.appendTo(content);
}
else {
var discrim, bot;
createVerticalPanel()
.withChildren(
createH5('Discriminator'),
createHorizontalPanel()
.withChildren(
discrim = createInput(endpwn.customizer.me.discrim ? endpwn.customizer.me.discrim : '')
.withClass('epDiscrimField')
.modify(x => x.maxLength = 4),
createVerticalPanel()
.withChildren(
createH5('Bot?'),
bot = createSwitch(() => { }, endpwn.customizer.me.bot)
),
createButton("Submit")
.modify(x => x.onclick = () => submitCustomizer(discrim.value, bot.children[0].checked))
)
)
.appendTo(content);
}*/
createElement("div")
.withClass(panels.horizontal, "epButtonPanel")
.withChildren(
createButton("Open Data Folder").modify(
x =>
(x.onclick = () => {
electron.shell.openExternal($api.data);
})
),
createWarnButton("Restart in safe mode").modify(
x => (x.onclick = endpwn.safemode)
),
createDangerButton("Uninstall EndPwn").modify(
x => (x.onclick = endpwn.uninstall)
)
/*createButton("Toggle Customizer")
.modify(x => x.onclick = function(){
window.____customizerToggled = !window.____customizerToggled;
$api.localStorage.set("customizerToggled",window.____customizerToggled);
const restart = confirm("For toggle to be in full effect, you will need to refresh. Press \"OK\" to refresh or \"Cancel\" to refresh later on your own.");
if (restart){
window.electron.getCurrentWindow().reload();
}
})*/
)
.appendTo(content);
}
else {
var discrim, bot;
createVerticalPanel()
.withChildren(
createH5('Discriminator'),
createHorizontalPanel()
.withChildren(
discrim = createInput(endpwn.customizer.me.discrim ? endpwn.customizer.me.discrim : '')
.withClass('epDiscrimField')
.modify(x => x.maxLength = 4),
createVerticalPanel()
.withChildren(
createH5('Bot?'),
bot = createSwitch(() => { }, endpwn.customizer.me.bot)
),
createButton("Submit")
.modify(x => x.onclick = () => submitCustomizer(discrim.value, bot.children[0].checked))
)
)
.appendTo(content);
}
createElement("div")
.withClass(panels.horizontal, 'epButtonPanel')
.withChildren(
createButton("Open Data Folder")
.modify(x => x.onclick = () => { electron.shell.openExternal($api.data) }),
createWarnButton("Restart in safe mode")
.modify(x => x.onclick = endpwn.safemode),
createDangerButton("Uninstall EndPwn")
.modify(x => x.onclick = endpwn.uninstall)
)
.appendTo(content);
}
$api.events.hook("USER_SETTINGS_MODAL_SET_SECTION", renderSettings);
$api.events.hook("USER_SETTINGS_MODAL_INIT", e =>
setTimeout(_ => renderSettings(e), 200)
);
}
$api.events.hook("USER_SETTINGS_MODAL_SET_SECTION", renderSettings);
$api.events.hook("USER_SETTINGS_MODAL_INIT", e => setTimeout(_ => renderSettings(e), 200));
}
}
};

View File

@ -18,20 +18,17 @@
*/
var internal = {
print: function (str) {
console.log(`%c[EndPwn3]%c ` + str, 'font-weight:bold;color:#0cc', '');
print: function(str) {
console.log(`%c[EndPwn3]%c ` + str, "font-weight:bold;color:#0cc", "");
},
warn: function (str) {
console.warn(`%c[EndPwn3]%c ` + str, 'font-weight:bold;color:#0cc', '');
warn: function(str) {
console.warn(`%c[EndPwn3]%c ` + str, "font-weight:bold;color:#0cc", "");
}
}
};
exports = {
manifest: {
replacements: [
// changelog injection
/*{
signature: /key:"changeLog",get:function\(\){return (\w)}/g,
@ -49,69 +46,69 @@ exports = {
signature: "window.GLOBAL_ENV.RELEASE_CHANNEL",
payload: "'staging'"
}
],
]
},
preload: function () {
window.reload = () => { app.relaunch(); app.exit(); };
preload: function() {
window.reload = () => {
app.relaunch();
app.exit();
};
window.endpwn = {
// safemode
safemode: function () {
safemode: function() {
$api.ui.showDialog({
title: 'EndPwn: safe mode',
body: 'This will restart your client in a state without plugin support.',
confirmText: 'Yes', cancelText: 'No',
title: "EndPwn: safe mode",
body:
"This will restart your client in a state without plugin support.",
confirmText: "Yes",
cancelText: "No",
onConfirm: () => {
$api.localStorage.set('safemode', 1);
$api.localStorage.set("safemode", 1);
window.electron.getCurrentWindow().reload();
}
});
},
// uninstaller
uninstall: function () {
uninstall: function() {
$api.ui.showDialog({
title: 'EndPwn: confirm uninstallation',
body: 'Are you sure you want to remove EndPwn from your client? You can reinstall it at any time.',
confirmText: 'Yes', cancelText: 'No',
title: "EndPwn: confirm uninstallation",
body:
"Are you sure you want to remove EndPwn from your client? You can reinstall it at any time.",
confirmText: "Yes",
cancelText: "No",
onConfirm: () => {
var data = $api.data;
$api.settings.set('WEBAPP_ENDPOINT');
$api.settings.set('WEBAPP_PATH');
$api.settings.set('UPDATE_ENDPOINT');
$api.settings.set("WEBAPP_ENDPOINT");
$api.settings.set("WEBAPP_PATH");
$api.settings.set("UPDATE_ENDPOINT");
reload();
}
});
},
// endpwn customizer
customizer: krequire('customizer'),
//customizer: krequire('customizer'),
// settings page stuff
settings: krequire('settings'),
settings: krequire("settings"),
// wrapper function for dispatch()
// intended to simplify using executeJavaScript() from other windows as a bad IPC method
// we do this since afaik we cant use electron.ipc in a useful way (maybe im wrong? if i am ill make this better later on lol)
pseudoipc: function (e) {
pseudoipc: function(e) {
$api.events.dispatch({
type: 'ENDPWN_PSEUDO_IPC',
type: "ENDPWN_PSEUDO_IPC",
data: e
});
},
__eval: e => eval(e)
};
// fetch the changelog
@ -125,79 +122,82 @@ exports = {
});*/
// early init payload
document.addEventListener('ep-prepared', () => {
document.addEventListener("ep-prepared", () => {
// disable that obnoxious warning about not pasting shit in the console
internal.print('disabling self xss warning...');
$api.util.findFuncExports('consoleWarning').consoleWarning = e => { };
internal.print("disabling self xss warning...");
$api.util.findFuncExports(
"consoleWarning"
).consoleWarning = e => {};
// fuck sentry
internal.print('fucking sentry...');
var sentry = wc.findCache('_originalConsoleMethods')[0].exports;
window.console = Object.assign(window.console, sentry._originalConsoleMethods); // console
sentry._wrappedBuiltIns.forEach(x => x[0][x[1]] = x[2]); // other stuff
sentry._breadcrumbEventHandler = () => () => { }; // break most event logging
sentry.captureBreadcrumb = () => { }; // disable breadcrumb logging
internal.print("fucking sentry...");
var sentry = wc.findCache("_originalConsoleMethods")[0].exports;
window.console = Object.assign(
window.console,
sentry._originalConsoleMethods
); // console
sentry._wrappedBuiltIns.forEach(x => (x[0][x[1]] = x[2])); // other stuff
sentry._breadcrumbEventHandler = () => () => {}; // break most event logging
sentry.captureBreadcrumb = () => {}; // disable breadcrumb logging
});
},
start: function () {
start: function() {
// disable analytics
internal.print('disabling analytics...');
$api.util.findFuncExports("AnalyticEventConfigs").default.track = () => { };
internal.print("disabling analytics...");
$api.util.findFuncExports(
"AnalyticEventConfigs"
).default.track = () => {};
// enable experiments
internal.print('enabling experiments menu...');
$api.util.findFuncExports('isDeveloper').__defineGetter__('isDeveloper', () => true);
internal.print("enabling experiments menu...");
$api.util
.findFuncExports("isDeveloper")
.__defineGetter__("isDeveloper", () => true);
// if we used start() in the other files, it would create a different instance -- we dont want that
endpwn.customizer.init();
endpwn.settings.init();
// check for epapi updates
if ($api.lite || !fs.existsSync($api.data + '/DONTUPDATE'))
(function () {
internal.print('checking for EPAPI updates...');
if ($api.lite || !fs.existsSync($api.data + "/DONTUPDATE"))
(function() {
internal.print("checking for EPAPI updates...");
// fetch the latest build of epapi
fetch('https://lambda.cynfoxwell.cf/epapi/epapi.js?_=' + Date.now()).then(x => x.text()).then(x => {
// fetch the latest build of epapi
fetch(
"https://lambda.cynfoxwell.cf/epapi/epapi.js?_=" +
Date.now()
)
.then(x => x.text())
.then(x => {
// check the version
if (kparse(x).version > $api.version) {
// if the version on the server is newer, pester the user
$api.ui.showDialog({
title: "EndPwn3: EPAPI Update Available",
body:
"An update to EPAPI has been released. It is recommended that you restart your client in order to gain access to new features and maintain compatibility.",
confirmText: "Restart Now",
cancelText: "Later",
// check the version
if (kparse(x).version > $api.version) {
// if the version on the server is newer, pester the user
$api.ui.showDialog({
title: 'EndPwn3: EPAPI Update Available',
body: 'An update to EPAPI has been released. It is recommended that you restart your client in order to gain access to new features and maintain compatibility.',
confirmText: 'Restart Now', cancelText: 'Later',
// user pressed "Restart Now"
onConfirm: () => {
// refresh the page if we're running in a browser, reboot the app if we're running outside of lite mode
reload();
},
// they pressed "Later", for some reason
onCancel: () => {
// bother them again in 6 hrs (* 60 min * 60 sec * 1000 ms)
setTimeout(arguments.callee, 6 * 60 * 60 * 1000);
}
// user pressed "Restart Now"
onConfirm: () => {
// refresh the page if we're running in a browser, reboot the app if we're running outside of lite mode
reload();
},
// they pressed "Later", for some reason
onCancel: () => {
// bother them again in 6 hrs (* 60 min * 60 sec * 1000 ms)
setTimeout(
arguments.callee,
6 * 60 * 60 * 1000
);
}
});
} else setTimeout(arguments.callee, 6 * 60 * 60 * 1000);
});
}
else setTimeout(arguments.callee, 6 * 60 * 60 * 1000);
});
})();
})();
}
}
};