diff --git a/efserver.js b/efserver.js new file mode 100644 index 0000000..4429559 --- /dev/null +++ b/efserver.js @@ -0,0 +1,4 @@ +function EFServer() { + //Todo: write mod that disables rendering engine, autodisplays gui, and makes run server button. + console.log("hello world"); +} \ No newline at end of file diff --git a/index.html b/index.html index 8cd402a..d38e83c 100644 --- a/index.html +++ b/index.html @@ -89,18 +89,27 @@ >

- +


Info:
- Where can I download an unobfuscated unsigned Eaglercraft build? - https://github.com/Eaglercraft-Archive/unminified-eaglercraft-builds/releases/latest + + Where can I download an unobfuscated unsigned Eaglercraft build? + + https://github.com/Eaglercraft-Archive/unminified-eaglercraft-builds/releases/latest
- How do I compile my own unobfuscated unsigned Eaglercraft build? + + How do I compile my own unobfuscated unsigned Eaglercraft build? + Once you have a local EaglercraftX workspace setup, in build.gradle, set the obfuscate property to false. Then, run CompileJS.bat (or .sh if on @@ -131,272 +140,32 @@ + + diff --git a/injector.js b/injector.js new file mode 100644 index 0000000..50a7ad4 --- /dev/null +++ b/injector.js @@ -0,0 +1,269 @@ +function entriesToStaticVariableProxy(entries, prefix) { + var getComponents = ""; + entries.forEach((entry) => { + getComponents += ` + case \`${entry.name}\`: + return ${entry.variable}; + break;`; + }); + + var setComponents = ""; + entries.forEach((entry) => { + setComponents += ` + case \`${entry.name}\`: + ${entry.variable} = c; + break;`; + }); + var proxy = ` + ModAPI.hooks._rippedStaticIndexer[\`${prefix.replace( + "var ", + "" + )}\`] = [${entries + .flatMap((x) => { + return '"' + x.name + '"'; + }) + .join(",")}]; + ModAPI.hooks._rippedStaticProperties[\`${prefix.replace( + "var ", + "" + )}\`] = new Proxy({${entries + .flatMap((x) => { + return '"' + x.name + '"'; + }) + .join(":null,") + (entries.length > 0 ? ":null" : "") + }}, { + get: function (a,b,c) { + switch (b) { + ${getComponents} + } + }, + set: function (a,b,c) { + switch (b) { + ${setComponents} + } + } + });`; + return proxy; +} +function processClasses(string) { + var patchedFile = string; + patchedFile = patchedFile.replaceAll( + `(function(root, module) {`, + `${modapi_preinit} +(function(root, module) {` + ); + patchedFile = patchedFile.replaceAll( + `var main;(function(){`, + `${modapi_preinit} +var main;(function(){` + ); + patchedFile = patchedFile + .replace("\r", "") + .replace( + "var main;\n(function() {", + modapi_preinit + "var main;\n(function() {" + ); + patchedFile = patchedFile.replace( + /function \$rt_metadata\(data\)( ?){/gm, + `function $rt_metadata(data) { + /*/EaglerForge Client Patch/*/ + ModAPI.hooks._rippedData.push(data); + /*/EaglerForge Client Patch/*/` + ); + + patchedFile = patchedFile.replaceAll( + `return thread != null && thread.isResuming()`, + (match) => { + return freezeCallstack + match; + } + ); + + patchedFile = patchedFile.replaceAll( + `return thread != null && thread.isSuspending();`, + (match) => { + return freezeCallstack + match; + } + ); + + patchedFile = patchedFile.replaceAll( + `return $rt_currentNativeThread;`, + (match) => { + return ( + `if(ModAPI.hooks.freezeCallstack){return {isResuming: ()=>{false}, isSuspending: ()=>{false}, push: (a)=>{}, pop: ()=>{console.warn("Frozen stack was popped, context is now unstable.")}}};` + + match + ); + } + ); + + patchedFile = patchedFile.replace( + ` id="game_frame">`, + ` id="game_frame"> + \