eval isolation, pass bsprops to crispr

This commit is contained in:
Astra 2018-05-14 06:44:15 -04:00
parent 00b3d9eab4
commit 4a345d6d09
1 changed files with 23 additions and 9 deletions

View File

@ -10,10 +10,20 @@
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
DO NOT EDIT THIS FILE! Your bootstrap may overwrite changes to it, and you will lose your work!
EndPwn3 users: You can prevent this by creating a file in the same directory named DONOTUPDATE
https://github.com/endpwn/ https://github.com/endpwn/
*/ */
function evaluate(str, exportsR) {
var exports = {};
var ret = eval(str);
if (exportsR) Object.assign(exportsR, exports);
return ret;
}
(() => { (() => {
function __crxprint(str) { function __crxprint(str) {
@ -28,20 +38,20 @@
var fs = electron.require('original-fs'); var fs = electron.require('original-fs');
// get the data path (where epapi.js should be) // get the data path (where epapi.js should be)
var ___data = electron.app.getPath('userData').replace(/\\\\/g, "/") + '/'; var data = electron.app.getPath('userData').replace(/\\\\/g, "/") + '/';
// shakily reimplemented of require() intended for loading plugins and EPAPI itself // shakily reimplemented of require() intended for loading plugins and EPAPI itself
function __krequire(path) { function krequire(p) {
return eval('(()=>{var exports={};' + fs.readFileSync(___data + path, 'utf8').toString() + ';return exports})()'); var exports = {};
evaluate(fs.readFileSync(data + p + (p.endsWith('.js') ? '' : '.js'), 'utf8').toString(), exports);
return exports;
} }
// load CRISPR and EPAPI // load CRISPR and EPAPI
var crispr = __krequire('crispr.js'); var crispr = krequire('crispr.js');
var epapi = __krequire('epapi.js'); var epapi = krequire('epapi.js');
// call their entrypoints var properties = {
crispr.go();
electron.getCurrentWindow().webContents.on('dom-ready', () => epapi.go({
name: 'EndPwn3', name: 'EndPwn3',
version: { version: {
major: 3, major: 3,
@ -53,6 +63,10 @@
}, },
method: 'crxpwn', method: 'crxpwn',
brand: true brand: true
})); };
// call their entrypoints
crispr.go(properties);
electron.getCurrentWindow().webContents.on('dom-ready', () => epapi.go(properties));
})(); })();