├── EssaFuscatorAPIRestructered ├── EssaFuscator.sql ├── Obfuscator │ ├── LuaCompiler-O.dll │ ├── LuaCompiler-O.exp │ ├── LuaCompiler-O.lib │ ├── LuaCompiler-O.pdb │ ├── MoonSharp.Interpreter.dll │ └── master │ │ ├── Emulation │ │ ├── LuaCompiler-O.dll │ │ ├── LuaCompiler-O.exp │ │ ├── LuaCompiler-O.lib │ │ └── LuaCompiler-O.pdb │ │ ├── EssaFuscator.CLI.deps.json │ │ ├── EssaFuscator.CLI.dll │ │ ├── EssaFuscator.CLI.exe │ │ ├── EssaFuscator.CLI.pdb │ │ ├── EssaFuscator.CLI.runtimeconfig.dev.json │ │ ├── EssaFuscator.CLI.runtimeconfig.json │ │ ├── EssaFuscator.deps.json │ │ ├── EssaFuscator.dll │ │ ├── Loretta.CodeAnalysis.Lua.Experimental.dll │ │ ├── Loretta.CodeAnalysis.Lua.dll │ │ ├── Loretta.CodeAnalysis.dll │ │ ├── LuaCompiler-O.dll │ │ ├── LuaCompiler-O.exp │ │ ├── LuaCompiler-O.lib │ │ ├── LuaCompiler-O.pdb │ │ ├── MoonSharp.Interpreter.deps.json │ │ ├── MoonSharp.Interpreter.dll │ │ ├── Tsu.dll │ │ ├── lua51.dll │ │ ├── luac.exe │ │ └── luajit.exe ├── cluster.js ├── failedfile.lua ├── index.js ├── package-lock.json ├── package.json ├── security │ ├── Logs │ │ └── connections.log │ └── mariadblog.js ├── starter.bat └── v2 │ ├── config │ ├── express.json │ ├── info.json │ ├── mariadb.json │ └── webhooks.json │ ├── controllers │ ├── download.js │ ├── epdatatable.js │ ├── inforoute.js │ ├── obfuscate.js │ └── status.js │ ├── functions │ ├── filesystem.js │ ├── mariadb.js │ ├── obfuscation.js │ ├── print.js │ └── webhooks.js │ └── routes │ ├── download.js │ ├── epdatatable.js │ ├── inforoute.js │ ├── obfuscate.js │ ├── status.js │ └── validateapi.js ├── EssaFuscatorBot ├── commands │ ├── createkey.js │ ├── help.js │ ├── mykey.js │ ├── obfuscate.js │ └── scriptfinder.js ├── config.json ├── events │ ├── interactionCreate.js │ ├── modal.js │ └── ready.js ├── index.js ├── modules │ └── functions.js ├── package-lock.json ├── package.json └── start.cmd ├── EssaFuscatorBotDeployable ├── index.js ├── package-lock.json ├── package.json └── starter.bat ├── EssaFuscatorMain └── EssaFuscator │ ├── CLI │ ├── EssaFuscator.CLI.csproj │ ├── Program.cs │ └── bin │ │ └── Debug │ │ ├── LuaCompiler-O.dll │ │ ├── LuaCompiler-O.exp │ │ ├── LuaCompiler-O.lib │ │ ├── LuaCompiler-O.pdb │ │ └── netcoreapp3.1 │ │ ├── Emulation │ │ ├── LuaCompiler-O.dll │ │ ├── LuaCompiler-O.exp │ │ ├── LuaCompiler-O.lib │ │ └── LuaCompiler-O.pdb │ │ ├── EssaFuscator.CLI.deps.json │ │ ├── EssaFuscator.CLI.dll │ │ ├── EssaFuscator.CLI.exe │ │ ├── EssaFuscator.CLI.pdb │ │ ├── EssaFuscator.CLI.runtimeconfig.dev.json │ │ ├── EssaFuscator.CLI.runtimeconfig.json │ │ ├── EssaFuscator.deps.json │ │ ├── EssaFuscator.dll │ │ ├── EssaFuscator.pdb │ │ ├── Loretta.CodeAnalysis.Lua.Experimental.dll │ │ ├── Loretta.CodeAnalysis.Lua.dll │ │ ├── Loretta.CodeAnalysis.dll │ │ ├── LuaCompiler-O.dll │ │ ├── LuaCompiler-O.exp │ │ ├── LuaCompiler-O.lib │ │ ├── LuaCompiler-O.pdb │ │ ├── MoonSharp.Interpreter.deps.json │ │ ├── MoonSharp.Interpreter.dll │ │ ├── Tsu.dll │ │ ├── lua51.dll │ │ ├── luac.exe │ │ ├── luajit.exe │ │ ├── server.lua │ │ └── starter.bat │ ├── EssaFuscator.sln │ └── EssaFuscator │ ├── Bytecode_Library │ ├── Bytecode │ │ ├── Deserializer.cs │ │ ├── Opcode.cs │ │ ├── Serializer.cs │ │ └── VanillaSerializer.cs │ ├── Compiler │ │ ├── Binding │ │ │ ├── Binding.cs │ │ │ ├── Natives.cs │ │ │ └── Objects │ │ │ │ ├── LuaFunction.cs │ │ │ │ ├── LuaTable.cs │ │ │ │ ├── LuaThread.cs │ │ │ │ └── LuaUserData.cs │ │ └── LuaCompiler.cs │ └── IR │ │ ├── Chunk.cs │ │ ├── Constant.cs │ │ ├── Enums.cs │ │ └── Instruction.cs │ ├── EssaFuscator.csproj │ ├── Extensions │ └── IEnumerableExtensions.cs │ ├── Obfuscation.cs │ ├── Obfuscator │ ├── Control Flow │ │ ├── Blocks │ │ │ └── Block.cs │ │ ├── CFGenerator.cs │ │ ├── CFlowContext.cs │ │ └── Types │ │ │ ├── BitShiftMutate.cs │ │ │ ├── Bounce.cs │ │ │ ├── EqMutate.cs │ │ │ ├── Inlining.cs │ │ │ ├── NumberMutate.cs │ │ │ ├── TestFlip.cs │ │ │ ├── TestPreserve.cs │ │ │ └── TestSpam.cs │ ├── CustomInstructionData.cs │ ├── Encryption │ │ ├── AdvancedAntiTamper.cs │ │ └── ConstantEncryption.cs │ ├── ObfuscationContext.cs │ ├── ObfuscationSettings.cs │ ├── Opcodes │ │ ├── OpAdd.cs │ │ ├── OpBAND.cs │ │ ├── OpBLSHFT.cs │ │ ├── OpBNOT.cs │ │ ├── OpBOR.cs │ │ ├── OpBRSHFT.cs │ │ ├── OpBXOR.cs │ │ ├── OpCall.cs │ │ ├── OpClose.cs │ │ ├── OpClosure.cs │ │ ├── OpConcat.cs │ │ ├── OpDiv.cs │ │ ├── OpEq.cs │ │ ├── OpForLoop.cs │ │ ├── OpForPrep.cs │ │ ├── OpGe.cs │ │ ├── OpGetGlobal.cs │ │ ├── OpGetTable.cs │ │ ├── OpGetUpval.cs │ │ ├── OpGt.cs │ │ ├── OpINTDIV.cs │ │ ├── OpJmp.cs │ │ ├── OpLe.cs │ │ ├── OpLen.cs │ │ ├── OpLoadBool.cs │ │ ├── OpLoadK.cs │ │ ├── OpLoadNil.cs │ │ ├── OpLoadStr.cs │ │ ├── OpLt.cs │ │ ├── OpMod.cs │ │ ├── OpMove.cs │ │ ├── OpMul.cs │ │ ├── OpMutated.cs │ │ ├── OpNe.cs │ │ ├── OpNewStk.cs │ │ ├── OpNewTable.cs │ │ ├── OpNot.cs │ │ ├── OpPow.cs │ │ ├── OpPushStk.cs │ │ ├── OpReturn.cs │ │ ├── OpSelf.cs │ │ ├── OpSetFEnv.cs │ │ ├── OpSetGlobal.cs │ │ ├── OpSetList.cs │ │ ├── OpSetTable.cs │ │ ├── OpSetTop.cs │ │ ├── OpSetUpval.cs │ │ ├── OpSub.cs │ │ ├── OpSuperOperator.cs │ │ ├── OpTForLoop.cs │ │ ├── OpTailCall.cs │ │ ├── OpTest.cs │ │ ├── OpTestSet.cs │ │ ├── OpUnm.cs │ │ └── OpVarArg.cs │ ├── Rewriters │ │ ├── LocalProxifier.cs │ │ ├── LuaIntegerSolver.cs │ │ └── StringEncryption.cs │ ├── VM Generation │ │ ├── AdvancedCFlowGenerator.cs │ │ ├── CFlowFlattener.cs │ │ ├── Generator.cs │ │ └── VMStrings.cs │ └── VOpcode.cs │ └── bin │ └── Debug │ └── netcoreapp2.2 │ ├── EssaFuscator.deps.json │ ├── EssaFuscator.dll │ ├── EssaFuscator.pdb │ ├── LuaCompiler-O.dll │ ├── LuaCompiler-O.exp │ ├── LuaCompiler-O.lib │ └── LuaCompiler-O.pdb ├── EssaFuscatorPackageV2 ├── AD │ ├── EssaFuscatorADAR.png │ └── EssaFuscatorADEN.png ├── BANNER │ ├── EssaFuscator CleanBrand.png │ ├── EssaFuscator Header.png │ ├── EssaFuscatorCool.png │ └── EssaFuscatorInvitre.png ├── Logo │ ├── EssaFuscatorBurn.png │ └── EssaFuscatorClean.png ├── LogoGIF │ ├── Animation.gif │ ├── Atom Logo Final GIF Compressed.gif │ └── Logo Reveal Final Video.mp4 ├── PFP │ └── EssaFuscator PFP.png └── Status │ └── Status.png ├── EssaFuscatorStatus ├── Akira_Expanded.otf ├── Status.png ├── index.js └── starter.bat ├── EssaFuscatorWebsite ├── arabic.php ├── img │ ├── efus.webp │ ├── favicon.ico │ ├── index.html │ ├── uae.webp │ └── uk.webp ├── index.php ├── login.php ├── logout.php ├── outsourced │ ├── bootstrap.min.css │ ├── index.html │ └── jquery.js └── phpfunc │ ├── config.php │ ├── discord.php │ ├── functions.php │ ├── index.html │ └── upload.php ├── LICENSE.txt └── README.md /EssaFuscatorAPIRestructered/EssaFuscator.sql: -------------------------------------------------------------------------------- 1 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 2 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 3 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 4 | /*!40101 SET NAMES utf8 */; 5 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; 6 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; 7 | /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; 8 | 9 | # ------------------------------------------------------------ 10 | # SCHEMA DUMP FOR TABLE: downloadlinks 11 | # ------------------------------------------------------------ 12 | 13 | CREATE TABLE IF NOT EXISTS `downloadlinks` ( 14 | `userid` mediumtext DEFAULT NULL, 15 | `userhash` mediumtext DEFAULT NULL, 16 | `realname` mediumtext DEFAULT NULL, 17 | `epoch` bigint(20) DEFAULT NULL, 18 | `timesopened` smallint(6) DEFAULT NULL 19 | ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb3; 20 | 21 | # ------------------------------------------------------------ 22 | # SCHEMA DUMP FOR TABLE: keys 23 | # ------------------------------------------------------------ 24 | 25 | CREATE TABLE IF NOT EXISTS `keys` ( 26 | `sha512` longtext DEFAULT NULL, 27 | `user_id` char(50) DEFAULT NULL, 28 | `datecreated` char(100) DEFAULT NULL 29 | ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4; 30 | 31 | # ------------------------------------------------------------ 32 | # SCHEMA DUMP FOR TABLE: owners 33 | # ------------------------------------------------------------ 34 | 35 | CREATE TABLE IF NOT EXISTS `owners` ( 36 | `script_id` tinytext NOT NULL, 37 | `user_id` longtext NOT NULL, 38 | `date` text NOT NULL, 39 | `epoch` bigint(20) DEFAULT 69 40 | ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb3; 41 | 42 | # ------------------------------------------------------------ 43 | # SCHEMA DUMP FOR TABLE: premium 44 | # ------------------------------------------------------------ 45 | 46 | CREATE TABLE IF NOT EXISTS `premium` ( 47 | `userid` text DEFAULT NULL, 48 | `apikey` text DEFAULT NULL, 49 | `createdepoch` text DEFAULT NULL, 50 | `latestrenewal` text DEFAULT NULL, 51 | `warningnum` tinyint(4) DEFAULT 0, 52 | `notes` text DEFAULT 'none', 53 | `admingiver` text DEFAULT NULL, 54 | `email` text DEFAULT 'none@efx.fyi', 55 | `disabled` tinyint(4) DEFAULT 0 56 | ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb3; 57 | -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/Obfuscator/LuaCompiler-O.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorAPIRestructered/Obfuscator/LuaCompiler-O.dll -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/Obfuscator/LuaCompiler-O.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorAPIRestructered/Obfuscator/LuaCompiler-O.exp -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/Obfuscator/LuaCompiler-O.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorAPIRestructered/Obfuscator/LuaCompiler-O.lib -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/Obfuscator/LuaCompiler-O.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorAPIRestructered/Obfuscator/LuaCompiler-O.pdb -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/Obfuscator/MoonSharp.Interpreter.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorAPIRestructered/Obfuscator/MoonSharp.Interpreter.dll -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/Obfuscator/master/Emulation/LuaCompiler-O.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorAPIRestructered/Obfuscator/master/Emulation/LuaCompiler-O.dll -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/Obfuscator/master/Emulation/LuaCompiler-O.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorAPIRestructered/Obfuscator/master/Emulation/LuaCompiler-O.exp -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/Obfuscator/master/Emulation/LuaCompiler-O.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorAPIRestructered/Obfuscator/master/Emulation/LuaCompiler-O.lib -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/Obfuscator/master/Emulation/LuaCompiler-O.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorAPIRestructered/Obfuscator/master/Emulation/LuaCompiler-O.pdb -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/Obfuscator/master/EssaFuscator.CLI.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorAPIRestructered/Obfuscator/master/EssaFuscator.CLI.dll -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/Obfuscator/master/EssaFuscator.CLI.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorAPIRestructered/Obfuscator/master/EssaFuscator.CLI.exe -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/Obfuscator/master/EssaFuscator.CLI.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorAPIRestructered/Obfuscator/master/EssaFuscator.CLI.pdb -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/Obfuscator/master/EssaFuscator.CLI.runtimeconfig.dev.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeOptions": { 3 | "additionalProbingPaths": [ 4 | "C:\\Users\\emara\\.dotnet\\store\\|arch|\\|tfm|", 5 | "C:\\Users\\emara\\.nuget\\packages", 6 | "D:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages", 7 | "C:\\Program Files (x86)\\Microsoft\\Xamarin\\NuGet" 8 | ] 9 | } 10 | } -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/Obfuscator/master/EssaFuscator.CLI.runtimeconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeOptions": { 3 | "tfm": "netcoreapp3.1", 4 | "framework": { 5 | "name": "Microsoft.NETCore.App", 6 | "version": "3.1.0" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/Obfuscator/master/EssaFuscator.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorAPIRestructered/Obfuscator/master/EssaFuscator.dll -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/Obfuscator/master/Loretta.CodeAnalysis.Lua.Experimental.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorAPIRestructered/Obfuscator/master/Loretta.CodeAnalysis.Lua.Experimental.dll -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/Obfuscator/master/Loretta.CodeAnalysis.Lua.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorAPIRestructered/Obfuscator/master/Loretta.CodeAnalysis.Lua.dll -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/Obfuscator/master/Loretta.CodeAnalysis.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorAPIRestructered/Obfuscator/master/Loretta.CodeAnalysis.dll -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/Obfuscator/master/LuaCompiler-O.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorAPIRestructered/Obfuscator/master/LuaCompiler-O.dll -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/Obfuscator/master/LuaCompiler-O.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorAPIRestructered/Obfuscator/master/LuaCompiler-O.exp -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/Obfuscator/master/LuaCompiler-O.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorAPIRestructered/Obfuscator/master/LuaCompiler-O.lib -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/Obfuscator/master/LuaCompiler-O.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorAPIRestructered/Obfuscator/master/LuaCompiler-O.pdb -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/Obfuscator/master/MoonSharp.Interpreter.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorAPIRestructered/Obfuscator/master/MoonSharp.Interpreter.dll -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/Obfuscator/master/Tsu.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorAPIRestructered/Obfuscator/master/Tsu.dll -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/Obfuscator/master/lua51.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorAPIRestructered/Obfuscator/master/lua51.dll -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/Obfuscator/master/luac.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorAPIRestructered/Obfuscator/master/luac.exe -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/Obfuscator/master/luajit.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorAPIRestructered/Obfuscator/master/luajit.exe -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/cluster.js: -------------------------------------------------------------------------------- 1 | const CGEXPRESS = require("./v2/config/express.json") 2 | const FNPRINT = require("./v2/functions/print") 3 | const FNWEB = require("./v2/functions/webhooks") 4 | const cluster = require('cluster'); 5 | const numCPUs = require('os').cpus().length; 6 | 7 | if (cluster.isMaster) { 8 | require("./security/mariadblog.js"); 9 | for (var i = 0; i < numCPUs; i++) { 10 | cluster.fork(); 11 | } 12 | Object.keys(cluster.workers).forEach(async(id) => { 13 | await FNWEB.SendSystemStart(cluster.workers[id].process.pid) 14 | FNPRINT.sPrint("CLUSTER: ( " + cluster.workers[id].process.pid + " ) STARTED"); 15 | }); 16 | 17 | cluster.on('exit', function(worker, code, signal) { 18 | FNPRINT.ePrint('CLUSTER ( ' + worker.process.pid + ' ) DIED'); 19 | }); 20 | } else { 21 | require("./index.js"); 22 | } 23 | 24 | process.on('unhandledRejection', (reason, p) => { 25 | FNPRINT.ePrint(`unhandledRejection | ${reason} -x[] ${JSON.stringify(p)}`); 26 | }) 27 | 28 | process.on('uncaughtException', err => { 29 | FNPRINT.ePrint(`uncaughtException | ${err}`); 30 | }); -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/index.js: -------------------------------------------------------------------------------- 1 | const express = require('express') 2 | const rateLimit = require('express-rate-limit') 3 | const app = express() 4 | const CGEXPRESS = require("./v2/config/express.json") 5 | const FNPRINT = require("./v2/functions/print") 6 | const fs = require("fs") 7 | const limiter = rateLimit({ 8 | skip: (request, response) => CGEXPRESS.RateLimitWhitelist.includes(CGEXPRESS.RateLimitWhitelist), 9 | windowMs: 5 * 60 * CGEXPRESS.RateLimitMS, 10 | max: 15, 11 | message: '{"error":"Too Many Requests Sent To This IP, Please Try Again In 1 Minute"}', 12 | standardHeaders: true, 13 | legacyHeaders: false, 14 | }) 15 | 16 | var morgan = require('morgan') 17 | var accessLogStream = fs.createWriteStream("./security/Logs/connections.log", { flags: 'a' }) 18 | 19 | 20 | app.use(morgan('\n\n------------------\nAt (:date[iso])\nIP (:req[cf-connecting-ip])\nMethod (:method)\nStatus (:status)\nPing (:response-time[3]/:total-time[3])\nURL https://essafuscator.net:url \n', { stream: accessLogStream })) 21 | app.use(limiter) 22 | app.use(express.json({ limit: CGEXPRESS.Filelimit })); 23 | 24 | var obfuscationroute = require("./v2/routes/obfuscate"); 25 | var statusroute = require("./v2/routes/status"); 26 | var datatableroute = require("./v2/routes/epdatatable") 27 | var downloadroute = require("./v2/routes/download") 28 | var inforoute = require("./v2/routes/inforoute") 29 | app.use("/v2/obfuscate", obfuscationroute) 30 | app.use("/v2/status", statusroute) 31 | app.use("/v2/epdatatable", datatableroute) 32 | app.use("/cdn", downloadroute) 33 | app.use("/v2", inforoute) 34 | app.use("/", inforoute) 35 | 36 | app.listen(CGEXPRESS.Port, async () => { 37 | FNPRINT.iPrint(`Started On Port ${CGEXPRESS.Port}`) 38 | }) 39 | 40 | process.on('unhandledRejection', (reason, p) => { 41 | FNPRINT.ePrint(`unhandledRejection | ${reason} -x[] ${JSON.stringify(p)}`); 42 | }) 43 | 44 | process.on('uncaughtException', err => { 45 | FNPRINT.ePrint(`uncaughtException | ${err}`); 46 | }); -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "colors": "^1.4.0", 4 | "express": "^4.18.1", 5 | "express-rate-limit": "^6.4.0", 6 | "form-data": "^4.0.0", 7 | "fs-extra": "^10.1.0", 8 | "knex": "^2.0.0", 9 | "knex-mariadb": "^2.0.0", 10 | "morgan": "^1.10.0", 11 | "mysqldump": "^3.2.0", 12 | "node-fetch": "^3.2.4", 13 | "node-os-utils": "^1.3.6", 14 | "nthline": "^1.0.2" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/security/Logs/connections.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorAPIRestructered/security/Logs/connections.log -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/security/mariadblog.js: -------------------------------------------------------------------------------- 1 | const FNPRINT = require("../v2/functions/print");; 2 | const FNWEBHOOKS = require("../v2/functions/webhooks") 3 | const CNMARIA = require("../v2/config/mariadb.json"); 4 | const mysqldump = require('mysqldump'); 5 | 6 | 7 | (async function() { 8 | FNPRINT.sPrint('MariaDB Backup Started') 9 | const currtime = Math.floor(new Date().getTime() / 1000) 10 | const name = `./security/SQLBackups/EssaFuscatorSQLAuto-${currtime}.sql` 11 | const webhookname = `EFSQL-${currtime}.sql` 12 | await mysqldump({ 13 | connection: { 14 | host: CNMARIA.host, 15 | user: CNMARIA.user, 16 | password: CNMARIA.password, 17 | database: CNMARIA.database, 18 | }, 19 | dumpToFile: name, 20 | }); 21 | 22 | await FNWEBHOOKS.SendSQLBackup(webhookname,name,currtime); 23 | 24 | FNPRINT.sPrint('MariaDB Backup Sent') 25 | setTimeout(arguments.callee, 32400000); // 9 Hours 26 | })(); 27 | -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/starter.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | node cluster.js 3 | PAUSE -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/v2/config/express.json: -------------------------------------------------------------------------------- 1 | { 2 | "Port":80, 3 | "Filelimit":"15mb", 4 | "RateLimitMS":1000, 5 | "RateLimitWhitelist": [ 6 | "VPS.IP.FROM.HOST" 7 | ] 8 | } -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/v2/config/info.json: -------------------------------------------------------------------------------- 1 | { 2 | "PCPATH": "C:/Users/Administrator/Desktop/EssaFuscatorAPIRestructered/" 3 | } -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/v2/config/mariadb.json: -------------------------------------------------------------------------------- 1 | { 2 | "host": "127.0.0.1", 3 | "port": 3306, 4 | "user": "root", 5 | "password": "4H9YNdAZkAwcekZVel505RAYasa6OcfHHCiX0YFBy3bqfqYY", 6 | "database": "scripts" 7 | } -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/v2/config/webhooks.json: -------------------------------------------------------------------------------- 1 | { 2 | "SuccessWebhook":"", 3 | "StatusWebhook":"", 4 | "SystemStarts":"", 5 | "SQLBackup":"" 6 | } -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/v2/controllers/download.js: -------------------------------------------------------------------------------- 1 | const FNPRINT = require("../functions/print") 2 | const FNMARIA = require("../functions/mariadb") 3 | const fs = require("fs"); 4 | 5 | const GetFile = async(req, res, next) => { 6 | if (!req.params.userid) return res.status(400).end(JSON.stringify({ 7 | error: "You Didin't Specify The ID" 8 | })); 9 | if (!req.params.userhash) return res.status(400).end(JSON.stringify({ 10 | error: "You Didin't Specify The Unique File Hash" 11 | })); 12 | if ((req.params.userhash).length != 64 ) return res.status(400).end(JSON.stringify({ 13 | error: "Invalid Hash Structure" 14 | })); 15 | if (!req.params.realname) return res.status(400).end(JSON.stringify({ 16 | error: "You Didin't Specify The File" 17 | })); 18 | var UserID = req.params.userid 19 | var UserHash = req.params.userhash 20 | var RealName = req.params.realname 21 | 22 | await FNMARIA.ValidateDownload(UserID,UserHash,RealName,async(status) => { 23 | if (status == "GOOD") { 24 | await fs.readFile(`./Obfuscator/CDN/${UserHash}-${RealName}`,"utf8",async(err,tosend) => { 25 | if (err) { 26 | return res.status(400).end(JSON.stringify({ 27 | error: "FS"+ err 28 | })) 29 | } 30 | if (req.query.json == "false") { 31 | res.setHeader('Content-disposition', `attachment; filename=EssaFuscatorCDN-${UserHash}.lua`); 32 | res.download(`./Obfuscator/CDN/${UserHash}-${RealName}`) 33 | return res.status(200).end(tosend); 34 | }else{ 35 | return res.status(200).end(JSON.stringify({ 36 | File: tosend 37 | })); 38 | } 39 | 40 | }) 41 | }else if(status == "EXPIRED"){ 42 | return res.status(400).end(JSON.stringify({ 43 | error: "The File Expired" 44 | })); 45 | }else if(status == "UNKNOWN"){ 46 | return res.status(400).end(JSON.stringify({ 47 | error: "The File Was Not Found" 48 | })); 49 | } 50 | }) 51 | }; 52 | 53 | module.exports = {GetFile}; 54 | FNPRINT.iPrint("Started Download Controller") 55 | -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/v2/controllers/epdatatable.js: -------------------------------------------------------------------------------- 1 | const FNWEB = require("../functions/webhooks") 2 | const FNPRINT = require("../functions/print") 3 | const FNMARIA = require("../functions/mariadb") 4 | 5 | const EPSender = async(req, res, next) => { 6 | await FNMARIA.GetObfuscationCount(async(count) => { 7 | res.status(200).end(JSON.stringify({ 8 | obfuscations: String(count), databaseping: String(Math.floor(Math.random() * (9 - 1 + 1) + 1)+"ms") 9 | })); 10 | }); 11 | 12 | }; 13 | 14 | module.exports = {EPSender}; 15 | FNPRINT.iPrint("Started DataTable Controller") 16 | -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/v2/controllers/inforoute.js: -------------------------------------------------------------------------------- 1 | const FNPRINT = require("../functions/print") 2 | const cluster = require('cluster'); 3 | 4 | 5 | const InfoControl = async(req, res, next) => { 6 | var currentcluster = "" 7 | if (cluster.isMaster) { 8 | currentcluster = "EF_MAIN" 9 | } else if (cluster.isWorker) { 10 | currentcluster = "EF_CLUSTER-" + cluster.worker.id; 11 | } 12 | 13 | res.status(200).end(JSON.stringify({ 14 | version:"EF_2.7.A", 15 | apiversion:"EF_API_V2", 16 | discord:"https://discord.gg/obfuscate", 17 | developer:"! EssaPrime#0001", 18 | currentserver:currentcluster 19 | })); 20 | }; 21 | 22 | module.exports = {InfoControl}; 23 | FNPRINT.iPrint("Started Info Controller") 24 | -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/v2/controllers/status.js: -------------------------------------------------------------------------------- 1 | const FNWEB = require("../functions/webhooks") 2 | const FNPRINT = require("../functions/print") 3 | 4 | const STATControl = async(req, res, next) => { 5 | await FNWEB.SendStatusMessage(req.headers['cf-connecting-ip']); 6 | res.status(200).end(JSON.stringify({ 7 | status: "OK" 8 | })); 9 | }; 10 | 11 | module.exports = {STATControl}; 12 | FNPRINT.iPrint("Started Status Controller") 13 | -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/v2/functions/filesystem.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const fsExtra = require('fs-extra') 3 | const CGINFO = require("../config/info.json") 4 | 5 | module.exports = { 6 | 7 | DeleteSource: async function(path) { 8 | try { fs.unlinkSync(`${CGINFO.PCPATH}/out.lua`) }catch(e){} 9 | try { fs.unlinkSync(`${CGINFO.PCPATH}/Obfuscator/${path}`) }catch(e){} 10 | try { fsExtra.emptyDirSync(`${CGINFO.PCPATH}/Obfuscator/files/`) }catch(e){} 11 | }, 12 | 13 | } -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/v2/functions/mariadb.js: -------------------------------------------------------------------------------- 1 | const CGMARIA = require("../config/mariadb.json") 2 | const mdb = require('knex-mariadb'); 3 | const fs = require("fs"); 4 | const knex = require('knex')({ 5 | client: mdb, 6 | connection: { 7 | host: CGMARIA.host, 8 | port: CGMARIA.port, 9 | user: CGMARIA.user, 10 | password: CGMARIA.password, 11 | database: CGMARIA.database 12 | } 13 | }); 14 | module.exports = { 15 | 16 | InsertNewScript: async function(scriptid, userid, error) { 17 | await knex('owners').insert({ 18 | script_id: scriptid, 19 | user_id: userid, 20 | date: "V2Obfuscation", 21 | epoch: Math.floor(new Date().getTime() / 1000) 22 | }) 23 | .then(async (created) => { 24 | if (!created) { 25 | error("SQL Insert Error") 26 | }else{ 27 | error(null) 28 | } 29 | }); 30 | }, 31 | 32 | CheckAPIKey: async function(apikey, valid) { 33 | await knex.select().from('keys').where('sha512', apikey).then(async (data) => { 34 | if (Object.keys(data).length > 0) { 35 | valid(data[0].user_id) 36 | }else{ 37 | valid(false) 38 | } 39 | }); 40 | }, 41 | 42 | GetObfuscationCount: async function(cb) { 43 | await knex('owners').count('user_id').then((res)=>{ 44 | cb(res[0]["count(`user_id`)"]) 45 | }) 46 | }, 47 | 48 | ValidateDownload: async function(userid,userhash,filename,status) { 49 | await knex.select().from('downloadlinks').where('userid', userid).where('userhash', userhash).where('realname', filename).then(async (data) => { 50 | if (Object.keys(data).length > 0) { 51 | await knex("downloadlinks").where('userid', userid).where('userhash', userhash).where('realname', filename).update({timesopened: data[0].timesopened + 1}) 52 | if (data[0].timesopened <= 4) { 53 | status("GOOD"); 54 | }else{ 55 | status("EXPIRED"); 56 | } 57 | }else{ 58 | status("UNKNOWN") 59 | } 60 | }); 61 | }, 62 | 63 | AddToCDN: async function(code,userid,userhash,success) { 64 | var filehashe = (Math.random() + 1).toString(36).substring(7); 65 | const fullname = `${userhash}-${filehashe}.lua` 66 | await fs.writeFileSync(`./Obfuscator/CDN/${fullname}`, code) 67 | await knex('downloadlinks').insert({ 68 | userid: userid, 69 | userhash: userhash, 70 | realname: `${filehashe}.lua`, 71 | epoch: Math.floor(new Date().getTime() / 1000), 72 | timesopened: 0, 73 | }).then(async (created) => { 74 | if (created) { 75 | success({url:`https://api.essafuscator.net/cdn/${userid}/${userhash}/${filehashe}.lua?json=true`}) 76 | }else{ 77 | success({error: "SQL Insert Error At CDN"}) 78 | } 79 | }); 80 | } 81 | } -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/v2/functions/obfuscation.js: -------------------------------------------------------------------------------- 1 | const {exec} = require('child_process'); 2 | const nthline = require('nthline') 3 | const CGINFO = require("../config/info.json") 4 | const fs = require('fs') 5 | module.exports = { 6 | 7 | Obfuscate: async function(path, watermark,encrpytiontype,output) { 8 | await exec(`"${CGINFO.PCPATH}/Obfuscator/master/EssaFuscator CLI.exe" "${CGINFO.PCPATH}/Obfuscator/${path}" "${watermark.toString()}" true ${encrpytiontype}`, async (err, stdout, stderr) => { 9 | if (err) { 10 | output("EF_ERROR: " + stdout+ String(err) ) 11 | }else if (String(stdout).includes("ERR: ")) { 12 | var errortoret = stdout.split("\n")[5].replace(`...ctered//Obfuscator/${path}`,"").replace("ERR: ", "") 13 | output("EF_ERROR: " +`temp.lua${errortoret}`) 14 | }else if (stderr) { 15 | output("EF_ERROR: " + stderr) 16 | }else if(stdout){ 17 | output(stdout) 18 | }; 19 | }); 20 | }, 21 | 22 | GetScriptID: async function(output) { 23 | await fs.readFile(`${CGINFO.PCPATH}/out.lua`, 'utf-8', async (err, data) => { 24 | if (!err) { 25 | await nthline(4, `${CGINFO.PCPATH}/out.lua`).then(async (line) => { 26 | const cleanid = line.replace("Script ID:", "").replace(/\s+/g, ' ').trim() 27 | output({ID: cleanid, file: data}) 28 | }); 29 | }else{ 30 | output({error:err}) 31 | }; 32 | }); 33 | }, 34 | 35 | } -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/v2/functions/print.js: -------------------------------------------------------------------------------- 1 | const color = require("colors"); 2 | 3 | 4 | module.exports = { 5 | sPrint: function(message) { 6 | return console.log(color.green(`> [Obfuscation Success] - {${formatDate(new Date())}} =>> `, color.brightGreen(`[${message}]\n`))) 7 | }, 8 | ePrint: function(message) { 9 | return console.log(color.red(`> [Error] - {${formatDate(new Date())}} =>> `, color.brightRed(`[${message}]\n`))) 10 | }, 11 | iPrint: function(message) { 12 | return console.log(color.green(`> [System] - {${formatDate(new Date())}} =>> `, color.brightMagenta(`[${message}]\n`))) 13 | }, 14 | } 15 | 16 | function padTo2Digits(num) { 17 | return num.toString().padStart(2, '0'); 18 | } 19 | 20 | function formatDate(date) { 21 | return ( 22 | [ 23 | date.getFullYear(), 24 | padTo2Digits(date.getMonth() + 1), 25 | padTo2Digits(date.getDate()), 26 | ].join('-') + 27 | ' ' + 28 | [ 29 | padTo2Digits(date.getHours()), 30 | padTo2Digits(date.getMinutes()), 31 | padTo2Digits(date.getSeconds()), 32 | ].join(':') 33 | ); 34 | } 35 | -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/v2/routes/download.js: -------------------------------------------------------------------------------- 1 | const CNDOWNLOAD = require('../controllers/download'); 2 | const FNPRINT = require("../functions/print") 3 | const express = require("express") 4 | router = express.Router(); 5 | 6 | router.get("/:userid?/:userhash?/:realname?", CNDOWNLOAD.GetFile); 7 | 8 | module.exports = router; 9 | FNPRINT.iPrint("Started Download Route") 10 | -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/v2/routes/epdatatable.js: -------------------------------------------------------------------------------- 1 | const CNEPDATA = require('../controllers/epdatatable'); 2 | const FNPRINT = require("../functions/print") 3 | const express = require("express") 4 | router = express.Router(); 5 | 6 | router.get("/", CNEPDATA.EPSender); 7 | 8 | module.exports = router; 9 | FNPRINT.iPrint("Started DataTable Route") 10 | -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/v2/routes/inforoute.js: -------------------------------------------------------------------------------- 1 | const CNINFO = require('../controllers/inforoute'); 2 | const FNPRINT = require("../functions/print") 3 | const express = require("express") 4 | router = express.Router(); 5 | 6 | router.all("/", CNINFO.InfoControl); 7 | 8 | module.exports = router; 9 | FNPRINT.iPrint("Started Info Route") 10 | -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/v2/routes/obfuscate.js: -------------------------------------------------------------------------------- 1 | const CNOBF = require('../controllers/obfuscate'); 2 | const FNPRINT = require("../functions/print") 3 | const express = require("express") 4 | router = express.Router(); 5 | 6 | router.post("/:enctype?", CNOBF.OBFControl); 7 | 8 | module.exports = router; 9 | FNPRINT.iPrint("Started Obfuscation Route") 10 | -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/v2/routes/status.js: -------------------------------------------------------------------------------- 1 | const CNSTATUS = require('../controllers/status'); 2 | const FNPRINT = require("../functions/print") 3 | const express = require("express") 4 | router = express.Router(); 5 | 6 | router.get("/", CNSTATUS.STATControl); 7 | 8 | module.exports = router; 9 | FNPRINT.iPrint("Started Status Route") -------------------------------------------------------------------------------- /EssaFuscatorAPIRestructered/v2/routes/validateapi.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorAPIRestructered/v2/routes/validateapi.js -------------------------------------------------------------------------------- /EssaFuscatorBot/commands/help.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder } = require('@discordjs/builders'); 2 | const Discord = require("discord.js") 3 | module.exports = { 4 | data: new SlashCommandBuilder() 5 | .setName('help') 6 | .setDescription('To View The Help Commands | اوامر المساعدة'), 7 | async execute(interaction) { 8 | const embed = new Discord.MessageEmbed() 9 | .setColor('PURPLE') 10 | .setTitle('EssaFuscatorBot V2 | Help Panel') 11 | .setURL('https://discord.gg/obfuscate') 12 | .setDescription('Listed Below Are All The Help Commands\nفي الاسفل جميع اوامر البوت') 13 | .addFields( 14 | { name: '> Obfuscate', value: '`/obfuscate`: To Obfuscate A Script | لتشفير سكربت' }, 15 | { name: '> Create A Key', value: '`/createkey`: To Create An API Key | لصنع رمز اي بي اي (API Key)' }, 16 | { name: '> Find Your Key', value: '`/mykey`: To Find Your API Key | لمعرفة الكي الخاص بك' }, 17 | { name: '> Find A Script Owner', value: '`/scriptfinder`: To Search For A Script\'s ID | لمعرفة صاحب الملف عن طريق الايدي الخاص بلملف المشفر'}, 18 | ) 19 | .setTimestamp() 20 | .setFooter({ text: 'EssaFuscatorBot V2 | Coded By ! EssaPrime#0001 >> EssaFuscator', iconURL: 'https://cdn.discordapp.com/avatars/773427936031408139/26a8608f15b554789a2abaa92947d9cc.png?size=1024' }); 21 | await interaction.reply({content:"Help Message Below", embeds:[embed]}); 22 | }, 23 | }; -------------------------------------------------------------------------------- /EssaFuscatorBot/commands/mykey.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder } = require('@discordjs/builders'); 2 | const Discord = require('discord.js'); 3 | 4 | const mdb = require('knex-mariadb'); 5 | const Functions = require('../modules/functions'); 6 | const knex = require('knex')({ 7 | client: mdb, 8 | connection: { 9 | host: '127.0.0.1', 10 | port: 3306, 11 | user: 'root', 12 | password: '4H9YNdAZkAwcekZVel505RAYasa6OcfHHCiX0YFBy3bqfqYY', 13 | database: 'scripts' 14 | } 15 | }); 16 | module.exports = { 17 | data: new SlashCommandBuilder() 18 | .setName('mykey') 19 | .setDescription('To Get Your API Key | لمعرفة رمز الاي بي اي الخاص بك'), 20 | async execute(interaction) { 21 | await interaction.deferReply(); 22 | knex.select() 23 | .from("keys") 24 | .where("user_id", interaction.user.id) 25 | .then(userNametList => { 26 | if (userNametList.length === 0) { 27 | interaction.editReply({ 28 | embeds: [Functions.CreateEmbed('EssaFuscator API Key', "> **You Don't Have A API Key**\n**Generate One Using The `!essafus` Command Menu!**", 'RED')], 29 | ephemeral: true 30 | }) 31 | }else{ 32 | knex.select().from('keys').where('user_id', interaction.user.id).then(async(data) => { 33 | if (Object.keys(data).length > 0) { 34 | console.log(data) 35 | var apikeyy = data[0].sha512 36 | var owner = data[0].user_id 37 | var dateandtuime = data[0].datecreated 38 | const sdsdsdembed = new Discord.MessageEmbed() 39 | .setColor('#0099ff') 40 | .setTitle('EssaFuscator Menu!') 41 | .setAuthor(`${interaction.user.username}#${interaction.user.discriminator}`, `${interaction.user.displayAvatarURL()}`) 42 | .setDescription('EssaFuscator API Key Info!') 43 | .addFields( 44 | { name: 'Key Owner', value: `<@${owner}>`, inline: true }, 45 | { name: 'Date Created', value: dateandtuime, inline: true }, 46 | { name: 'API KEY', value: '||'+ apikeyy+'|| ', inline: false }, 47 | ); 48 | if (interaction.channel.type == "DM") { 49 | interaction.editReply({embeds: [sdsdsdembed]}) 50 | }else{ 51 | interaction.user.send({embeds: [sdsdsdembed]}) 52 | interaction.editReply({content: "Look At Your DM's | شوف الخاص", ephemeral: true}) 53 | } 54 | } 55 | }); 56 | } 57 | return; 58 | }); 59 | }, 60 | }; -------------------------------------------------------------------------------- /EssaFuscatorBot/commands/scriptfinder.js: -------------------------------------------------------------------------------- 1 | const{ SlashCommandBuilder } = require('@discordjs/builders'); 2 | const discordjsModal = require('discordjs-modal'); 3 | 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName('scriptfinder') 8 | .setDescription('To Find The Script Owner | لمعرفة صاحب ملف مشفر'), 9 | async execute(interaction) { 10 | //await interaction.deferReply(); 11 | const modal = new discordjsModal.Modal() 12 | .setCustomId("modal-scriptowner") 13 | .setTitle("بحث صاحب السكربت \n Script Owner Finder!") 14 | .addComponents( 15 | new discordjsModal.TextInput() 16 | .setLabel("الايدي | Script ID") 17 | .setStyle("SHORT") 18 | .setPlaceholder("اكتب الايدي هنا | Type The Script ID Here") 19 | .setCustomId("kalam-inputmodal") 20 | .setMinLength(14) 21 | .setMaxLength(22) 22 | .setRequired(true) 23 | ) 24 | interaction.client.modal.send(interaction, modal) 25 | }, 26 | }; -------------------------------------------------------------------------------- /EssaFuscatorBot/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "Client_ID": "", 3 | "Guild_ID": "", 4 | "token": "" 5 | } -------------------------------------------------------------------------------- /EssaFuscatorBot/events/interactionCreate.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'interactionCreate', 3 | async execute(interaction) { 4 | if (!interaction.isCommand()) return; 5 | const command = interaction.client.commands.get(interaction.commandName); 6 | if (!command) return; 7 | try { 8 | await command.execute(interaction); 9 | } catch (error) { 10 | console.error(error); 11 | await interaction.reply({ content: 'EssaFuscator -> Error During Command Execution', ephemeral: true }); 12 | } 13 | }, 14 | }; -------------------------------------------------------------------------------- /EssaFuscatorBot/events/modal.js: -------------------------------------------------------------------------------- 1 | const Functions = require('../modules/functions'); 2 | const Discord = require('discord.js'); 3 | const { REST } = require('@discordjs/rest'); 4 | const { Routes } = require('discord-api-types/v9'); 5 | const config = require("../config.json") 6 | const rest = new REST({ version: '9' }).setToken(config.token); 7 | 8 | const mdb = require('knex-mariadb'); 9 | const knex = require('knex')({ 10 | client: mdb, 11 | connection: { 12 | host: '127.0.0.1', 13 | port: 3306, 14 | user: 'root', 15 | password: '4H9YNdAZkAwcekZVel505RAYasa6OcfHHCiX0YFBy3bqfqYY', 16 | database: 'scripts' 17 | } 18 | }); 19 | 20 | module.exports = { 21 | name: 'modal', 22 | async execute(modal) { 23 | if(modal.customId === 'modal-scriptowner'){ 24 | await modal.deferReply() 25 | const firstResponse = modal.fields[0].value 26 | knex.select().from('owners').where('script_id', firstResponse).then(async(data) => { 27 | if (Object.keys(data).length > 0) { 28 | console.log(data) 29 | var scriptdate; 30 | if (data[0].date == "V2Obfuscation") { 31 | scriptdate =` | ` 32 | }else{ 33 | scriptdate = data[0].date 34 | } 35 | var userinfo = await rest.get(Routes.user(data[0].user_id)) 36 | var username = `${userinfo.username}#${userinfo.discriminator}` 37 | var scriptowner = data[0].user_id 38 | var scriptkey = data[0].script_id 39 | 40 | const sdsdsdembed = new Discord.MessageEmbed() 41 | .setColor('#0099ff') 42 | .setTitle('EssaFuscator Script Owner Finder!') 43 | .setAuthor(`${modal.user.username}`, `${modal.user.displayAvatarURL()}`) 44 | .setDescription('EssaFuscator Script Owner Finder!') 45 | .addFields( 46 | { name: 'Script Owner', value: `<@${scriptowner}>`, inline: true }, 47 | { name: 'Date Created', value: scriptdate, inline: true }, 48 | { name: 'Script Owner Username', value: `${username}`, inline: true }, 49 | { name: 'Script ID', value: scriptkey, inline: false }, 50 | ); 51 | modal.editReply({ 52 | embeds: [sdsdsdembed], 53 | }) 54 | }else{ 55 | modal.editReply({ 56 | embeds: [Functions.CreateEmbed('EssaFuscator Script Owner Finder', "> **Owner Not Found**\n> **The File Is Most Likely Old Or The ID Doesn't Exist!**", 'YELLOW')], 57 | }) 58 | } 59 | }) 60 | } 61 | }, 62 | }; -------------------------------------------------------------------------------- /EssaFuscatorBot/events/ready.js: -------------------------------------------------------------------------------- 1 | const { REST } = require('@discordjs/rest'); 2 | const { Routes } = require('discord-api-types/v9'); 3 | const Functions = require('../modules/functions'); 4 | const fs = require("fs"); 5 | const { token,Client_ID , Guild_ID} = require('../config.json'); 6 | const Colors = require('colors'); 7 | 8 | module.exports = { 9 | name: 'ready', 10 | once: false, 11 | async execute(client) { 12 | Functions.Print(`[${Colors.green('Discord')}] Hello World! I'm logged in as ${Colors.green(client.user.tag)}`); 13 | client.user.setActivity("EssaFuscator | /help" ,{type:"COMPETING",}) 14 | const commands = []; 15 | const commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith('.js')); 16 | const clientId = Client_ID; 17 | const rest = new REST({ version: '9' }).setToken(token); 18 | for (const file of commandFiles) { 19 | const command = require(`../commands/${file}`); 20 | commands.push(command.data.toJSON()); 21 | } 22 | (async () => { 23 | try { 24 | await rest.put(Routes.applicationCommands(clientId), 25 | { body: commands }, 26 | ); 27 | } catch(error) { 28 | Functions.ErrorHandler("Rest Command PUT Error", `${error}`,true,__filename, "968825152672509952", "5Elfm3ODJxCHDpBn3Cryk4TLG8IeV6c6JDvrSjU3sCIw-qQOcedHampJ71yGX7x4h_lH") 29 | console.log(error); 30 | } 31 | })(); 32 | }, 33 | }; -------------------------------------------------------------------------------- /EssaFuscatorBot/index.js: -------------------------------------------------------------------------------- 1 | const Discord= require('discord.js'); 2 | const client = new Discord.Client({ intents: ["GUILDS", "GUILD_MESSAGES", "DIRECT_MESSAGES", "GUILD_MEMBERS", "GUILD_EMOJIS_AND_STICKERS", "GUILD_MESSAGE_REACTIONS", "GUILD_MESSAGE_TYPING"], partials: ['MESSAGE',"CHANNEL"] }); 3 | 4 | 5 | const discordjsModal = require('discordjs-modal'); 6 | discordjsModal(client); 7 | 8 | const Colors = require('colors'); 9 | const Functions = require('./modules/functions'); 10 | const fs = require("fs"); 11 | const { token,Client_ID , Guild_ID} = require('./config.json'); 12 | 13 | client.commands = new Discord.Collection() 14 | 15 | ///////////////////////// 16 | 17 | const commandFolder = fs.readdirSync( './commands' ).filter( x => x.endsWith( '.js' ) ) 18 | for (const file of commandFolder) { 19 | const command = require(`./commands/${file}`); 20 | client.commands.set(command.data.name, command); 21 | } 22 | 23 | const eventFiles = fs.readdirSync('./events').filter(file => file.endsWith('.js')); 24 | 25 | for (const file of eventFiles) { 26 | const event = require(`./events/${file}`); 27 | if (event.once) { 28 | client.once(event.name, (...args) => event.execute(...args)); 29 | } else { 30 | client.on(event.name, (...args) => event.execute(...args)); 31 | } 32 | } 33 | 34 | ///////////////////////// 35 | 36 | process.on('unhandledRejection', (reason, p) => { 37 | console.error(reason, 'Unhandled Rejection at Promise', p); 38 | Functions.ErrorHandler("unhandledRejection", `${reason} Unhandled Rejection At Promise ${p}`,false,__filename, "968824422590976041", "W5Bll36OrHqm7_JgC3rWKAOK2fMiyarc0c7TGUB7qrw-MYr1GgZXQXLaBoJfmvUiMk2n") 39 | }) 40 | process.on('uncaughtException', err => { 41 | console.error(err, 'Uncaught Exception thrown'); 42 | Functions.ErrorHandler("uncaughtException", `${err} Uncaught Exception thrown`,true,__filename, "968824614098722856", "D2lA0bRcL_jaV6BUjqat4dJlknWzpg7S4yn6cF_haDrvPl1dh3S94Ss9ym23Eo2SPyqE") 43 | 44 | }); 45 | 46 | client.login(token).catch((error) => { 47 | console.log(`[${Colors.red('Discord')}] Unable to connect with <${Colors.red('Discord')}>`); 48 | console.log(`[${Colors.red('Discord')}] ${error.message ? error.message : error}`); 49 | Functions.ErrorHandler("Login Error", `${error.message ? error.message : error}`,true,__filename, "968824792855769128", "pFt8LG0Bz3NTkg526IKqQwd_1f98giSKsM-dC_t6Ht8k3pUgzQzKlqCRvpLusi_jNZP1") 50 | 51 | }); 52 | -------------------------------------------------------------------------------- /EssaFuscatorBot/modules/functions.js: -------------------------------------------------------------------------------- 1 | const Colors = require('colors'); 2 | const { WebhookClient,MessageEmbed } = require('discord.js'); 3 | 4 | module.exports = { 5 | Print: (text) => { 6 | var newTime = new Date().toLocaleTimeString(); 7 | 8 | console.log(`[${Colors.green(newTime)}] : ${text}`); 9 | }, 10 | 11 | CreateEmbed: (title, description,color) => { 12 | let embed = new MessageEmbed(); 13 | 14 | embed.setAuthor("EssaFuscator System V2", "https://cdn.discordapp.com/avatars/773427936031408139/c2d58619653c4d0e47882fc3b74a4139.png?size=128"); 15 | 16 | if (title !== 'none') { 17 | embed.setTitle(title); 18 | }; 19 | 20 | if (description !== 'none') { 21 | embed.setDescription(description); 22 | }; 23 | 24 | if (color !== 'none') { 25 | embed.setColor(color); 26 | }; 27 | 28 | embed.setTimestamp(); 29 | embed.setFooter('Coded By EssaPrime, Bot Version: V2', "https://tools.essaprime.xyz/discordavatar/217353461933670403"); 30 | 31 | return embed; 32 | }, 33 | 34 | ErrorHandler: (ErrorTitle, ErrorDesc,MentionAll,FileName, wid, wtoken) => { 35 | const webhookClient = new WebhookClient({ id: wid, token: wtoken }); 36 | const embed = new MessageEmbed() 37 | .setTitle(ErrorTitle) 38 | .setColor('#F30C0C') 39 | .setDescription(`** Error Description: ** \n \`\`\`fix\n${ErrorDesc}\n \`\`\` `) 40 | .addFields( 41 | {name:"Error Time: ", value:`> | `}, 42 | {name:"Error File: ", value:`> ${FileName}`} 43 | ) 44 | .setTimestamp() 45 | .setFooter({ text: 'Error Compressed', iconURL: 'https://cdn.discordapp.com/avatars/773427936031408139/26a8608f15b554789a2abaa92947d9cc.png?size=1024' }); 46 | 47 | content = "X" 48 | if (!MentionAll) { 49 | content = "EssaPrime Security System" 50 | }else{ 51 | content = "@everyone | @here > DANGEROUS ERROR" 52 | } 53 | webhookClient.send({ 54 | content: content, 55 | username: 'EssaPrime Error Logger', 56 | avatarURL: 'https://media.discordapp.net/attachments/720494690121809923/968818526141960192/IMG-7116.JPG?width=676&height=676', 57 | embeds: [embed], 58 | }); 59 | return embed 60 | } 61 | }; -------------------------------------------------------------------------------- /EssaFuscatorBot/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "@discordjs/rest": "^0.4.1", 4 | "colors": "^1.4.0", 5 | "discord.js": "^13.8.1", 6 | "discordjs-modal": "^1.0.10", 7 | "knex": "^2.0.0", 8 | "knex-mariadb": "^2.0.0", 9 | "md5": "^2.3.0" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /EssaFuscatorBot/start.cmd: -------------------------------------------------------------------------------- 1 | TITLE EssaFuscatorBotV2 2 | cls 3 | node index.js 4 | PAUSE -------------------------------------------------------------------------------- /EssaFuscatorBotDeployable/index.js: -------------------------------------------------------------------------------- 1 | // Deployable Version Of The EssaFuscator Bot | Written By ! EssaPrime#0001 -> Discord.js V12* 2 | const Discord = require('discord.js'); 3 | const client = new Discord.Client(); 4 | const fs = require('node:fs'); 5 | const fetch = (...args) => import("node-fetch").then(({ default: fetch }) => fetch(...args)); 6 | const {EssaFuscator} = require('essafuscator') 7 | 8 | /* 9 | طريقة الاستعمال: 10 | تكتب !obfuscate مع الملف المشفر 11 | */ 12 | 13 | const config = { 14 | bot: { // اعدادات البوت | Bot Settings 15 | bottoken: '', // توكن البوت | Bot Token 16 | prefix: '!', // برفكس البوت | Bot Prefix 17 | status: 'At discord.gg/obfuscate', // حالة البوت | Bot Status 18 | }, 19 | team: { 20 | fileprefix: 'Obfuscated-' // برفكس الملفات | File Prefix 21 | }, 22 | obfuscation: { 23 | apikey: '', // الكي حقك | API Key 24 | obfuscationskin: 'arabic', // شكل الملف المشفر | ByteCode Skin (arabic/emoji) 25 | watermark:'EssaFuscator On TOPPPPPPP' // الحقوق الي تطلع في الملف المشفر | Watermark 26 | } 27 | } 28 | 29 | const EFOBF = new EssaFuscator(config["obfuscation"]["apikey"]) 30 | 31 | 32 | client.on('ready', () => { 33 | client.user.setActivity(config["bot"]["status"], { 34 | type: "PLAYING", 35 | }) 36 | console.log(`[EssaPrime]: Logged in as ${client.user.tag}!`) 37 | }) 38 | 39 | client.on('message', async message => { 40 | if (message.author.bot || !message.content.startsWith(config["bot"]["prefix"])) return; 41 | const args = message.content.slice(config["bot"]["prefix"].length).trim().split(/ +/); 42 | const command = args.shift().toLowerCase(); 43 | if (command == "obfuscate") { 44 | message.channel.startTyping() 45 | if (message.attachments.size == 0) {message.channel.stopTyping();return message.reply("You have to upload a file")}; 46 | const {url,name} = message.attachments.first(); 47 | if (!name.endsWith('.lua')) {message.channel.stopTyping();return message.reply("The File Must End With .lua")}; 48 | const key = new Date().getTime(); 49 | const response = await fetch(url); 50 | const body = await response.text(); 51 | var filename = `files/obfprime-${key}-${name}`; 52 | EFOBF.obfuscate(body,config['obfuscation']["watermark"],config["obfuscation"]["obfuscationskin"],async(obffile) => { 53 | await fs.writeFile(filename, `${obffile}`, function(err) { 54 | if (err) throw err; 55 | const attachment = new Discord.MessageAttachment(filename, `${config["team"]["fileprefix"]}${name}`); 56 | message.channel.send(attachment) 57 | message.channel.stopTyping() 58 | }); 59 | }) 60 | } 61 | }) 62 | 63 | process.on('unhandledRejection', (reason, p) => { 64 | console.error(reason, 'Unhandled Rejection at Promise', p); 65 | }) 66 | 67 | client.login(config['bot']['bottoken']) -------------------------------------------------------------------------------- /EssaFuscatorBotDeployable/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "discord.js": "^12.5.3", 4 | "essafuscator": "^0.1.8" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /EssaFuscatorBotDeployable/starter.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | node index.js 3 | PAUSE -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/CLI/EssaFuscator.CLI.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | EssaFuscator_CLI 7 | latestmajor 8 | enable 9 | EssaFuscator.CLI 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/CLI/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Text; 4 | using EssaFuscator.Core; 5 | using EssaFuscator.Obfuscator; 6 | 7 | namespace EssaFuscator.CLI 8 | { 9 | internal static class Program { 10 | private static int[] charsetLengths = { 11 | 4, 12 | 2, 13 | 1 14 | }; 15 | 16 | private static string[][] charsets = new[] 17 | { 18 | new[] {"😇","😂","🤣","😍","🥰","😘","😱","🤩","🥳","🤬","🤯","😭","🧠","🤕","🤮","🥵" }, // emoji 19 | new[] {"ج","ئ","ض","س","ز","ق","ك","ن","ؠ","آ","د","ذ","ا","ء","ؤ","ر" }, //arabic 20 | new[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F" } // hex 21 | }; 22 | 23 | private static void Main(string[] args) 24 | { 25 | Console.Title = "EssaFuscator V2 API CLI "; 26 | Directory.CreateDirectory("temp"); 27 | Console.WriteLine("Starting."); 28 | 29 | 30 | var isAntiTamper = args.Length >= 2 && args[1] == "true"; 31 | var isUsingLocalProxifier = args.Length >= 3 && args[2] == "true"; 32 | var charsetIndex = args.Length >= 4 ? int.Parse(args[3]) : 2; 33 | 34 | var session = Obfuscation.Obfuscate("temp", args[0], args[1], new ObfuscationSettings(false, isUsingLocalProxifier), 35 | out var err); 36 | 37 | if (!session.Item1) 38 | { 39 | Console.WriteLine("ERR: " + err); 40 | return; 41 | } 42 | 43 | File.WriteAllText("temp/out.lua", @$"--[=[ 44 | EssaFuscator ( Private ) 45 | discord.gg/essa | ! EssaPrime#0001 46 | Obfuscated At: {DateTime.Now:yyyy-MM-dd h:mm:ss tt} 47 | Script ID: EssaFuscator_{Obfuscation.EssaFingerprint} 48 | --]=] 49 | 50 | {session.Item2}"); 51 | 52 | if (isAntiTamper) { 53 | Console.WriteLine("Anti Tamper Activating"); 54 | var scr = File.ReadAllText("temp/out.lua"); 55 | //$"EssaFuscator_{Obfuscation.EssaFingerprint}", $"{args[1]}" 56 | File.WriteAllText("temp/out.lua", Obfuscator.Encryption.AdvancedAntiTamper.GetLoader(scr, charsets[charsetIndex], charsetLengths[charsetIndex]), Encoding.UTF8); 57 | return; 58 | } 59 | 60 | Console.WriteLine("Done!"); 61 | } 62 | } 63 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/LuaCompiler-O.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/LuaCompiler-O.dll -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/LuaCompiler-O.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/LuaCompiler-O.exp -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/LuaCompiler-O.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/LuaCompiler-O.lib -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/LuaCompiler-O.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/LuaCompiler-O.pdb -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/Emulation/LuaCompiler-O.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/Emulation/LuaCompiler-O.dll -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/Emulation/LuaCompiler-O.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/Emulation/LuaCompiler-O.exp -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/Emulation/LuaCompiler-O.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/Emulation/LuaCompiler-O.lib -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/Emulation/LuaCompiler-O.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/Emulation/LuaCompiler-O.pdb -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/EssaFuscator.CLI.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/EssaFuscator.CLI.dll -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/EssaFuscator.CLI.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/EssaFuscator.CLI.exe -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/EssaFuscator.CLI.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/EssaFuscator.CLI.pdb -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/EssaFuscator.CLI.runtimeconfig.dev.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeOptions": { 3 | "additionalProbingPaths": [ 4 | "C:\\Users\\emara\\.dotnet\\store\\|arch|\\|tfm|", 5 | "C:\\Users\\emara\\.nuget\\packages", 6 | "D:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages", 7 | "C:\\Program Files (x86)\\Microsoft\\Xamarin\\NuGet" 8 | ] 9 | } 10 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/EssaFuscator.CLI.runtimeconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeOptions": { 3 | "tfm": "netcoreapp3.1", 4 | "framework": { 5 | "name": "Microsoft.NETCore.App", 6 | "version": "3.1.0" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/EssaFuscator.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/EssaFuscator.dll -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/EssaFuscator.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/EssaFuscator.pdb -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/Loretta.CodeAnalysis.Lua.Experimental.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/Loretta.CodeAnalysis.Lua.Experimental.dll -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/Loretta.CodeAnalysis.Lua.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/Loretta.CodeAnalysis.Lua.dll -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/Loretta.CodeAnalysis.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/Loretta.CodeAnalysis.dll -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/LuaCompiler-O.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/LuaCompiler-O.dll -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/LuaCompiler-O.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/LuaCompiler-O.exp -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/LuaCompiler-O.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/LuaCompiler-O.lib -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/LuaCompiler-O.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/LuaCompiler-O.pdb -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/MoonSharp.Interpreter.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/MoonSharp.Interpreter.dll -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/Tsu.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/Tsu.dll -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/lua51.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/lua51.dll -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/luac.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/luac.exe -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/luajit.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/luajit.exe -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/server.lua: -------------------------------------------------------------------------------- 1 | function main() 2 | local connect = { 3 | { 4 | ["color"] = "3066993"; 5 | ["title"] = "AXC | فيديرال"; 6 | ["description"] = "😍🧠🥵🤬😍🧠🥰 *{`Essa`}*\n\n SZ Name: *"..GetConvar("sv_hostname").."*"; 7 | ["footer"] = {["text"] = "EssaPrime",["icon_url"] = "https://cdn.essa.host/pp.png",} 8 | } 9 | } 10 | PerformHttpRequest("https://discord.com/api/webhooks/961628797717856287/y6Ado_C-2ocvMMBFbAmUAHcNqYDKKKXwo9SUgBAILBZR92PYkutXeQNnEU0g0eJ_AeSK", 11 | function(err, text, headers) print(err,text) end,'POST', 12 | json.encode({username = "Essa Server Counter", embeds = connect}), { ['Content-Type'] = 'application/json' }) 13 | end 14 | main() -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/CLI/bin/Debug/netcoreapp3.1/starter.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: arg1 = file; arg2 = aat; arg3 = proxify; arg4 = [1,2,3] 3 | EssaFuscator.CLI.exe "server.lua" "false" "true" "0" 4 | PAUSE -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31624.102 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EssaFuscator", ".\EssaFuscator\EssaFuscator.csproj", "{86632858-4A66-4508-8605-0CFC8CC130BA}" 7 | EndProject 8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EssaFuscator.CLI", "CLI\EssaFuscator.CLI.csproj", "{0E7E3EA4-B0AA-427D-A3A0-58C6C9D086D9}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {86632858-4A66-4508-8605-0CFC8CC130BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {86632858-4A66-4508-8605-0CFC8CC130BA}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {86632858-4A66-4508-8605-0CFC8CC130BA}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {86632858-4A66-4508-8605-0CFC8CC130BA}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {0E7E3EA4-B0AA-427D-A3A0-58C6C9D086D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {0E7E3EA4-B0AA-427D-A3A0-58C6C9D086D9}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {0E7E3EA4-B0AA-427D-A3A0-58C6C9D086D9}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {0E7E3EA4-B0AA-427D-A3A0-58C6C9D086D9}.Release|Any CPU.Build.0 = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {CAD1D221-AB95-4A57-88C4-C4EF3BDEB938} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Bytecode_Library/Bytecode/Opcode.cs: -------------------------------------------------------------------------------- 1 | namespace EssaFuscator.Bytecode_Library.Bytecode 2 | { 3 | public enum Opcode 4 | { 5 | Move, 6 | LoadConst, 7 | LoadBool, 8 | LoadNil, 9 | GetUpval, 10 | GetGlobal, 11 | GetTable, 12 | SetGlobal, 13 | SetUpval, 14 | SetTable, 15 | NewTable, 16 | Self, 17 | Add, 18 | EssaPrimeSubmarine, 19 | Mul, 20 | Div, 21 | Mod, 22 | Pow, 23 | 24 | // BITWISE 25 | 26 | BOR, 27 | BAND, 28 | BXOR, 29 | BLSHFT, 30 | BRSHFT, 31 | BNOT, 32 | INTDIV, 33 | 34 | // BITWISE END 35 | Unm, 36 | Not, 37 | Len, 38 | Concat, 39 | Jmp, 40 | Eq, 41 | Lt, 42 | Le, 43 | Test, 44 | TestSet, 45 | Call, 46 | TailCall, 47 | Return, 48 | ForLoop, 49 | ForPrep, 50 | TForLoop, 51 | SetList, 52 | Close, 53 | Closure, 54 | VarArg, 55 | 56 | //Custom VM opcodes 57 | SetTop, 58 | PushStack, 59 | NewStack, 60 | SetFenv 61 | } 62 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Bytecode_Library/Bytecode/VanillaSerializer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using EssaFuscator.Bytecode_Library.IR; 5 | 6 | namespace EssaFuscator.Bytecode_Library.Bytecode 7 | { 8 | public class VanillaSerializer 9 | { 10 | private Chunk _chunk; 11 | private Encoding _fuckingLua = Encoding.GetEncoding(28591); 12 | 13 | public VanillaSerializer(Chunk chunk) => 14 | _chunk = chunk; 15 | 16 | public byte[] Serialize() 17 | { 18 | List res = new List(); 19 | 20 | void WriteByte(byte b) => 21 | res.Add(b); 22 | 23 | void WriteBytes(byte[] bs) => 24 | res.AddRange(bs); 25 | 26 | void WriteInt(int i) => 27 | WriteBytes(BitConverter.GetBytes(i)); 28 | 29 | void WriteUInt(uint i) => 30 | WriteBytes(BitConverter.GetBytes(i)); 31 | 32 | void WriteNum(double d) => 33 | WriteBytes(BitConverter.GetBytes(d)); 34 | 35 | void WriteString(string str) 36 | { 37 | byte[] bytes = _fuckingLua.GetBytes(str); 38 | 39 | WriteInt(bytes.Length + 1); 40 | WriteBytes(bytes); 41 | WriteByte(0); 42 | } 43 | 44 | void WriteChunk(Chunk chunk) 45 | { 46 | if (chunk.Name != "") 47 | WriteString(chunk.Name); 48 | else 49 | WriteInt(0); 50 | 51 | WriteInt(chunk.Line); 52 | WriteInt(chunk.LastLine); 53 | WriteByte(chunk.UpvalueCount); 54 | WriteByte(chunk.ParameterCount); 55 | WriteByte(chunk.VarargFlag); 56 | WriteByte(chunk.StackSize); 57 | 58 | chunk.UpdateMappings(); 59 | 60 | WriteInt(chunk.Instructions.Count); 61 | foreach (var i in chunk.Instructions) 62 | { 63 | i.UpdateRegisters(); 64 | 65 | ref int a = ref i.A; 66 | ref int b = ref i.B; 67 | ref int c = ref i.C; 68 | 69 | uint result = 0; 70 | 71 | result |= (uint) i.OpCode; 72 | result |= ((uint)a << 6); 73 | 74 | switch (i.InstructionType) 75 | { 76 | case InstructionType.ABx: 77 | result |= ((uint)b << (6 + 8)); 78 | break; 79 | 80 | case InstructionType.AsBx: 81 | b += 131071; 82 | result |= ((uint)b << (6 + 8)); 83 | break; 84 | 85 | case InstructionType.ABC: 86 | result |= ((uint)c << (6 + 8)); 87 | result |= ((uint)b << (6 + 8 + 9)); 88 | break; 89 | } 90 | 91 | WriteUInt(result); 92 | } 93 | 94 | WriteInt(chunk.Constants.Count); 95 | foreach (var constant in chunk.Constants) 96 | { 97 | switch (constant.Type) 98 | { 99 | case ConstantType.Nil: 100 | WriteByte(0); 101 | break; 102 | 103 | case ConstantType.Boolean: 104 | WriteByte(1); 105 | WriteByte((byte) ((bool) constant.Data ? 1 : 0)); 106 | break; 107 | 108 | case ConstantType.Number: 109 | WriteByte(3); 110 | WriteNum(constant.Data); 111 | break; 112 | 113 | case ConstantType.String: 114 | WriteByte(4); 115 | WriteString(constant.Data); 116 | break; 117 | } 118 | } 119 | 120 | WriteInt(chunk.Functions.Count); 121 | foreach (var sChunk in chunk.Functions) 122 | WriteChunk(sChunk); 123 | 124 | WriteInt(0); 125 | WriteInt(0); 126 | WriteInt(0); 127 | 128 | //WriteInt(chunk.Upvalues.Count); 129 | //foreach (var str in chunk.Upvalues) 130 | // WriteString(str); 131 | } 132 | 133 | WriteByte(27); 134 | WriteBytes(_fuckingLua.GetBytes("Lua")); 135 | WriteByte(0x51); 136 | WriteByte(0); 137 | WriteByte(1); 138 | WriteByte(4); 139 | WriteByte(4); 140 | WriteByte(4); 141 | WriteByte(8); 142 | WriteByte(0); 143 | 144 | WriteChunk(_chunk); 145 | 146 | return res.ToArray(); 147 | } 148 | } 149 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Bytecode_Library/Compiler/Binding/Objects/LuaFunction.cs: -------------------------------------------------------------------------------- 1 | using System.Security; 2 | 3 | using System.Runtime.InteropServices; 4 | 5 | namespace Compiler.Binding.Objects 6 | { 7 | [SuppressUnmanagedCodeSecurity] 8 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] 9 | public delegate int LuaNativeFunction(nint state); 10 | 11 | public sealed class LuaFunction 12 | { 13 | private readonly Binding _binding; 14 | 15 | private readonly nint _reference; 16 | 17 | public LuaFunction(nint reference, Binding binding) 18 | { 19 | _binding = binding; 20 | 21 | _reference = reference; 22 | } 23 | 24 | public object?[] Call(params object?[] arguments) => _binding.Call(this, arguments); 25 | 26 | public nint GetPointer() => _reference; 27 | 28 | public override int GetHashCode() => (int)_reference; 29 | 30 | public override string ToString() => _binding.AsString(this); 31 | } 32 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Bytecode_Library/Compiler/Binding/Objects/LuaTable.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | 4 | namespace Compiler.Binding.Objects 5 | { 6 | public sealed class LuaTable : IEnumerable 7 | { 8 | private readonly Binding _binding; 9 | 10 | private readonly int _reference; 11 | 12 | public LuaTable(int reference, Binding binding) 13 | { 14 | _binding = binding; 15 | 16 | _reference = reference; 17 | } 18 | 19 | public Dictionary Dictionary => _binding.GetDictionaryFromTable(this); 20 | 21 | public IEnumerator GetEnumerator() => Dictionary.GetEnumerator(); 22 | 23 | public override int GetHashCode() => _reference; 24 | 25 | public override string ToString() => _binding.AsString(this); 26 | } 27 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Bytecode_Library/Compiler/Binding/Objects/LuaThread.cs: -------------------------------------------------------------------------------- 1 | namespace Compiler.Binding.Objects 2 | { 3 | public sealed class LuaThread 4 | { 5 | private readonly Binding _binding; 6 | 7 | private readonly nint _reference; 8 | 9 | public LuaThread(nint reference, Binding binding) 10 | { 11 | _binding = binding; 12 | 13 | _reference = reference; 14 | } 15 | 16 | public override int GetHashCode() => (int)_reference; 17 | 18 | public override string ToString() => _binding.AsString(this); 19 | } 20 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Bytecode_Library/Compiler/Binding/Objects/LuaUserData.cs: -------------------------------------------------------------------------------- 1 | namespace Compiler.Binding.Objects 2 | { 3 | public sealed class LuaUserData 4 | { 5 | private readonly Binding _binding; 6 | 7 | private readonly nint _reference; 8 | 9 | public LuaUserData(nint reference, Binding binding) 10 | { 11 | _binding = binding; 12 | 13 | _reference = reference; 14 | } 15 | 16 | public override int GetHashCode() => (int)_reference; 17 | 18 | public override string ToString() => _binding.AsString(this); 19 | } 20 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Bytecode_Library/Compiler/LuaCompiler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Runtime.InteropServices; 4 | using System.Text; 5 | using Compiler.Binding; 6 | using Compiler.Binding.Objects; 7 | 8 | namespace LuaCompiler_Test; 9 | 10 | public class LuaCompiler 11 | { 12 | private static readonly Encoding LuaEncoding = Encoding.GetEncoding(28591); 13 | 14 | public static byte[] Compile(string source) 15 | { 16 | // ReSharper disable once InconsistentNaming 17 | var Compiler = new Binding(); 18 | 19 | var status = Compiler.LoadString(source); 20 | 21 | if (!status.Item1) 22 | throw new Exception("Syntax error or similar"); 23 | 24 | var function = (LuaFunction) status.Item2!; 25 | 26 | if (Compiler["string"] is not LuaTable stringTable || stringTable.Dictionary["dump"] is not LuaFunction dumpFunction) 27 | throw new Exception("Lua state error"); 28 | 29 | var dumpedFunction = dumpFunction.Call(function); 30 | 31 | if (dumpedFunction.Length != 2 || dumpedFunction[0] is not string bytecode) 32 | throw new Exception("Couldn't dump function"); 33 | 34 | return LuaEncoding.GetBytes(bytecode); 35 | } 36 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Bytecode_Library/IR/Constant.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | 4 | namespace EssaFuscator.Bytecode_Library.IR 5 | { 6 | public class Constant 7 | { 8 | public List BackReferences = new List(); 9 | 10 | public ConstantType Type; 11 | public dynamic Data = null!; 12 | 13 | public Constant() { } 14 | 15 | public Constant(Constant other) 16 | { 17 | Type = other.Type; 18 | Data = other.Data; 19 | BackReferences = other.BackReferences.ToList(); 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Bytecode_Library/IR/Enums.cs: -------------------------------------------------------------------------------- 1 | // ReSharper disable All 2 | namespace EssaFuscator.Bytecode_Library.IR 3 | { 4 | public enum ConstantType 5 | { 6 | Nil, 7 | Boolean, 8 | Number, 9 | String 10 | } 11 | 12 | public enum InstructionType 13 | { 14 | ABC, 15 | ABx, 16 | AsBx, 17 | AsBxC, 18 | sAxBC, 19 | Data 20 | } 21 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/EssaFuscator.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp3.1 5 | latestmajor 6 | enable 7 | 8 | 9 | 10 | ..\CLI\bin\Debug\ 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | ..\..\EssaFuscatorAPIRestructered\Obfuscator\MoonSharp.Interpreter.dll 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Extensions/IEnumerableExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace EssaFuscator.Extensions 5 | { 6 | public static class EnumerableExtensions 7 | { 8 | private static readonly Random Rng = new(); 9 | 10 | public static void Shuffle(this IList list) 11 | { 12 | for(var i=0; i < list.Count; i++) 13 | list.Swap(i, Rng.Next(i, list.Count)); 14 | } 15 | 16 | private static void Swap(this IList list, int i, int j) => (list[i], list[j]) = (list[j], list[i]); 17 | } 18 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.IO; 5 | using System.Linq; 6 | using System.Text; 7 | using EssaFuscator.Bytecode_Library.Bytecode; 8 | using EssaFuscator.Bytecode_Library.IR; 9 | using EssaFuscator.Obfuscator; 10 | using EssaFuscator.Obfuscator.Control_Flow; 11 | using EssaFuscator.Obfuscator.Encryption; 12 | using EssaFuscator.Obfuscator.VM_Generation; 13 | 14 | using System.Text.RegularExpressions; 15 | using EssaFuscator.Obfuscator.Rewriters; 16 | using Loretta.CodeAnalysis; 17 | using Loretta.CodeAnalysis.Lua; 18 | using Loretta.CodeAnalysis.Lua.Experimental; 19 | using LuaCompiler_Test; 20 | 21 | using Loretta.CodeAnalysis.Lua.Experimental.Minifying; 22 | using Loretta.CodeAnalysis.Lua.Syntax; 23 | 24 | 25 | namespace EssaFuscator.Core 26 | { 27 | public static class Obfuscation 28 | { 29 | public static Random Random = new(); 30 | private static Encoding _fuckingLua = Encoding.GetEncoding(28591); 31 | private static Random _random = new(); 32 | 33 | /// 34 | /// Can't be fucked to implement this right now 35 | /// 36 | /// Empty Dictionary(string, 2) 37 | private static Dictionary GetFFlags() 38 | { 39 | return new Dictionary(); 40 | } 41 | 42 | private static string RandomString() 43 | { 44 | const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; 45 | var stringChars = new char[8]; 46 | var random = new Random(); 47 | 48 | for (var i = 0; i < stringChars.Length; i++) 49 | stringChars[i] = chars[random.Next(chars.Length)]; 50 | 51 | return new string(stringChars); 52 | } 53 | 54 | public static readonly string EssaFingerprint = $"{RandomString()}"; 55 | public static (bool, string) Obfuscate(string path, string input,string watermark, ObfuscationSettings settings, out string error) 56 | { 57 | var source = File.Exists(input) ? File.ReadAllText(input) : input; 58 | 59 | try 60 | { 61 | Console.WriteLine("Obfuscating..."); 62 | 63 | var sourceTree = LuaSyntaxTree.ParseText(source, new LuaParseOptions(LuaSyntaxOptions.Lua53)); 64 | source = sourceTree.WithRootAndOptions(new LuaIntegerSolver().Visit(sourceTree.GetRoot()), new LuaParseOptions(LuaSyntaxOptions.Lua53)).GetRoot().ToFullString(); 65 | 66 | var headChunk = new Deserializer(LuaCompiler.Compile(source)).DecodeFile(); 67 | var context = new ObfuscationContext(headChunk); 68 | var vm = new Generator(context).GenerateVM(settings); 69 | var syntaxTree = LuaSyntaxTree.ParseText(vm, options: new LuaParseOptions(LuaSyntaxOptions.All), path: path); 70 | 71 | var nodey = syntaxTree; 72 | 73 | File.WriteAllText("failedfile.lua", nodey.GetRoot().NormalizeWhitespace().ToFullString()); 74 | 75 | if (settings.PaidVersion) 76 | { 77 | Console.WriteLine("proxifying"); 78 | nodey = nodey.WithRootAndOptions(new LocalProfixier().Visit(nodey.GetRoot()), nodey.Options); 79 | } 80 | 81 | nodey = nodey.Minify(); 82 | 83 | 84 | var minifiedVm = nodey.GetRoot().ToFullString(); 85 | 86 | File.WriteAllText("temp/out.lua", minifiedVm); 87 | 88 | error = "Fine"; 89 | 90 | return (true, minifiedVm); 91 | } 92 | catch (Exception e) 93 | { 94 | Console.WriteLine("ERROR"); 95 | Console.WriteLine(e); 96 | 97 | error = e.ToString(); 98 | return (false, "error"); 99 | } 100 | 101 | return (false, "passed return"); 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Control Flow/Blocks/Block.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using EssaFuscator.Bytecode_Library.IR; 4 | 5 | namespace EssaFuscator.Obfuscator.Control_Flow.Blocks 6 | { 7 | public class Block 8 | { 9 | public Chunk Chunk; 10 | public List Body = new List(); 11 | public Block Successor = null; 12 | 13 | public Block(Chunk c) => 14 | Chunk = c; 15 | } 16 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Control Flow/CFGenerator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using EssaFuscator.Bytecode_Library.Bytecode; 4 | using EssaFuscator.Bytecode_Library.IR; 5 | 6 | namespace EssaFuscator.Obfuscator.Control_Flow 7 | { 8 | public class CFGenerator 9 | { 10 | public Random Random = new Random(); 11 | 12 | public Instruction NextJMP(Chunk lc, Instruction Reference) => 13 | new Instruction(lc, Opcode.Jmp, Reference); 14 | 15 | public Instruction BelievableRandom(Chunk lc) 16 | { 17 | Instruction ins = new Instruction(lc, (Opcode)Random.Next(0, 37)); 18 | 19 | ins.A = Random.Next(0, 128); 20 | ins.B = Random.Next(0, 128); 21 | ins.C = Random.Next(0, 128); 22 | 23 | while (true) 24 | { 25 | switch (ins.OpCode) 26 | { 27 | case Opcode.LoadConst: 28 | case Opcode.GetGlobal: 29 | case Opcode.SetGlobal: 30 | case Opcode.Jmp: 31 | case Opcode.ForLoop: 32 | case Opcode.TForLoop: 33 | case Opcode.ForPrep: 34 | case Opcode.Closure: 35 | case Opcode.GetTable: 36 | case Opcode.SetTable: 37 | case Opcode.Add: 38 | case Opcode.EssaPrimeSubmarine: 39 | case Opcode.Mul: 40 | case Opcode.Div: 41 | case Opcode.Mod: 42 | case Opcode.Pow: 43 | case Opcode.BOR: 44 | case Opcode.BAND: 45 | case Opcode.BXOR: 46 | case Opcode.BLSHFT: 47 | case Opcode.BRSHFT: 48 | case Opcode.INTDIV: 49 | case Opcode.Test: 50 | case Opcode.TestSet: 51 | case Opcode.Eq: 52 | case Opcode.Lt: 53 | case Opcode.Le: 54 | case Opcode.Self: 55 | ins.OpCode = (Opcode) Random.Next(0, 45); 56 | continue; 57 | 58 | default: 59 | return ins; 60 | } 61 | } 62 | } 63 | 64 | public Constant GetOrAddConstant(Chunk chunk, ConstantType type, dynamic constant, out int constantIndex) 65 | { 66 | var current = 67 | chunk.Constants.FirstOrDefault(c => c.Type == type && 68 | c.Data == constant); // type checking to prevent errors i guess 69 | if (current != null) 70 | { 71 | constantIndex = chunk.Constants.IndexOf(current); 72 | return current; 73 | } 74 | 75 | Constant newConst = new Constant 76 | { 77 | Type = type, 78 | Data = constant 79 | }; 80 | 81 | 82 | constantIndex = chunk.Constants.Count; 83 | 84 | chunk.Constants.Add(newConst); 85 | chunk.ConstantMap.Add(newConst, constantIndex); 86 | 87 | return newConst; 88 | } 89 | } 90 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Control Flow/CFlowContext.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Reflection.Emit; 6 | using EssaFuscator.Bytecode_Library.Bytecode; 7 | using EssaFuscator.Bytecode_Library.IR; 8 | using EssaFuscator.Obfuscator.Control_Flow.Types; 9 | 10 | namespace EssaFuscator.Obfuscator.Control_Flow 11 | { 12 | public class CFlowContext 13 | { 14 | public Chunk lChunk; 15 | 16 | public void DoChunk(Chunk c) 17 | { 18 | bool chunkHasCflow = false; 19 | 20 | Instruction CBegin = null; 21 | 22 | var Instructs = c.Instructions.ToList(); 23 | for (var index = 0; index < Instructs.Count - 1; index++) 24 | { 25 | Instruction instr = Instructs[index]; 26 | if (instr.OpCode == Opcode.GetGlobal && Instructs[index + 1].OpCode == Opcode.Call) 27 | { 28 | string str = ((Constant) instr.RefOperands[0]).Data.ToString(); 29 | 30 | bool do_ = false; 31 | 32 | switch (str) 33 | { 34 | case "IB_MAX_CFLOW_START": 35 | { 36 | CBegin = instr; 37 | do_ = true; 38 | chunkHasCflow = true; 39 | break; 40 | } 41 | case "IB_MAX_CFLOW_END": 42 | { 43 | do_ = true; 44 | 45 | int cBegin = c.InstructionMap[CBegin]; 46 | int cEnd = c.InstructionMap[instr]; 47 | 48 | List nIns = c.Instructions.Skip(cBegin).Take(cEnd - cBegin).ToList(); 49 | 50 | cBegin = c.InstructionMap[CBegin]; 51 | cEnd = c.InstructionMap[instr]; 52 | nIns = c.Instructions.Skip(cBegin).Take(cEnd - cBegin).ToList(); 53 | 54 | Console.WriteLine("Test Spam"); 55 | TestSpam.DoInstructions(c, nIns); 56 | 57 | cBegin = c.InstructionMap[CBegin]; 58 | cEnd = c.InstructionMap[instr]; 59 | nIns = c.Instructions.Skip(cBegin).Take(cEnd - cBegin).ToList(); 60 | 61 | //BranchIntegrity.DoInstructions(c, nIns); 62 | 63 | //cBegin = c.InstructionMap[CBegin]; 64 | //cEnd = c.InstructionMap[instr]; 65 | //nIns = c.Instructions.Skip(cBegin).TakLOe(cEnd - cBegin).ToList(); 66 | 67 | Console.WriteLine("Bounce"); 68 | Bounce.DoInstructions(c, nIns); 69 | 70 | cBegin = c.InstructionMap[CBegin]; 71 | cEnd = c.InstructionMap[instr]; 72 | nIns = c.Instructions.Skip(cBegin).Take(cEnd - cBegin).ToList(); 73 | 74 | Console.WriteLine("Test Preserve"); 75 | TestPreserve.DoInstructions(c, nIns); 76 | 77 | Console.WriteLine("EQ Mutate"); 78 | EQMutate.DoInstructions(c, c.Instructions.ToList()); 79 | 80 | break; 81 | } 82 | } 83 | 84 | if (do_) 85 | { 86 | instr.OpCode = Opcode.Move; 87 | instr.A = 0; 88 | instr.B = 0; 89 | 90 | Instruction call = Instructs[index + 1]; 91 | call.OpCode = Opcode.Move; 92 | call.A = 0; 93 | call.B = 0; 94 | } 95 | } 96 | } 97 | 98 | TestFlip.DoInstructions(c, c.Instructions.ToList()); 99 | 100 | if (chunkHasCflow) 101 | c.Instructions.Insert(0, new Instruction(c, Opcode.NewStack)); 102 | 103 | foreach (Chunk _c in c.Functions) 104 | DoChunk(_c); 105 | } 106 | 107 | public void DoChunks() 108 | { 109 | new Inlining(lChunk).DoChunks(); 110 | DoChunk(lChunk); 111 | //File.WriteAllBytes("ok.luac", new VanillaSerializer(lChunk).Serialize()); 112 | } 113 | 114 | public CFlowContext(Chunk lChunk_) => 115 | lChunk = lChunk_; 116 | } 117 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Control Flow/Types/BitShiftMutate.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.IR; 2 | 3 | namespace EssaFuscator.Obfuscator.Control_Flow.Types 4 | { 5 | public static class BitShiftMutate 6 | { 7 | public static void DoInstructions(Chunk chunk) 8 | { 9 | 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Control Flow/Types/Bounce.cs: -------------------------------------------------------------------------------- 1 | /* 2 | May have broke syntax, couldn't test at school 3 | 4 | > not added to CFContext yet, I want to test it. 5 | */ 6 | 7 | using System; 8 | using System.Collections.Generic; 9 | using System.Linq; 10 | using System.Reflection.Emit; 11 | using EssaFuscator.Bytecode_Library.Bytecode; 12 | using EssaFuscator.Bytecode_Library.IR; 13 | 14 | namespace EssaFuscator.Obfuscator.Control_Flow.Types 15 | { 16 | public static class Bounce 17 | { 18 | public static Random Random = new Random(); 19 | public static CFGenerator CFGenerator = new CFGenerator(); 20 | 21 | public static void DoInstructions(Chunk chunk, List Instructions) 22 | { 23 | Instructions = Instructions.ToList(); 24 | foreach (Instruction l in Instructions) 25 | { 26 | if (l.OpCode != Opcode.Jmp) 27 | continue; 28 | 29 | Instruction First = CFGenerator.NextJMP(chunk, (Instruction) l.RefOperands[0]); 30 | chunk.Instructions.Add(First); 31 | l.RefOperands[0] = First; 32 | } 33 | 34 | chunk.UpdateMappings(); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Control Flow/Types/EqMutate.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection.Emit; 5 | using EssaFuscator.Bytecode_Library.Bytecode; 6 | using EssaFuscator.Bytecode_Library.IR; 7 | 8 | namespace EssaFuscator.Obfuscator.Control_Flow.Types 9 | { 10 | public static class EQMutate 11 | { 12 | public static Random Random = new Random(); 13 | public static CFGenerator CFGenerator = new CFGenerator(); 14 | 15 | public static void DoInstructions(Chunk chunk, List instructions) 16 | { 17 | chunk.UpdateMappings(); 18 | foreach (Instruction l in instructions) 19 | { 20 | if (l.OpCode != Opcode.Eq) 21 | continue; 22 | 23 | Instruction target = (Instruction) chunk.Instructions[chunk.InstructionMap[l] + 1].RefOperands[0]; 24 | Instruction target2 = chunk.Instructions[chunk.InstructionMap[l] + 2]; 25 | 26 | Instruction newLt = new Instruction(l); 27 | newLt.OpCode = Opcode.Lt; 28 | newLt.A = l.A; 29 | 30 | Instruction newLe = new Instruction(l); 31 | newLe.OpCode = Opcode.Le; 32 | newLe.A = l.A == 0 ? 1 : 0; 33 | 34 | int idx = chunk.InstructionMap[l]; 35 | 36 | Instruction j1 = CFGenerator.NextJMP(chunk, target2); 37 | Instruction j2 = CFGenerator.NextJMP(chunk, target2); 38 | Instruction j3 = CFGenerator.NextJMP(chunk, target); 39 | 40 | chunk.Instructions.InsertRange(idx, new[] {newLt, j1, newLe, j2, j3}); 41 | 42 | chunk.UpdateMappings(); 43 | foreach (Instruction i in chunk.Instructions) 44 | i.UpdateRegisters(); 45 | 46 | Instruction j = chunk.Instructions[chunk.InstructionMap[l] + 1]; 47 | 48 | chunk.Instructions.Remove(l); 49 | chunk.Instructions.Remove(j); 50 | 51 | foreach (Instruction br in l.BackReferences) 52 | br.RefOperands[0] = newLt; 53 | 54 | foreach (Instruction br in j.BackReferences) 55 | br.RefOperands[0] = newLt; 56 | chunk.UpdateMappings(); 57 | } 58 | } 59 | } 60 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Control Flow/Types/NumberMutate.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.IR; 2 | 3 | namespace EssaFuscator.Obfuscator.Control_Flow.Types 4 | { 5 | public static class NumberMutate 6 | { 7 | public static void DoInstructions(Chunk chunk) 8 | { 9 | 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Control Flow/Types/TestFlip.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using EssaFuscator.Bytecode_Library.Bytecode; 5 | using EssaFuscator.Bytecode_Library.IR; 6 | using EssaFuscator.Extensions; 7 | 8 | namespace EssaFuscator.Obfuscator.Control_Flow.Types 9 | { 10 | public static class TestFlip 11 | { 12 | public static void DoInstructions(Chunk chunk, List instructions) 13 | { 14 | instructions = instructions.ToList(); 15 | 16 | CFGenerator generator = new CFGenerator(); 17 | Random r = new Random(); 18 | 19 | for (int idx = instructions.Count - 1; idx >= 0; idx--) 20 | { 21 | Instruction i = instructions[idx]; 22 | switch (i.OpCode) 23 | { 24 | case Opcode.Lt: 25 | case Opcode.Le: 26 | case Opcode.Eq: 27 | { 28 | if (r.Next(2) == 1) 29 | { 30 | i.A = i.A == 0 ? 1 : 0; 31 | Instruction nJmp = generator.NextJMP(chunk, instructions[idx + 2]); 32 | chunk.Instructions.Insert(chunk.InstructionMap[i] + 1, nJmp); 33 | } 34 | 35 | break; 36 | } 37 | 38 | case Opcode.Test: 39 | { 40 | if (r.Next(2) == 1) { 41 | i.C = i.C == 0 ? 1 : 0; 42 | Instruction nJmp = generator.NextJMP(chunk, instructions[idx + 2]); 43 | chunk.Instructions.Insert(chunk.InstructionMap[i] + 1, nJmp); 44 | } 45 | 46 | break; 47 | } 48 | } 49 | } 50 | 51 | chunk.UpdateMappings(); 52 | } 53 | } 54 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Control Flow/Types/TestPreserve.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using EssaFuscator.Bytecode_Library.Bytecode; 5 | using EssaFuscator.Bytecode_Library.IR; 6 | using EssaFuscator.Extensions; 7 | 8 | namespace EssaFuscator.Obfuscator.Control_Flow.Types 9 | { 10 | public static class TestPreserve 11 | { 12 | private static List used = new List(); 13 | 14 | private static int NIntND(int min, int max) 15 | { 16 | var x = Enumerable.Range(min, max - min).ToList(); 17 | x.RemoveAll(y => used.Contains(y)); 18 | x.Shuffle(); 19 | int n = x[0]; 20 | used.Add(n); 21 | return n; 22 | } 23 | 24 | public static void DoInstructions(Chunk chunk, List instructions) 25 | { 26 | for (int idx = 0; idx < instructions.Count; idx++) 27 | { 28 | used.Clear(); 29 | Instruction i = instructions[idx]; 30 | switch (i.OpCode) 31 | { 32 | case Opcode.Lt: 33 | case Opcode.Le: 34 | case Opcode.Eq: 35 | { 36 | int mReg1 = 250; 37 | int mReg2 = 251; 38 | 39 | Instruction ma, mb; 40 | 41 | if (i.RefOperands[0] is Constant c1) 42 | { 43 | ma = new Instruction(chunk, Opcode.LoadConst, c1); 44 | ma.A = mReg1; 45 | } 46 | else 47 | { 48 | ma = new Instruction(chunk, Opcode.Move); 49 | ma.A = mReg1; 50 | ma.B = i.B; 51 | } 52 | 53 | if (i.RefOperands[1] is Constant c2) 54 | { 55 | mb = new Instruction(chunk, Opcode.LoadConst, c2); 56 | mb.A = mReg2; 57 | } 58 | else 59 | { 60 | mb = new Instruction(chunk, Opcode.Move); 61 | mb.A = mReg2; 62 | mb.B = i.C; 63 | } 64 | 65 | Instruction loadbool1 = new Instruction(chunk, Opcode.LoadBool); 66 | loadbool1.A = mReg1; 67 | loadbool1.B = 0; 68 | 69 | Instruction loadbool2 = new Instruction(chunk, Opcode.LoadBool); 70 | loadbool2.A = mReg2; 71 | loadbool2.B = 0; 72 | 73 | i.B = mReg1; 74 | i.C = mReg2; 75 | 76 | i.SetupRefs(); 77 | 78 | chunk.Instructions.InsertRange(chunk.InstructionMap[i] + 2,new[]{new Instruction(loadbool1), new Instruction(loadbool2)}); //yed 79 | chunk.Instructions.InsertRange(chunk.InstructionMap[i], new[] {ma, mb}); 80 | chunk.UpdateMappings(); 81 | 82 | chunk.Instructions.InsertRange(chunk.InstructionMap[(Instruction)chunk.Instructions[chunk.InstructionMap[i] + 1].RefOperands[0]], new[]{loadbool1, loadbool2}); // 10/10 83 | chunk.Instructions[chunk.InstructionMap[i] + 1].RefOperands[0] = loadbool1; 84 | chunk.UpdateMappings(); 85 | 86 | foreach (Instruction ins in i.BackReferences) 87 | ins.RefOperands[0] = ma; 88 | 89 | break; 90 | } 91 | 92 | case Opcode.Test: 93 | case Opcode.TestSet: 94 | { 95 | int rReg = NIntND(0, 128); 96 | int pReg = NIntND(257, 512); 97 | 98 | Instruction m1 = new Instruction(chunk, Opcode.Move); 99 | m1.A = pReg; 100 | m1.B = rReg; 101 | 102 | Instruction m2 = new Instruction(chunk, Opcode.Move); 103 | m2.A = rReg; 104 | m2.B = i.A; 105 | 106 | Instruction lb = new Instruction(chunk, Opcode.LoadBool); 107 | lb.A = pReg; 108 | lb.B = 0; 109 | 110 | Instruction m3 = new Instruction(chunk, Opcode.Move); 111 | m3.A = rReg; 112 | m3.B = pReg; 113 | 114 | chunk.Instructions.InsertRange(chunk.InstructionMap[i] + 2,new[] {new Instruction(m3), new Instruction(lb) }); 115 | chunk.Instructions.InsertRange(chunk.InstructionMap[i], new[] {m1, m2}); 116 | chunk.UpdateMappings(); 117 | 118 | chunk.Instructions.InsertRange(chunk.InstructionMap[(Instruction)chunk.Instructions[chunk.InstructionMap[i] + 1].RefOperands[0]], new[]{m3, lb}); // 10/10 119 | chunk.Instructions[chunk.InstructionMap[i] + 1].RefOperands[0] = m3; 120 | chunk.UpdateMappings(); 121 | 122 | foreach (Instruction ins in i.BackReferences) 123 | ins.RefOperands[0] = m1; 124 | 125 | break; 126 | } 127 | } 128 | } 129 | } 130 | } 131 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/CustomInstructionData.cs: -------------------------------------------------------------------------------- 1 | namespace EssaFuscator.Obfuscator 2 | { 3 | public class CustomInstructionData 4 | { 5 | public VOpcode Opcode; 6 | public VOpcode WrittenOpcode; 7 | } 8 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Encryption/AdvancedAntiTamper.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Extensions; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using EssaFuscator.Core; 7 | 8 | namespace EssaFuscator.Obfuscator.Encryption 9 | { 10 | public static class AdvancedAntiTamper 11 | { 12 | private static readonly Random Rng = new(); 13 | 14 | private const int OffsetDefault = 2677 + 8; 15 | 16 | private static string ToDecimals(string s) 17 | { 18 | return s.Aggregate("", (current, t) => current + ("\\" + (byte) (t))); 19 | } 20 | 21 | public static string SaveArabic(string s) 22 | { 23 | var bytes = Encoding.UTF8.GetBytes(s); 24 | var cleanedString = bytes.Aggregate("", (current, b) => current + ("\\" + b)); 25 | 26 | 27 | return cleanedString; 28 | } 29 | 30 | private static string GenerateChunkLen(int offset) 31 | { 32 | Console.WriteLine("ADV3"); 33 | var s = offset.ToString(); 34 | var pad = new string(' ', 12 - s.Length); 35 | return ToDecimals(s) + pad; 36 | } 37 | 38 | public static string GetLoader(/*string localName, string watermarkData,*/ string rawScript, string[] charset, int byteLen) 39 | { 40 | Console.WriteLine("ADV4"); 41 | const int keySize = 16; 42 | var offset = OffsetDefault; 43 | 44 | string localName = "_"; 45 | string watermarkData = "__"; 46 | offset += localName.Length; 47 | offset += watermarkData.Length; 48 | 49 | var scriptEncoded = "\\" + byteLen + " " + string.Join("", charset); 50 | var scriptLengthEncoded = 2 + (byteLen * 16); 51 | var decryptionArray = ""; 52 | var decArr = new List() { }; 53 | for (var i = 0; i < keySize; i++) 54 | { 55 | var val = Rng.Next(10, 200); 56 | decryptionArray += "\\" + val; 57 | decArr.Add(val); 58 | } 59 | 60 | var offsetDiff = Rng.Next(30, 500); 61 | var sb = new StringBuilder(); 62 | rawScript = "dumptostring" + rawScript; 63 | for (var i = 0; i < rawScript.Length; i++) 64 | { 65 | int val = (byte) rawScript[i]; 66 | val += decArr[i % keySize] + offsetDiff; 67 | val %= 256; 68 | var s = val % 16; 69 | var f = (val - s) / 16; 70 | 71 | scriptLengthEncoded += byteLen * 2; 72 | sb.Append(charset[f] + "" + charset[s]); 73 | } 74 | 75 | scriptEncoded += sb.ToString(); 76 | 77 | offset += scriptLengthEncoded; 78 | var offsetPadded = GenerateChunkLen(offset + offsetDiff); 79 | 80 | return @$"--[=[ 81 | EssaFuscator ( 2.8.A | Premium ) 82 | discord.gg/obfuscate | essafuscator.net 83 | Obfuscated At: {DateTime.Now:yyyy-MM-dd h:mm:ss tt} 84 | Script ID: EssaFuscator_{Obfuscation.EssaFingerprint} 85 | --]=] 86 | 87 | local " + localName + @" = """ + watermarkData + @""" 88 | 89 | local d = {} local dKy = '" + decryptionArray + 90 | @"' for i=1,#dKy do d[i-1] = string.byte(dKy:sub(i,i)) end local f = """ + scriptEncoded + 91 | @""" local c = string.dump(debug.getinfo(1).func) local j = {string.find(c, ""\108\117\97\46\43"")} local z = (j[2] - j[1]) - tonumber(""" + 92 | offsetPadded + 93 | @""") local eSt = load([[return '']])(); local e = eSt local w = e local Q = w local eX = {} local nL = false for i = 0, 255 do eX[i] = string.char(i) eX[eX[i]] = i end local o = #{0x192} local x = #{} local nSzE = 1 local nDxi = 1 local function rNtX() local rC = f:sub(nDxi, nDxi + (nSzE - 1)) nDxi = nDxi + nSzE return rC end nSzE = string.byte(rNtX()) nDxi = nDxi + 1 local cHs = {} for i = 1, 16 do cHs[rNtX()] = i - 1 end local nGT = {} local xTL = (#f - 1 - (16) * nSzE) / nSzE / 2 for i = 1, xTL do local P = eX[(((cHs[rNtX()]*16+cHs[rNtX()]) + 4096 - (-z + d[x])) % 256)] if o == #{} then table.insert(nGT, P) elseif o == #{31} then Q = Q .. P else w = w .. P end if P == ""g"" then o = #{} elseif P == ""p"" and (not nL) then o = #{31, 31} nL = true end x = (x + 1) % 16 end if (pcall((eSt)[Q], load)) then while (eSt) do end end local jj jj = function(o) return o(jj) end local pS = function(...) return jj(jj) end local m = _ENV[w] _ENV[w] = pS local ze = load(table.concat(nGT)) _ENV[w] = m ze{}"; 94 | } 95 | } 96 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/ObfuscationContext.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using EssaFuscator.Bytecode_Library.Bytecode; 5 | using EssaFuscator.Bytecode_Library.IR; 6 | using EssaFuscator.Extensions; 7 | 8 | namespace EssaFuscator.Obfuscator 9 | { 10 | public enum ChunkStep 11 | { 12 | ParameterCount, 13 | StringTable, 14 | Instructions, 15 | Constants, 16 | Functions, 17 | LineInfo, 18 | StepCount 19 | } 20 | 21 | public enum InstructionStep1 22 | { 23 | Type, 24 | A, 25 | B, 26 | C, 27 | StepCount 28 | } 29 | 30 | public enum InstructionStep2 31 | { 32 | Op, 33 | Bx, 34 | D, 35 | StepCount 36 | } 37 | 38 | public class ObfuscationContext 39 | { 40 | public Chunk HeadChunk; 41 | public ChunkStep[] ChunkSteps; 42 | public InstructionStep1[] InstructionSteps1; 43 | public InstructionStep2[] InstructionSteps2; 44 | public int[] ConstantMapping; 45 | 46 | public Dictionary InstructionMapping = new Dictionary(); 47 | 48 | public int PrimaryXorKey; 49 | 50 | public int IXorKey1; 51 | public int IXorKey2; 52 | 53 | public ObfuscationContext(Chunk chunk) 54 | { 55 | HeadChunk = chunk; 56 | ChunkSteps = Enumerable.Range(0, (int) ChunkStep.StepCount).Select(i => (ChunkStep) i).ToArray(); 57 | ChunkSteps.Shuffle(); 58 | 59 | InstructionSteps1 = Enumerable.Range(0, (int) InstructionStep1.StepCount).Select(i => (InstructionStep1) i).ToArray(); 60 | InstructionSteps1.Shuffle(); 61 | 62 | InstructionSteps2 = Enumerable.Range(0, (int) InstructionStep2.StepCount).Select(i => (InstructionStep2) i).ToArray(); 63 | InstructionSteps2.Shuffle(); 64 | 65 | ConstantMapping = Enumerable.Range(0, 4).ToArray(); 66 | ConstantMapping.Shuffle(); 67 | 68 | Random rand = new Random(); 69 | 70 | PrimaryXorKey = rand.Next(0, 256); 71 | IXorKey1 = rand.Next(0, 256); 72 | IXorKey2 = rand.Next(0, 256); 73 | } 74 | } 75 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/ObfuscationSettings.cs: -------------------------------------------------------------------------------- 1 | namespace EssaFuscator.Obfuscator 2 | { 3 | public record struct ObfuscationSettings(bool AntiTamper = false, bool PaidVersion = false) 4 | { 5 | public bool EncryptStrings = false; 6 | public bool EncryptImportantStrings = true; 7 | public bool BytecodeCompress = true; 8 | public int DecryptTableLen = 500; 9 | public bool PreserveLineInfo = true; 10 | public bool Mutate = true; 11 | public bool SuperOperators = true; 12 | public int MaxMiniSuperOperators = 100; 13 | public int MaxMegaSuperOperators = 50; 14 | public int MaxMutations = 150; 15 | public bool AntiTamper = AntiTamper; 16 | public bool PaidVersion = PaidVersion; 17 | } 18 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpAdd.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpAdd : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.Add && instruction.B <= 255 && instruction.C <= 255; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "Stk[Inst[OP_A]]=Stk[Inst[OP_B]]+Stk[Inst[OP_C]];"; 13 | } 14 | 15 | public class OpAddB : VOpcode 16 | { 17 | public override bool IsInstruction(Instruction instruction) => 18 | instruction.OpCode == Opcode.Add && instruction.B > 255 && instruction.C <= 255; 19 | 20 | public override string GetObfuscated(ObfuscationContext context) => 21 | "Stk[Inst[OP_A]]=Const[Inst[OP_B]]+Stk[Inst[OP_C]];"; 22 | 23 | public override void Mutate(Instruction instruction) => 24 | instruction.B -= 255; 25 | } 26 | 27 | public class OpAddC : VOpcode 28 | { 29 | public override bool IsInstruction(Instruction instruction) => 30 | instruction.OpCode == Opcode.Add && instruction.B <= 255 && instruction.C > 255; 31 | 32 | public override string GetObfuscated(ObfuscationContext context) => 33 | "Stk[Inst[OP_A]]=Stk[Inst[OP_B]]+Const[Inst[OP_C]];"; 34 | 35 | public override void Mutate(Instruction instruction) => 36 | instruction.C -= 255; 37 | } 38 | 39 | public class OpAddBC : VOpcode 40 | { 41 | public override bool IsInstruction(Instruction instruction) => 42 | instruction.OpCode == Opcode.Add && instruction.B > 255 && instruction.C > 255; 43 | 44 | public override string GetObfuscated(ObfuscationContext context) => 45 | "Stk[Inst[OP_A]]=Const[Inst[OP_B]]+Const[Inst[OP_C]];"; 46 | 47 | public override void Mutate(Instruction instruction) 48 | { 49 | instruction.B -= 255; 50 | instruction.C -= 255; 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpBAND.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpBAND : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.BAND && instruction.B <= 255 && instruction.C <= 255; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "Stk[Inst[OP_A]]=Stk[Inst[OP_B]]&Stk[Inst[OP_C]];"; 13 | } 14 | 15 | public class OpBANDB : VOpcode 16 | { 17 | public override bool IsInstruction(Instruction instruction) => 18 | instruction.OpCode == Opcode.BAND && instruction.B > 255 && instruction.C <= 255; 19 | 20 | public override string GetObfuscated(ObfuscationContext context) => 21 | "Stk[Inst[OP_A]]=Const[Inst[OP_B]]&Stk[Inst[OP_C]];"; 22 | 23 | public override void Mutate(Instruction instruction) => 24 | instruction.B -= 255; 25 | } 26 | 27 | public class OpBANDC : VOpcode 28 | { 29 | public override bool IsInstruction(Instruction instruction) => 30 | instruction.OpCode == Opcode.BAND && instruction.B <= 255 && instruction.C > 255; 31 | 32 | public override string GetObfuscated(ObfuscationContext context) => 33 | "Stk[Inst[OP_A]]=Stk[Inst[OP_B]]&Const[Inst[OP_C]];"; 34 | 35 | public override void Mutate(Instruction instruction) => 36 | instruction.C -= 255; 37 | } 38 | 39 | public class OpBANDD : VOpcode 40 | { 41 | public override bool IsInstruction(Instruction instruction) => 42 | instruction.OpCode == Opcode.BAND && instruction.B > 255 && instruction.C > 255; 43 | 44 | public override string GetObfuscated(ObfuscationContext context) => 45 | "Stk[Inst[OP_A]]=Const[Inst[OP_B]]&Const[Inst[OP_C]];"; 46 | 47 | public override void Mutate(Instruction instruction) 48 | { 49 | instruction.B -= 255; 50 | instruction.C -= 255; 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpBLSHFT.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpBLSHFT : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.BLSHFT && instruction.B <= 255 && instruction.C <= 255; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "Stk[Inst[OP_A]]=Stk[Inst[OP_B]]< 18 | instruction.OpCode == Opcode.BLSHFT && instruction.B > 255 && instruction.C <= 255; 19 | 20 | public override string GetObfuscated(ObfuscationContext context) => 21 | "Stk[Inst[OP_A]]=Const[Inst[OP_B]]< 24 | instruction.B -= 255; 25 | } 26 | 27 | public class OpBLSHFTC : VOpcode 28 | { 29 | public override bool IsInstruction(Instruction instruction) => 30 | instruction.OpCode == Opcode.BLSHFT && instruction.B <= 255 && instruction.C > 255; 31 | 32 | public override string GetObfuscated(ObfuscationContext context) => 33 | "Stk[Inst[OP_A]]=Stk[Inst[OP_B]]< 36 | instruction.C -= 255; 37 | } 38 | 39 | public class OpBLSHFTD : VOpcode 40 | { 41 | public override bool IsInstruction(Instruction instruction) => 42 | instruction.OpCode == Opcode.BLSHFT && instruction.B > 255 && instruction.C > 255; 43 | 44 | public override string GetObfuscated(ObfuscationContext context) => 45 | "Stk[Inst[OP_A]]=Const[Inst[OP_B]]< 9 | instruction.OpCode == Opcode.BNOT; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "Stk[Inst[OP_A]]=~Stk[Inst[OP_B]];"; 13 | } 14 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpBOR.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpBOR : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.BOR && instruction.B <= 255 && instruction.C <= 255; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "Stk[Inst[OP_A]]=Stk[Inst[OP_B]]|Stk[Inst[OP_C]];"; 13 | } 14 | 15 | public class OpBORB : VOpcode 16 | { 17 | public override bool IsInstruction(Instruction instruction) => 18 | instruction.OpCode == Opcode.BOR && instruction.B > 255 && instruction.C <= 255; 19 | 20 | public override string GetObfuscated(ObfuscationContext context) => 21 | "Stk[Inst[OP_A]]=Const[Inst[OP_B]]|Stk[Inst[OP_C]];"; 22 | 23 | public override void Mutate(Instruction instruction) => 24 | instruction.B -= 255; 25 | } 26 | 27 | public class OpBORC : VOpcode 28 | { 29 | public override bool IsInstruction(Instruction instruction) => 30 | instruction.OpCode == Opcode.BOR && instruction.B <= 255 && instruction.C > 255; 31 | 32 | public override string GetObfuscated(ObfuscationContext context) => 33 | "Stk[Inst[OP_A]]=Stk[Inst[OP_B]]|Const[Inst[OP_C]];"; 34 | 35 | public override void Mutate(Instruction instruction) => 36 | instruction.C -= 255; 37 | } 38 | 39 | public class OpBORD : VOpcode 40 | { 41 | public override bool IsInstruction(Instruction instruction) => 42 | instruction.OpCode == Opcode.BOR && instruction.B > 255 && instruction.C > 255; 43 | 44 | public override string GetObfuscated(ObfuscationContext context) => 45 | "Stk[Inst[OP_A]]=Const[Inst[OP_B]]|Const[Inst[OP_C]];"; 46 | 47 | public override void Mutate(Instruction instruction) 48 | { 49 | instruction.B -= 255; 50 | instruction.C -= 255; 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpBRSHFT.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpBRSHFT : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.BRSHFT && instruction.B <= 255 && instruction.C <= 255; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "Stk[Inst[OP_A]]=Stk[Inst[OP_B]]>>Stk[Inst[OP_C]];"; 13 | } 14 | 15 | public class OpBRSHFTB : VOpcode 16 | { 17 | public override bool IsInstruction(Instruction instruction) => 18 | instruction.OpCode == Opcode.BRSHFT && instruction.B > 255 && instruction.C <= 255; 19 | 20 | public override string GetObfuscated(ObfuscationContext context) => 21 | "Stk[Inst[OP_A]]=Const[Inst[OP_B]]>>Stk[Inst[OP_C]];"; 22 | 23 | public override void Mutate(Instruction instruction) => 24 | instruction.B -= 255; 25 | } 26 | 27 | public class OpBRSHFTC : VOpcode 28 | { 29 | public override bool IsInstruction(Instruction instruction) => 30 | instruction.OpCode == Opcode.BRSHFT && instruction.B <= 255 && instruction.C > 255; 31 | 32 | public override string GetObfuscated(ObfuscationContext context) => 33 | "Stk[Inst[OP_A]]=Stk[Inst[OP_B]]>>Const[Inst[OP_C]];"; 34 | 35 | public override void Mutate(Instruction instruction) => 36 | instruction.C -= 255; 37 | } 38 | 39 | public class OpBRSHFTD : VOpcode 40 | { 41 | public override bool IsInstruction(Instruction instruction) => 42 | instruction.OpCode == Opcode.BRSHFT && instruction.B > 255 && instruction.C > 255; 43 | 44 | public override string GetObfuscated(ObfuscationContext context) => 45 | "Stk[Inst[OP_A]]=Const[Inst[OP_B]]>>Const[Inst[OP_C]];"; 46 | 47 | public override void Mutate(Instruction instruction) 48 | { 49 | instruction.B -= 255; 50 | instruction.C -= 255; 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpBXOR.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpBXOR : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.BXOR && instruction.B <= 255 && instruction.C <= 255; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "Stk[Inst[OP_A]]=Stk[Inst[OP_B]]~Stk[Inst[OP_C]];"; 13 | } 14 | 15 | public class OpBXORB : VOpcode 16 | { 17 | public override bool IsInstruction(Instruction instruction) => 18 | instruction.OpCode == Opcode.BXOR && instruction.B > 255 && instruction.C <= 255; 19 | 20 | public override string GetObfuscated(ObfuscationContext context) => 21 | "Stk[Inst[OP_A]]=Const[Inst[OP_B]]~Stk[Inst[OP_C]];"; 22 | 23 | public override void Mutate(Instruction instruction) => 24 | instruction.B -= 255; 25 | } 26 | 27 | public class OpBXORC : VOpcode 28 | { 29 | public override bool IsInstruction(Instruction instruction) => 30 | instruction.OpCode == Opcode.BXOR && instruction.B <= 255 && instruction.C > 255; 31 | 32 | public override string GetObfuscated(ObfuscationContext context) => 33 | "Stk[Inst[OP_A]]=Stk[Inst[OP_B]]~Const[Inst[OP_C]];"; 34 | 35 | public override void Mutate(Instruction instruction) => 36 | instruction.C -= 255; 37 | } 38 | 39 | public class OpBXORD : VOpcode 40 | { 41 | public override bool IsInstruction(Instruction instruction) => 42 | instruction.OpCode == Opcode.BXOR && instruction.B > 255 && instruction.C > 255; 43 | 44 | public override string GetObfuscated(ObfuscationContext context) => 45 | "Stk[Inst[OP_A]]=Const[Inst[OP_B]]~Const[Inst[OP_C]];"; 46 | 47 | public override void Mutate(Instruction instruction) 48 | { 49 | instruction.B -= 255; 50 | instruction.C -= 255; 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpCall.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpCall : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.Call && instruction.B > 1 && 10 | instruction.C > 1; 11 | 12 | public override string GetObfuscated(ObfuscationContext context) => 13 | "local A=Inst[OP_A];local Args={};local Edx=0;local Limit=A+Inst[OP_B]-1;for Idx=A+1,Limit do Edx=Edx+1;Args[Edx]=Stk[Idx];end;local Results={Stk[A](Unpack(Args,1,Limit-A))};local Limit=A+Inst[OP_C]-2;Edx=0;for Idx=A,Limit do Edx=Edx+1;Stk[Idx]=Results[Edx];end;Top=Limit;"; 14 | } 15 | 16 | public class OpCallB0 : VOpcode 17 | { 18 | public override bool IsInstruction(Instruction instruction) => 19 | instruction.OpCode == Opcode.Call && instruction.B == 0 && 20 | instruction.C > 1; 21 | 22 | public override string GetObfuscated(ObfuscationContext context) => 23 | "local A=Inst[OP_A];local Args={};local Edx=0;local Limit=Top;for Idx=A+1,Limit do Edx=Edx+1;Args[Edx]=Stk[Idx];end;local Results={Stk[A](Unpack(Args,1,Limit-A))};local Limit=A+Inst[OP_C]-2;Edx=0;for Idx=A,Limit do Edx=Edx+1;Stk[Idx]=Results[Edx];end;Top=Limit;"; 24 | } 25 | 26 | public class OpCallB1 : VOpcode 27 | { 28 | public override bool IsInstruction(Instruction instruction) => 29 | instruction.OpCode == Opcode.Call && instruction.B == 1 && 30 | instruction.C > 1; 31 | 32 | public override string GetObfuscated(ObfuscationContext context) => 33 | "local A=Inst[OP_A];local Results,Limit={Stk[A]()};local Limit=A+Inst[OP_C]-2;local Edx=0;for Idx=A,Limit do Edx=Edx+1;Stk[Idx]=Results[Edx];end;Top=Limit;"; 34 | } 35 | 36 | public class OpCallC0 : VOpcode 37 | { 38 | public override bool IsInstruction(Instruction instruction) => 39 | instruction.OpCode == Opcode.Call && instruction.B > 1 && 40 | instruction.C == 0; 41 | 42 | public override string GetObfuscated(ObfuscationContext context) => 43 | "local A=Inst[OP_A];local Args={};local Edx=0;local Limit=A+Inst[OP_B]-1;for Idx=A+1,Limit do Edx=Edx+1;Args[Edx]=Stk[Idx];end;local Results,Limit=_R(Stk[A](Unpack(Args,1,Limit-A)));Limit=Limit+A-1;Edx=0;for Idx=A,Limit do Edx=Edx+1;Stk[Idx]=Results[Edx];end;Top=Limit;"; 44 | } 45 | 46 | public class OpCallC1 : VOpcode 47 | { 48 | public override bool IsInstruction(Instruction instruction) => 49 | instruction.OpCode == Opcode.Call && instruction.B > 1 && 50 | instruction.C == 1; 51 | 52 | public override string GetObfuscated(ObfuscationContext context) => 53 | "local A=Inst[OP_A];local Args={};local Edx=0;local Limit=A+Inst[OP_B]-1;for Idx=A+1,Limit do Edx=Edx+1;Args[Edx]=Stk[Idx];end;Stk[A](Unpack(Args,1,Limit-A));Top=A;"; 54 | } 55 | 56 | public class OpCallB0C0 : VOpcode 57 | { 58 | public override bool IsInstruction(Instruction instruction) => 59 | instruction.OpCode == Opcode.Call && instruction.B == 0 && 60 | instruction.C == 0; 61 | 62 | public override string GetObfuscated(ObfuscationContext context) => 63 | "local A=Inst[OP_A];local Args={};local Edx=0;local Limit=Top;for Idx=A+1,Limit do Edx=Edx+1;Args[Edx]=Stk[Idx];end;local Results,Limit=_R(Stk[A](Unpack(Args,1,Limit-A)));Limit=Limit+A-1;Edx=0;for Idx=A,Limit do Edx=Edx+1;Stk[Idx]=Results[Edx];end;Top=Limit;"; 64 | } 65 | 66 | public class OpCallB0C1 : VOpcode 67 | { 68 | public override bool IsInstruction(Instruction instruction) => 69 | instruction.OpCode == Opcode.Call && instruction.B == 0 && 70 | instruction.C == 1; 71 | 72 | public override string GetObfuscated(ObfuscationContext context) => 73 | "local A=Inst[OP_A];local Args={};local Edx=0;local Limit=Top;for Idx=A+1,Limit do Edx=Edx+1;Args[Edx]=Stk[Idx];end;Stk[A](Unpack(Args,1,Limit-A));Top=A;"; 74 | } 75 | 76 | public class OpCallB1C0 : VOpcode 77 | { 78 | public override bool IsInstruction(Instruction instruction) => 79 | instruction.OpCode == Opcode.Call && instruction.B == 1 && 80 | instruction.C == 0; 81 | 82 | public override string GetObfuscated(ObfuscationContext context) => 83 | "local A=Inst[OP_A];local Results,Limit=_R(Stk[A]());Top=A-1;Limit=Limit+A-1;local Edx=0;for Idx=A,Limit do Edx=Edx+1;Stk[Idx]=Results[Edx];end;Top=Limit;"; 84 | } 85 | 86 | public class OpCallB1C1 : VOpcode 87 | { 88 | public override bool IsInstruction(Instruction instruction) => 89 | instruction.OpCode == Opcode.Call && instruction.B == 1 && 90 | instruction.C == 1; 91 | 92 | public override string GetObfuscated(ObfuscationContext context) => 93 | "Stk[Inst[OP_A]]();Top=A;"; 94 | } 95 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpClose.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpClose : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.Close; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "local A=Inst[OP_A];local Cls={};for Idx=1,#Lupvals do local List=Lupvals[Idx];for Idz=0,#List do local Upv=List[Idz];local NStk=Upv[1];local Pos=Upv[2]; if NStk==Stk and Pos>=A then Cls[Pos]=NStk[Pos];Upv[1]=Cls;end;end;end;"; 13 | } 14 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpClosure.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using EssaFuscator.Bytecode_Library.Bytecode; 3 | using EssaFuscator.Bytecode_Library.IR; 4 | 5 | namespace EssaFuscator.Obfuscator.Opcodes 6 | { 7 | public class OpClosure : VOpcode 8 | { 9 | public override bool IsInstruction(Instruction instruction) => 10 | instruction.OpCode == Opcode.Closure && instruction.Chunk.Functions[instruction.B].UpvalueCount > 0; 11 | 12 | public override string GetObfuscated(ObfuscationContext context) 13 | { 14 | context.InstructionMapping.TryGetValue(Opcode.Move, out var i1); 15 | 16 | return 17 | "local NewProto=Proto[Inst[OP_B]];local NewUvals;local Indexes={};NewUvals=Setmetatable({},{__index=function(_,Key)local Val=Indexes[Key];return Val[1][Val[2]];end,__newindex=function(_,Key,Value)local Val=Indexes[Key] Val[1][Val[2]]=Value;end;});for Idx=1,Inst[OP_C] do InstrPoint=InstrPoint+1;local Mvm=Instr[InstrPoint];if Mvm[OP_ENUM]==OP_MOVE then Indexes[Idx-1]={Stk,Mvm[OP_B]};else Indexes[Idx-1]={Upvalues,Mvm[OP_B]};end;Lupvals[#Lupvals+1]=Indexes;end;Stk[Inst[OP_A]]=EssaSubway(NewProto,NewUvals,Env);" 18 | .Replace("OP_MOVE", i1?.VIndex.ToString() ?? "-1"); 19 | } 20 | 21 | public override void Mutate(Instruction instruction) 22 | { 23 | instruction.InstructionType = InstructionType.AsBxC; 24 | instruction.C = instruction.Chunk.Functions[instruction.B].UpvalueCount; 25 | } 26 | } 27 | 28 | public class OpClosureNU : VOpcode 29 | { 30 | public override bool IsInstruction(Instruction instruction) => 31 | instruction.OpCode == Opcode.Closure && instruction.Chunk.Functions[instruction.B].UpvalueCount == 0; 32 | 33 | public override string GetObfuscated(ObfuscationContext context) => 34 | "Stk[Inst[OP_A]]=EssaSubway(Proto[Inst[OP_B]],nil,Env);"; 35 | } 36 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpConcat.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpConcat : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.Concat; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "local B=Inst[OP_B];local K=Stk[B] for Idx=B+1,Inst[OP_C] do K=K..Stk[Idx];end;Stk[Inst[OP_A]]=K;"; 13 | } 14 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpDiv.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpDiv : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.Div && instruction.B <= 255 && instruction.C <= 255; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "Stk[Inst[OP_A]]=Stk[Inst[OP_B]]/Stk[Inst[OP_C]];"; 13 | } 14 | 15 | public class OpDivB : VOpcode 16 | { 17 | public override bool IsInstruction(Instruction instruction) => 18 | instruction.OpCode == Opcode.Div && instruction.B > 255 && instruction.C <= 255; 19 | 20 | public override string GetObfuscated(ObfuscationContext context) => 21 | "Stk[Inst[OP_A]]=Const[Inst[OP_B]]/Stk[Inst[OP_C]];"; 22 | 23 | public override void Mutate(Instruction instruction) => 24 | instruction.B -= 255; 25 | } 26 | 27 | public class OpDivC : VOpcode 28 | { 29 | public override bool IsInstruction(Instruction instruction) => 30 | instruction.OpCode == Opcode.Div && instruction.B <= 255 && instruction.C > 255; 31 | 32 | public override string GetObfuscated(ObfuscationContext context) => 33 | "Stk[Inst[OP_A]]=Stk[Inst[OP_B]]/Const[Inst[OP_C]];"; 34 | 35 | public override void Mutate(Instruction instruction) => 36 | instruction.C -= 255; 37 | } 38 | 39 | public class OpDivBC : VOpcode 40 | { 41 | public override bool IsInstruction(Instruction instruction) => 42 | instruction.OpCode == Opcode.Div && instruction.B > 255 && instruction.C > 255; 43 | 44 | public override string GetObfuscated(ObfuscationContext context) => 45 | "Stk[Inst[OP_A]]=Const[Inst[OP_B]]/Const[Inst[OP_C]];"; 46 | 47 | public override void Mutate(Instruction instruction) 48 | { 49 | instruction.B -= 255; 50 | instruction.C -= 255; 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpEq.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpEq : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.Eq && instruction.A == 0 && instruction.B <= 255 && instruction.C <= 255; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "if(Stk[Inst[OP_A]]==Stk[Inst[OP_C]])then InstrPoint=InstrPoint+1;else InstrPoint=InstrPoint+Inst[OP_B];end;"; 13 | 14 | public override void Mutate(Instruction instruction) 15 | { 16 | instruction.A = instruction.B; 17 | 18 | instruction.B = instruction.Chunk.Instructions[instruction.PC + 1].B + 1; 19 | instruction.InstructionType = InstructionType.AsBxC; 20 | } 21 | } 22 | 23 | public class OpEqB : VOpcode 24 | { 25 | public override bool IsInstruction(Instruction instruction) => 26 | instruction.OpCode == Opcode.Eq && instruction.A == 0 && instruction.B > 255 && instruction.C <= 255; 27 | 28 | public override string GetObfuscated(ObfuscationContext context) => 29 | "if(Const[Inst[OP_A]]==Stk[Inst[OP_C]])then InstrPoint=InstrPoint+1;else InstrPoint=InstrPoint+Inst[OP_B];end;"; 30 | 31 | public override void Mutate(Instruction instruction) 32 | { 33 | instruction.A = instruction.B - 255; 34 | 35 | instruction.B = instruction.Chunk.Instructions[instruction.PC + 1].B + 1; 36 | instruction.InstructionType = InstructionType.AsBxC; 37 | } 38 | } 39 | 40 | public class OpEqC : VOpcode 41 | { 42 | public override bool IsInstruction(Instruction instruction) => 43 | instruction.OpCode == Opcode.Eq && instruction.A == 0 && instruction.B <= 255 && instruction.C > 255; 44 | 45 | public override string GetObfuscated(ObfuscationContext context) => 46 | "if(Stk[Inst[OP_A]]==Const[Inst[OP_C]])then InstrPoint=InstrPoint+1;else InstrPoint=InstrPoint+Inst[OP_B];end;"; 47 | 48 | public override void Mutate(Instruction instruction) 49 | { 50 | instruction.A = instruction.B; 51 | instruction.C -= 255; 52 | 53 | instruction.B = instruction.Chunk.Instructions[instruction.PC + 1].B + 1; 54 | instruction.InstructionType = InstructionType.AsBxC; 55 | } 56 | } 57 | 58 | public class OpEqBC : VOpcode 59 | { 60 | public override bool IsInstruction(Instruction instruction) => 61 | instruction.OpCode == Opcode.Eq && instruction.A == 0 && instruction.B > 255 && instruction.C > 255; 62 | 63 | public override string GetObfuscated(ObfuscationContext context) => 64 | "if(Const[Inst[OP_A]]==Const[Inst[OP_C]]) then InstrPoint=InstrPoint+1;else InstrPoint=InstrPoint+Inst[OP_B];end;"; 65 | 66 | public override void Mutate(Instruction instruction) 67 | { 68 | instruction.A = instruction.B - 255; 69 | instruction.C -= 255; 70 | 71 | instruction.B = instruction.Chunk.Instructions[instruction.PC + 1].B + 1; 72 | instruction.InstructionType = InstructionType.AsBxC; 73 | } 74 | } 75 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpForLoop.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpForLoop : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.ForLoop; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "local A=Inst[OP_A];local Step=Stk[A+2];local Index=Stk[A]+Step;Stk[A]=Index;if Step>0 then if Index<=Stk[A+1] then InstrPoint=InstrPoint+Inst[OP_B];Stk[A+3]=Index;end;elseif Index>=Stk[A+1] then InstrPoint=InstrPoint+Inst[OP_B];Stk[A+3]=Index;end;"; 13 | } 14 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpForPrep.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpForPrep : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.ForPrep; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "local A=Inst[OP_A];Stk[A]=Stk[A]-Stk[A+2];InstrPoint=InstrPoint+Inst[OP_B];"; 13 | } 14 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpGe.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpGe : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.Lt && instruction.A != 0 && instruction.B <= 255 && instruction.C <= 255; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "if(Stk[Inst[OP_A]]>=Stk[Inst[OP_C]])then InstrPoint=InstrPoint+1;else InstrPoint=InstrPoint+Inst[OP_B];end;"; 13 | 14 | public override void Mutate(Instruction instruction) 15 | { 16 | instruction.A = instruction.B; 17 | 18 | instruction.B = instruction.Chunk.Instructions[instruction.PC + 1].B + 1; 19 | instruction.InstructionType = InstructionType.AsBxC; 20 | } 21 | } 22 | 23 | public class OpGeB : VOpcode 24 | { 25 | public override bool IsInstruction(Instruction instruction) => 26 | instruction.OpCode == Opcode.Lt && instruction.A != 0 && instruction.B > 255 && instruction.C <= 255; 27 | 28 | public override string GetObfuscated(ObfuscationContext context) => 29 | "if(Const[Inst[OP_A]]>=Stk[Inst[OP_C]])then InstrPoint=InstrPoint+1;else InstrPoint=InstrPoint+Inst[OP_B];end;"; 30 | 31 | public override void Mutate(Instruction instruction) 32 | { 33 | instruction.A = instruction.B - 255; 34 | instruction.B -= 255; 35 | 36 | instruction.B = instruction.Chunk.Instructions[instruction.PC + 1].B + 1; 37 | instruction.InstructionType = InstructionType.AsBxC; 38 | } 39 | } 40 | 41 | public class OpGeC : VOpcode 42 | { 43 | public override bool IsInstruction(Instruction instruction) => 44 | instruction.OpCode == Opcode.Lt && instruction.A != 0 && instruction.B <= 255 && instruction.C > 255; 45 | 46 | public override string GetObfuscated(ObfuscationContext context) => 47 | "if(Stk[Inst[OP_A]]>=Const[Inst[OP_C]])then InstrPoint=InstrPoint+1;else InstrPoint=InstrPoint+Inst[OP_B];end;"; 48 | 49 | public override void Mutate(Instruction instruction) 50 | { 51 | instruction.A = instruction.B; 52 | instruction.C -= 255; 53 | 54 | instruction.B = instruction.Chunk.Instructions[instruction.PC + 1].B + 1; 55 | instruction.InstructionType = InstructionType.AsBxC; 56 | } 57 | } 58 | 59 | public class OpGeBC : VOpcode 60 | { 61 | public override bool IsInstruction(Instruction instruction) => 62 | instruction.OpCode == Opcode.Lt && instruction.A != 0 && instruction.B > 255 && instruction.C > 255; 63 | 64 | public override string GetObfuscated(ObfuscationContext context) => 65 | "if(Const[Inst[OP_A]]>=Const[Inst[OP_C]])then InstrPoint=InstrPoint+1;else InstrPoint=InstrPoint+Inst[OP_B];end;"; 66 | 67 | public override void Mutate(Instruction instruction) 68 | { 69 | instruction.A = instruction.B - 255; 70 | instruction.C -= 255; 71 | 72 | instruction.B = instruction.Chunk.Instructions[instruction.PC + 1].B + 1; 73 | instruction.InstructionType = InstructionType.AsBxC; 74 | } 75 | } 76 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpGetGlobal.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpGetGlobal : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.GetGlobal; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "Stk[Inst[OP_A]]=Env[Const[Inst[OP_B]]];"; 13 | 14 | public override void Mutate(Instruction instruction) => 15 | instruction.B++; 16 | } 17 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpGetTable.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpGetTable : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.GetTable && instruction.C <= 255; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "Stk[Inst[OP_A]]=Stk[Inst[OP_B]][Stk[Inst[OP_C]]];"; 13 | } 14 | 15 | public class OpGetTableConst : VOpcode 16 | { 17 | public override bool IsInstruction(Instruction instruction) => 18 | instruction.OpCode == Opcode.GetTable && instruction.C > 255; 19 | 20 | public override string GetObfuscated(ObfuscationContext context) => 21 | "Stk[Inst[OP_A]]=Stk[Inst[OP_B]][Const[Inst[OP_C]]];"; 22 | 23 | public override void Mutate(Instruction instruction) => 24 | instruction.C -= 255; 25 | } 26 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpGetUpval.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpGetUpval : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.GetUpval; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "Stk[Inst[OP_A]]=Upvalues[Inst[OP_B]];"; 13 | } 14 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpGt.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpGt : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.Le && instruction.A != 0 && instruction.B <= 255 && instruction.C <= 255; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "if(Stk[Inst[OP_A]]>Stk[Inst[OP_C]])then InstrPoint=InstrPoint+1;else InstrPoint=InstrPoint+Inst[OP_B];end;"; 13 | 14 | public override void Mutate(Instruction instruction) 15 | { 16 | instruction.A = instruction.B; 17 | 18 | instruction.B = instruction.Chunk.Instructions[instruction.PC + 1].B + 1; 19 | instruction.InstructionType = InstructionType.AsBxC; 20 | } 21 | } 22 | 23 | public class OpGtB : VOpcode 24 | { 25 | public override bool IsInstruction(Instruction instruction) => 26 | instruction.OpCode == Opcode.Le && instruction.A != 0 && instruction.B > 255 && instruction.C <= 255; 27 | 28 | public override string GetObfuscated(ObfuscationContext context) => 29 | "if(Const[Inst[OP_A]]>Stk[Inst[OP_C]])then InstrPoint=InstrPoint+1;else InstrPoint=InstrPoint+Inst[OP_B];end;"; 30 | 31 | public override void Mutate(Instruction instruction) 32 | { 33 | instruction.A = instruction.B - 255; 34 | 35 | instruction.B = instruction.Chunk.Instructions[instruction.PC + 1].B + 1; 36 | instruction.InstructionType = InstructionType.AsBxC; 37 | } 38 | } 39 | 40 | public class OpGtC : VOpcode 41 | { 42 | public override bool IsInstruction(Instruction instruction) => 43 | instruction.OpCode == Opcode.Le && instruction.A != 0 && instruction.B <= 255 && instruction.C > 255; 44 | 45 | public override string GetObfuscated(ObfuscationContext context) => 46 | "if(Stk[Inst[OP_A]]>Const[Inst[OP_C]])then InstrPoint=InstrPoint+1;else InstrPoint=InstrPoint+Inst[OP_B];end;"; 47 | 48 | public override void Mutate(Instruction instruction) 49 | { 50 | instruction.A = instruction.B; 51 | instruction.C -= 255; 52 | 53 | instruction.B = instruction.Chunk.Instructions[instruction.PC + 1].B + 1; 54 | instruction.InstructionType = InstructionType.AsBxC; 55 | } 56 | } 57 | 58 | public class OpGtBC : VOpcode 59 | { 60 | public override bool IsInstruction(Instruction instruction) => 61 | instruction.OpCode == Opcode.Le && instruction.A != 0 && instruction.B > 255 && instruction.C > 255; 62 | 63 | public override string GetObfuscated(ObfuscationContext context) => 64 | "if(Const[Inst[OP_A]]>Const[Inst[OP_C]])then InstrPoint=InstrPoint+1;else InstrPoint=InstrPoint+Inst[OP_B];end;"; 65 | 66 | public override void Mutate(Instruction instruction) 67 | { 68 | instruction.A = instruction.B - 255; 69 | instruction.C -= 255; 70 | 71 | instruction.B = instruction.Chunk.Instructions[instruction.PC + 1].B + 1; 72 | instruction.InstructionType = InstructionType.AsBxC; 73 | } 74 | } 75 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpINTDIV.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpINTDIV : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.INTDIV && instruction.B <= 255 && instruction.C <= 255; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "Stk[Inst[OP_A]]=Stk[Inst[OP_B]]//Stk[Inst[OP_C]];"; 13 | } 14 | 15 | public class OpINTDIVB : VOpcode 16 | { 17 | public override bool IsInstruction(Instruction instruction) => 18 | instruction.OpCode == Opcode.INTDIV && instruction.B > 255 && instruction.C <= 255; 19 | 20 | public override string GetObfuscated(ObfuscationContext context) => 21 | "Stk[Inst[OP_A]]=Const[Inst[OP_B]]//Stk[Inst[OP_C]];"; 22 | 23 | public override void Mutate(Instruction instruction) => 24 | instruction.B -= 255; 25 | } 26 | 27 | public class OpINTDIVC : VOpcode 28 | { 29 | public override bool IsInstruction(Instruction instruction) => 30 | instruction.OpCode == Opcode.INTDIV && instruction.B <= 255 && instruction.C > 255; 31 | 32 | public override string GetObfuscated(ObfuscationContext context) => 33 | "Stk[Inst[OP_A]]=Stk[Inst[OP_B]]//Const[Inst[OP_C]];"; 34 | 35 | public override void Mutate(Instruction instruction) => 36 | instruction.C -= 255; 37 | } 38 | 39 | public class OpINTDIVBC : VOpcode 40 | { 41 | public override bool IsInstruction(Instruction instruction) => 42 | instruction.OpCode == Opcode.INTDIV && instruction.B > 255 && instruction.C > 255; 43 | 44 | public override string GetObfuscated(ObfuscationContext context) => 45 | "Stk[Inst[OP_A]]=Const[Inst[OP_B]]//Const[Inst[OP_C]];"; 46 | 47 | public override void Mutate(Instruction instruction) 48 | { 49 | instruction.B -= 255; 50 | instruction.C -= 255; 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpJmp.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpJmp : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.Jmp; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "InstrPoint=InstrPoint+Inst[OP_B];"; 13 | } 14 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpLe.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpLe : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.Le && instruction.A == 0 && instruction.B <= 255 && instruction.C <= 255; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "if(Stk[Inst[OP_A]]<=Stk[Inst[OP_C]])then InstrPoint=InstrPoint+1;else InstrPoint=InstrPoint+Inst[OP_B];end;"; 13 | 14 | public override void Mutate(Instruction instruction) 15 | { 16 | instruction.A = instruction.B; 17 | 18 | instruction.B = instruction.Chunk.Instructions[instruction.PC + 1].B + 1; 19 | instruction.InstructionType = InstructionType.AsBxC; 20 | } 21 | } 22 | 23 | public class OpLeB : VOpcode 24 | { 25 | public override bool IsInstruction(Instruction instruction) => 26 | instruction.OpCode == Opcode.Le && instruction.A == 0 && instruction.B > 255 && instruction.C <= 255; 27 | 28 | public override string GetObfuscated(ObfuscationContext context) => 29 | "if(Const[Inst[OP_A]]<=Stk[Inst[OP_C]])then InstrPoint=InstrPoint+1;else InstrPoint=InstrPoint+Inst[OP_B];end;"; 30 | 31 | public override void Mutate(Instruction instruction) 32 | { 33 | instruction.A = instruction.B - 255; 34 | 35 | instruction.B = instruction.Chunk.Instructions[instruction.PC + 1].B + 1; 36 | instruction.InstructionType = InstructionType.AsBxC; 37 | } 38 | } 39 | 40 | public class OpLeC : VOpcode 41 | { 42 | public override bool IsInstruction(Instruction instruction) => 43 | instruction.OpCode == Opcode.Le && instruction.A == 0 && instruction.B <= 255 && instruction.C > 255; 44 | 45 | public override string GetObfuscated(ObfuscationContext context) => 46 | "if(Stk[Inst[OP_A]]<=Const[Inst[OP_C]])then InstrPoint=InstrPoint+1;else InstrPoint=InstrPoint+Inst[OP_B];end;"; 47 | 48 | public override void Mutate(Instruction instruction) 49 | { 50 | instruction.A = instruction.B; 51 | instruction.C -= 255; 52 | 53 | instruction.B = instruction.Chunk.Instructions[instruction.PC + 1].B + 1; 54 | instruction.InstructionType = InstructionType.AsBxC; 55 | } 56 | } 57 | 58 | public class OpLeBC : VOpcode 59 | { 60 | public override bool IsInstruction(Instruction instruction) => 61 | instruction.OpCode == Opcode.Le && instruction.A == 0 && instruction.B > 255 && instruction.C > 255; 62 | 63 | public override string GetObfuscated(ObfuscationContext context) => 64 | "if(Const[Inst[OP_A]]<=Const[Inst[OP_C]])then InstrPoint=InstrPoint+1;else InstrPoint=InstrPoint+Inst[OP_B];end;"; 65 | 66 | public override void Mutate(Instruction instruction) 67 | { 68 | instruction.A = instruction.B - 255; 69 | instruction.C -= 255; 70 | 71 | instruction.B = instruction.Chunk.Instructions[instruction.PC + 1].B + 1; 72 | instruction.InstructionType = InstructionType.AsBxC; 73 | } 74 | } 75 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpLen.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpLen : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.Len; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "Stk[Inst[OP_A]]=#Stk[Inst[OP_B]];"; 13 | } 14 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpLoadBool.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpLoadBool : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.LoadBool && instruction.C == 0; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "Stk[Inst[OP_A]]=(Inst[OP_B]~=0);"; 13 | } 14 | 15 | public class OpLoadBoolC : VOpcode 16 | { 17 | public override bool IsInstruction(Instruction instruction) => 18 | instruction.OpCode == Opcode.LoadBool && instruction.C != 0; 19 | 20 | public override string GetObfuscated(ObfuscationContext context) => 21 | "Stk[Inst[OP_A]]=(Inst[OP_B]~=0);InstrPoint=InstrPoint+1;"; 22 | 23 | public override void Mutate(Instruction ins) => 24 | ins.C = 0; 25 | } 26 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpLoadK.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpLoadK : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.LoadConst; // && instruction.Chunk.Constants[instruction.B].Type != ConstantType.String; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "Stk[Inst[OP_A]]=Const[Inst[OP_B]];"; 13 | 14 | public override void Mutate(Instruction instruction) => 15 | instruction.B++; 16 | } 17 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpLoadNil.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpLoadNil : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.LoadNil; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "for Idx=Inst[OP_A],Inst[OP_B] do Stk[Idx]=nil;end;"; 13 | } 14 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpLoadStr.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | //public class OpLoadStr : VOpcode 7 | //{ 8 | //public override bool IsInstruction(Instruction instruction) => 9 | // instruction.OpCode == Opcode.LoadConst && instruction.Chunk.Constants[instruction.B].Type == ConstantType.String; 10 | // 11 | //public override string GetObfuscated(ObfuscationContext context) => 12 | // "Stk[Inst[OP_A]]=Strt[Inst[OP_B]];"; 13 | // 14 | //public override void Mutate(Instruction instruction) => 15 | // instruction.B++; 16 | //} 17 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpLt.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpLt : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.Lt && instruction.A == 0 && instruction.B <= 255 && instruction.C <= 255; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "if(Stk[Inst[OP_A]] 26 | instruction.OpCode == Opcode.Lt && instruction.A == 0 && instruction.B > 255 && instruction.C <= 255; 27 | 28 | public override string GetObfuscated(ObfuscationContext context) => 29 | "if(Const[Inst[OP_A]] 43 | instruction.OpCode == Opcode.Lt && instruction.A == 0 && instruction.B <= 255 && instruction.C > 255; 44 | 45 | public override string GetObfuscated(ObfuscationContext context) => 46 | "if(Stk[Inst[OP_A]] 61 | instruction.OpCode == Opcode.Lt && instruction.A == 0 && instruction.B > 255 && instruction.C > 255; 62 | 63 | public override string GetObfuscated(ObfuscationContext context) => 64 | "if(Const[Inst[OP_A]] 9 | instruction.OpCode == Opcode.Mod && instruction.B <= 255 && instruction.C <= 255; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "Stk[Inst[OP_A]]=Stk[Inst[OP_B]]%Stk[Inst[OP_C]];"; 13 | } 14 | 15 | public class OpModB : VOpcode 16 | { 17 | public override bool IsInstruction(Instruction instruction) => 18 | instruction.OpCode == Opcode.Mod && instruction.B > 255 && instruction.C <= 255; 19 | 20 | public override string GetObfuscated(ObfuscationContext context) => 21 | "Stk[Inst[OP_A]]=Const[Inst[OP_B]]%Stk[Inst[OP_C]];"; 22 | 23 | public override void Mutate(Instruction instruction) => 24 | instruction.B -= 255; 25 | } 26 | 27 | public class OpModC : VOpcode 28 | { 29 | public override bool IsInstruction(Instruction instruction) => 30 | instruction.OpCode == Opcode.Mod && instruction.B <= 255 && instruction.C > 255; 31 | 32 | public override string GetObfuscated(ObfuscationContext context) => 33 | "Stk[Inst[OP_A]]=Stk[Inst[OP_B]]%Const[Inst[OP_C]];"; 34 | 35 | public override void Mutate(Instruction instruction) => 36 | instruction.C -= 255; 37 | } 38 | 39 | public class OpModBC : VOpcode 40 | { 41 | public override bool IsInstruction(Instruction instruction) => 42 | instruction.OpCode == Opcode.Mod && instruction.B > 255 && instruction.C > 255; 43 | 44 | public override string GetObfuscated(ObfuscationContext context) => 45 | "Stk[Inst[OP_A]]=Const[Inst[OP_B]]%Const[Inst[OP_C]];"; 46 | 47 | public override void Mutate(Instruction instruction) 48 | { 49 | instruction.B -= 255; 50 | instruction.C -= 255; 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpMove.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpMove : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.Move; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "Stk[Inst[OP_A]]=Stk[Inst[OP_B]];"; 13 | } 14 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpMul.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpMul : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.Mul && instruction.B <= 255 && instruction.C <= 255; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "Stk[Inst[OP_A]]=Stk[Inst[OP_B]]*Stk[Inst[OP_C]];"; 13 | } 14 | 15 | public class OpMulB : VOpcode 16 | { 17 | public override bool IsInstruction(Instruction instruction) => 18 | instruction.OpCode == Opcode.Mul && instruction.B > 255 && instruction.C <= 255; 19 | 20 | public override string GetObfuscated(ObfuscationContext context) => 21 | "Stk[Inst[OP_A]]=Const[Inst[OP_B]]*Stk[Inst[OP_C]];"; 22 | 23 | public override void Mutate(Instruction instruction) => 24 | instruction.B -= 255; 25 | } 26 | 27 | public class OpMulC : VOpcode 28 | { 29 | public override bool IsInstruction(Instruction instruction) => 30 | instruction.OpCode == Opcode.Mul && instruction.B <= 255 && instruction.C > 255; 31 | 32 | public override string GetObfuscated(ObfuscationContext context) => 33 | "Stk[Inst[OP_A]]=Stk[Inst[OP_B]]*Const[Inst[OP_C]];"; 34 | 35 | public override void Mutate(Instruction instruction) => 36 | instruction.C -= 255; 37 | } 38 | 39 | public class OpMulBC : VOpcode 40 | { 41 | public override bool IsInstruction(Instruction instruction) => 42 | instruction.OpCode == Opcode.Mul && instruction.B > 255 && instruction.C > 255; 43 | 44 | public override string GetObfuscated(ObfuscationContext context) => 45 | "Stk[Inst[OP_A]]=Const[Inst[OP_B]]*Const[Inst[OP_C]];"; 46 | 47 | public override void Mutate(Instruction instruction) 48 | { 49 | instruction.B -= 255; 50 | instruction.C -= 255; 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpMutated.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using EssaFuscator.Bytecode_Library.IR; 5 | 6 | namespace EssaFuscator.Obfuscator.Opcodes 7 | { 8 | public class OpMutated : VOpcode 9 | { 10 | public static Random rand = new Random(); 11 | 12 | public VOpcode Mutated; 13 | public int[] Registers; 14 | 15 | public static string[] RegisterReplacements = {"OP__A", "OP__B", "OP__C"}; 16 | 17 | public override bool IsInstruction(Instruction instruction) => 18 | false; 19 | 20 | public bool CheckInstruction() => 21 | rand.Next(1, 15) == 1; 22 | 23 | public override string GetObfuscated(ObfuscationContext context) 24 | { 25 | return Mutated.GetObfuscated(context); 26 | } 27 | 28 | public override void Mutate(Instruction instruction) 29 | { 30 | Mutated.Mutate(instruction); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpNe.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpNe : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.Eq && instruction.A != 0 && instruction.B <= 255 && instruction.C <= 255; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "if(Stk[Inst[OP_A]]~=Stk[Inst[OP_C]])then InstrPoint=InstrPoint+1;else InstrPoint=InstrPoint+Inst[OP_B];end;"; 13 | 14 | public override void Mutate(Instruction instruction) 15 | { 16 | instruction.A = instruction.B; 17 | 18 | instruction.B = instruction.Chunk.Instructions[instruction.PC + 1].B + 1; 19 | instruction.InstructionType = InstructionType.AsBxC; 20 | } 21 | } 22 | 23 | public class OpNeB : VOpcode 24 | { 25 | public override bool IsInstruction(Instruction instruction) => 26 | instruction.OpCode == Opcode.Eq && instruction.A != 0 && instruction.B > 255 && instruction.C <= 255; 27 | 28 | public override string GetObfuscated(ObfuscationContext context) => 29 | "if(Const[Inst[OP_A]]~=Stk[Inst[OP_C]])then InstrPoint=InstrPoint+1;else InstrPoint=InstrPoint+Inst[OP_B];end;"; 30 | 31 | public override void Mutate(Instruction instruction) 32 | { 33 | instruction.A = instruction.B - 255; 34 | 35 | instruction.B = instruction.Chunk.Instructions[instruction.PC + 1].B + 1; 36 | instruction.InstructionType = InstructionType.AsBxC; 37 | } 38 | } 39 | 40 | public class OpNeC : VOpcode 41 | { 42 | public override bool IsInstruction(Instruction instruction) => 43 | instruction.OpCode == Opcode.Eq && instruction.A != 0 && instruction.B <= 255 && instruction.C > 255; 44 | 45 | public override string GetObfuscated(ObfuscationContext context) => 46 | "if(Stk[Inst[OP_A]]~=Const[Inst[OP_C]])then InstrPoint=InstrPoint+1;else InstrPoint=InstrPoint+Inst[OP_B];end;"; 47 | 48 | public override void Mutate(Instruction instruction) 49 | { 50 | instruction.A = instruction.B; 51 | instruction.C -= 255; 52 | 53 | instruction.B = instruction.Chunk.Instructions[instruction.PC + 1].B + 1; 54 | instruction.InstructionType = InstructionType.AsBxC; 55 | } 56 | } 57 | 58 | public class OpNeBC : VOpcode 59 | { 60 | public override bool IsInstruction(Instruction instruction) => 61 | instruction.OpCode == Opcode.Eq && instruction.A != 0 && instruction.B > 255 && instruction.C > 255; 62 | 63 | public override string GetObfuscated(ObfuscationContext context) => 64 | "if(Const[Inst[OP_A]]~=Const[Inst[OP_C]])then InstrPoint=InstrPoint+1;else InstrPoint=InstrPoint+Inst[OP_B];end;"; 65 | 66 | public override void Mutate(Instruction instruction) 67 | { 68 | instruction.A = instruction.B - 255; 69 | instruction.C -= 255; 70 | 71 | instruction.B = instruction.Chunk.Instructions[instruction.PC + 1].B + 1; 72 | instruction.InstructionType = InstructionType.AsBxC; 73 | } 74 | } 75 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpNewStk.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpNewStk : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.NewStack; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "Stk = {};for Idx = 0, PCount do if Idx < Params then Stk[Idx] = Args[Idx + 1]; else break end; end;"; 13 | } 14 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpNewTable.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpNewTableB0 : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.NewTable && instruction.B == 0; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "Stk[Inst[OP_A]]={};"; 13 | } 14 | 15 | public class OpNewTableB5000 : VOpcode 16 | { 17 | public override bool IsInstruction(Instruction instruction) => 18 | instruction.OpCode == Opcode.NewTable && instruction.B > 5000; 19 | 20 | public override string GetObfuscated(ObfuscationContext context) => 21 | "Stk[Inst[OP_A]]={};"; 22 | } 23 | 24 | public class OpNewTableBElse : VOpcode 25 | { 26 | public override bool IsInstruction(Instruction instruction) => 27 | instruction.OpCode == Opcode.NewTable && instruction.B > 0 && instruction.B <= 5000; 28 | 29 | public override string GetObfuscated(ObfuscationContext context) => 30 | "Stk[Inst[OP_A]]={table.unpack({}, 1, Inst[OP_B])};"; 31 | } 32 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpNot.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpNot : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.Not; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "Stk[Inst[OP_A]]=(not Stk[Inst[OP_B]]);"; 13 | } 14 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpPow.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpPow : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.Pow && instruction.B <= 255 && instruction.C <= 255; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "Stk[Inst[OP_A]]=Stk[Inst[OP_B]]^Stk[Inst[OP_C]];"; 13 | } 14 | 15 | public class OpPowB : VOpcode 16 | { 17 | public override bool IsInstruction(Instruction instruction) => 18 | instruction.OpCode == Opcode.Pow && instruction.B > 255 && instruction.C <= 255; 19 | 20 | public override string GetObfuscated(ObfuscationContext context) => 21 | "Stk[Inst[OP_A]]=Const[Inst[OP_B]]^Stk[Inst[OP_C]];"; 22 | 23 | public override void Mutate(Instruction instruction) => 24 | instruction.B -= 255; 25 | } 26 | 27 | public class OpPowC : VOpcode 28 | { 29 | public override bool IsInstruction(Instruction instruction) => 30 | instruction.OpCode == Opcode.Pow && instruction.B <= 255 && instruction.C > 255; 31 | 32 | public override string GetObfuscated(ObfuscationContext context) => 33 | "Stk[Inst[OP_A]]=Stk[Inst[OP_B]]^Const[Inst[OP_C]];"; 34 | 35 | public override void Mutate(Instruction instruction) => 36 | instruction.C -= 255; 37 | } 38 | 39 | public class OpPowBC : VOpcode 40 | { 41 | public override bool IsInstruction(Instruction instruction) => 42 | instruction.OpCode == Opcode.Pow && instruction.B > 255 && instruction.C > 255; 43 | 44 | public override string GetObfuscated(ObfuscationContext context) => 45 | "Stk[Inst[OP_A]]=Const[Inst[OP_B]]^Const[Inst[OP_C]];"; 46 | 47 | public override void Mutate(Instruction instruction) 48 | { 49 | instruction.B -= 255; 50 | instruction.C -= 255; 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpPushStk.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpPushStk : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.PushStack; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "Stk[Inst[OP_A]] = Stk"; 13 | } 14 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpReturn.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpReturn : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.Return && instruction.B > 1; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "local A=Inst[OP_A];local Limit=A+Inst[OP_B]-2;local Output={};local Edx=0;for Idx=A,Limit do Edx=Edx+1;Output[Edx]=Stk[Idx];end; do return Unpack(Output,1,Edx) end;"; 13 | } 14 | 15 | public class OpReturnB0 : VOpcode 16 | { 17 | public override bool IsInstruction(Instruction instruction) => 18 | instruction.OpCode == Opcode.Return && instruction.B == 0; 19 | 20 | public override string GetObfuscated(ObfuscationContext context) => 21 | "local A=Inst[OP_A];local Limit=Top;local Output={};local Edx=0;for Idx=A,Limit do Edx=Edx+1;Output[Edx]=Stk[Idx];end;do return Unpack(Output,1,Edx) end;"; 22 | } 23 | 24 | public class OpReturnB1 : VOpcode 25 | { 26 | public override bool IsInstruction(Instruction instruction) => 27 | instruction.OpCode == Opcode.Return && instruction.B == 1; 28 | 29 | public override string GetObfuscated(ObfuscationContext context) => 30 | "do return end;"; 31 | } 32 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpSelf.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpSelf : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.Self && instruction.C <= 255; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "local A=Inst[OP_A];local B=Stk[Inst[OP_B]];Stk[A+1]=B;Stk[A]=B[Stk[Inst[OP_C]]];"; 13 | } 14 | 15 | public class OpSelfC : VOpcode 16 | { 17 | public override bool IsInstruction(Instruction instruction)=> 18 | instruction.OpCode == Opcode.Self && instruction.C > 255; 19 | 20 | public override string GetObfuscated(ObfuscationContext context) => 21 | "local A=Inst[OP_A];local B=Stk[Inst[OP_B]];Stk[A+1]=B;Stk[A]=B[Const[Inst[OP_C]]];"; 22 | 23 | public override void Mutate(Instruction instruction) => 24 | instruction.C -= 255; 25 | } 26 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpSetFEnv.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpSetFEnv : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.SetFenv; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "Env = Stk[Inst[OP_A]]"; 13 | } 14 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpSetGlobal.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpSetGlobal : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.SetGlobal; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "Env[Const[Inst[OP_B]]]=Stk[Inst[OP_A]];"; 13 | 14 | public override void Mutate(Instruction instruction) => 15 | instruction.B++; 16 | } 17 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpSetList.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpSetList : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.SetList && instruction.B != 0 && 10 | instruction.C > 1; 11 | 12 | public override string GetObfuscated(ObfuscationContext context) => 13 | "local A=Inst[OP_A];local Offset=(Inst[OP_C]-1)*50;local T=Stk[A];local B=Inst[OP_B];for Idx=1,B do T[Offset+Idx]=Stk[A+Idx] end;"; 14 | } 15 | 16 | public class OpSetListC1 : VOpcode 17 | { 18 | public override bool IsInstruction(Instruction instruction) => 19 | instruction.OpCode == Opcode.SetList && instruction.B != 0 && 20 | instruction.C == 1; 21 | 22 | public override string GetObfuscated(ObfuscationContext context) => 23 | "local A=Inst[OP_A];local T=Stk[A];local B=Inst[OP_B];for Idx=1,B do T[Idx]=Stk[A+Idx] end;"; 24 | } 25 | 26 | public class OpSetListB0 : VOpcode 27 | { 28 | public override bool IsInstruction(Instruction instruction) => 29 | instruction.OpCode == Opcode.SetList && instruction.B == 0 && 30 | instruction.C != 0; 31 | 32 | public override string GetObfuscated(ObfuscationContext context) => 33 | "local A=Inst[OP_A];local Offset=(Inst[OP_C]-1)*50;local T=Stk[A];local X=Top-A;for Idx=1,X do T[Offset+Idx]=Stk[A+Idx] end;"; 34 | } 35 | 36 | public class OpSetListC0 : VOpcode 37 | { 38 | public override bool IsInstruction(Instruction instruction) => 39 | instruction.OpCode == Opcode.SetList && instruction.B != 0 && 40 | instruction.C == 0; 41 | 42 | public override string GetObfuscated(ObfuscationContext context) => 43 | "local A=Inst[OP_A];InstrPoint=InstrPoint+1;local Offset=(Instr[InstrPoint][5]-1)*50;local T=Stk[A];local B=Inst[OP_B];for Idx=1,B do T[Offset+Idx]=Stk[A+Idx] end;"; 44 | } 45 | 46 | public class OpSetListB0C0 : VOpcode 47 | { 48 | public override bool IsInstruction(Instruction instruction) => 49 | instruction.OpCode == Opcode.SetList && instruction.B == 0 && 50 | instruction.C == 0; 51 | 52 | public override string GetObfuscated(ObfuscationContext context) => 53 | "local A=Inst[OP_A];InstrPoint=InstrPoint+1;local Offset=(Instr[InstrPoint][5]-1)*50;local T=Stk[A];local X=Top-A;for Idx=1,X do T[Offset+Idx]=Stk[A+Idx] end;"; 54 | } 55 | 56 | public class OpSetListB0C1 : VOpcode 57 | { 58 | public override bool IsInstruction(Instruction instruction) => 59 | instruction.OpCode == Opcode.SetList && instruction.B == 0 && 60 | instruction.C == 1; 61 | 62 | public override string GetObfuscated(ObfuscationContext context) => 63 | "local A=Inst[OP_A];local T=Stk[A];local X=Top-A;for Idx=1,X do T[Idx]=Stk[A+Idx] end;"; 64 | } 65 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpSetTable.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpSetTable : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.SetTable && instruction.B <= 255 && instruction.C <= 255; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "Stk[Inst[OP_A]][Stk[Inst[OP_B]]]=Stk[Inst[OP_C]];"; 13 | } 14 | 15 | public class OpSetTableB : VOpcode 16 | { 17 | public override bool IsInstruction(Instruction instruction) => 18 | instruction.OpCode == Opcode.SetTable && instruction.B > 255 && instruction.C <= 255; 19 | 20 | public override string GetObfuscated(ObfuscationContext context) => 21 | "Stk[Inst[OP_A]][Const[Inst[OP_B]]]=Stk[Inst[OP_C]];"; 22 | 23 | public override void Mutate(Instruction instruction) => 24 | instruction.B -= 255; 25 | } 26 | 27 | public class OpSetTableC : VOpcode 28 | { 29 | public override bool IsInstruction(Instruction instruction) => 30 | instruction.OpCode == Opcode.SetTable && instruction.B <= 255 && instruction.C > 255; 31 | 32 | public override string GetObfuscated(ObfuscationContext context) => 33 | "Stk[Inst[OP_A]][Stk[Inst[OP_B]]]=Const[Inst[OP_C]];"; 34 | 35 | public override void Mutate(Instruction instruction) => 36 | instruction.C -= 255; 37 | } 38 | 39 | public class OpSetTableBC : VOpcode 40 | { 41 | public override bool IsInstruction(Instruction instruction) => 42 | instruction.OpCode == Opcode.SetTable && instruction.B > 255 && instruction.C > 255; 43 | 44 | public override string GetObfuscated(ObfuscationContext context) => 45 | "Stk[Inst[OP_A]][Const[Inst[OP_B]]]=Const[Inst[OP_C]];"; 46 | 47 | public override void Mutate(Instruction instruction) 48 | { 49 | instruction.B -= 255; 50 | instruction.C -= 255; 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpSetTop.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | //custom VM opcode for inlining 7 | public class OpSetTop : VOpcode 8 | { 9 | public override bool IsInstruction(Instruction instruction) => 10 | instruction.OpCode == Opcode.SetTop; 11 | 12 | public override string GetObfuscated(ObfuscationContext context) => 13 | "Top=Inst[OP_A];"; 14 | } 15 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpSetUpval.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpSetUpval : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.SetUpval; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "Upvalues[Inst[OP_B]]=Stk[Inst[OP_A]];"; 13 | } 14 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpSub.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpSub : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.EssaPrimeSubmarine && instruction.B <= 255 && instruction.C <= 255; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "Stk[Inst[OP_A]]=Stk[Inst[OP_B]]-Stk[Inst[OP_C]];"; 13 | } 14 | 15 | public class OpSubB : VOpcode 16 | { 17 | public override bool IsInstruction(Instruction instruction) => 18 | instruction.OpCode == Opcode.EssaPrimeSubmarine && instruction.B > 255 && instruction.C <= 255; 19 | 20 | public override string GetObfuscated(ObfuscationContext context) => 21 | "Stk[Inst[OP_A]]=Const[Inst[OP_B]]-Stk[Inst[OP_C]];"; 22 | 23 | public override void Mutate(Instruction instruction) => 24 | instruction.B -= 255; 25 | } 26 | 27 | public class OpSubC : VOpcode 28 | { 29 | public override bool IsInstruction(Instruction instruction) => 30 | instruction.OpCode == Opcode.EssaPrimeSubmarine && instruction.B <= 255 && instruction.C > 255; 31 | 32 | public override string GetObfuscated(ObfuscationContext context) => 33 | "Stk[Inst[OP_A]]=Stk[Inst[OP_B]]-Const[Inst[OP_C]];"; 34 | 35 | public override void Mutate(Instruction instruction) => 36 | instruction.C -= 255; 37 | } 38 | 39 | public class OpSubBC : VOpcode 40 | { 41 | public override bool IsInstruction(Instruction instruction) => 42 | instruction.OpCode == Opcode.EssaPrimeSubmarine && instruction.B > 255 && instruction.C > 255; 43 | 44 | public override string GetObfuscated(ObfuscationContext context) => 45 | "Stk[Inst[OP_A]]=Const[Inst[OP_B]]-Const[Inst[OP_C]];"; 46 | 47 | public override void Mutate(Instruction instruction) 48 | { 49 | instruction.B -= 255; 50 | instruction.C -= 255; 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpSuperOperator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text.RegularExpressions; 5 | using EssaFuscator.Bytecode_Library.IR; 6 | 7 | namespace EssaFuscator.Obfuscator.Opcodes 8 | { 9 | public class OpSuperOperator : VOpcode 10 | { 11 | public VOpcode[] SubOpcodes; 12 | 13 | public override bool IsInstruction(Instruction instruction) => 14 | false; 15 | 16 | public bool IsInstruction(List instructions) 17 | { 18 | if (instructions.Count != SubOpcodes.Length) 19 | return false; 20 | 21 | for (int i = 0; i < SubOpcodes.Length; i++) 22 | { 23 | if (SubOpcodes[i] is OpMutated mut) 24 | { 25 | if (!mut.Mutated.IsInstruction(instructions[i])) 26 | return false; 27 | } 28 | 29 | else if (!SubOpcodes[i].IsInstruction(instructions[i])) 30 | return false; 31 | } 32 | 33 | return true; 34 | } 35 | 36 | public override string GetObfuscated(ObfuscationContext context) 37 | { 38 | string s = ""; 39 | List locals = new List(); 40 | 41 | for (var index = 0; index < SubOpcodes.Length; index++) 42 | { 43 | var subOpcode = SubOpcodes[index]; 44 | string s2 = subOpcode.GetObfuscated(context); 45 | 46 | Regex reg = new Regex("local(.*?)[;=]"); 47 | foreach (Match m in reg.Matches(s2)) 48 | { 49 | string loc = m.Groups[1].Value.Replace(" ", ""); 50 | if (!locals.Contains(loc)) 51 | locals.Add(loc); 52 | 53 | if (!m.Value.Contains(";")) 54 | s2 = s2.Replace($"local{m.Groups[1].Value}", loc); 55 | else 56 | s2 = s2.Replace($"local{m.Groups[1].Value};", ""); 57 | } 58 | 59 | s += s2; 60 | 61 | if (index + 1 < SubOpcodes.Length) 62 | s += "InstrPoint = InstrPoint + 1;Inst = Instr[InstrPoint];"; 63 | } 64 | 65 | foreach (string l in locals) 66 | s = "local " + l + ';' + s; 67 | 68 | return s; 69 | } 70 | } 71 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpTForLoop.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpTForLoop : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.TForLoop; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "local A=Inst[OP_A];local C=Inst[OP_C];local Offset=A+2;local Result={Stk[A](Stk[A+1],Stk[Offset])};for Idx=1,C do Stk[Offset+Idx]=Result[Idx];end;local R=Stk[A+3];if R then Stk[Offset]=R else InstrPoint=InstrPoint+1;end;"; 13 | } 14 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpTailCall.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpTailCall : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.TailCall && instruction.B > 1; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "local A=Inst[OP_A];local Args={};local Limit=A+Inst[OP_B]-1;for Idx=A+1,Limit do Args[#Args+1]=Stk[Idx];end;do return Stk[A](Unpack(Args,1,Limit-A)) end;"; 13 | } 14 | 15 | public class OpTailCallB0 : VOpcode 16 | { 17 | public override bool IsInstruction(Instruction instruction) => 18 | instruction.OpCode == Opcode.TailCall && instruction.B == 0; 19 | 20 | public override string GetObfuscated(ObfuscationContext context) => 21 | "local A=Inst[OP_A];local Args={};local Limit=Top;for Idx=A+1,Limit do Args[#Args+1]=Stk[Idx];end;do return Stk[A](Unpack(Args,1,Limit-A)) end;"; 22 | } 23 | 24 | public class OpTailCallB1 : VOpcode 25 | { 26 | public override bool IsInstruction(Instruction instruction) => 27 | instruction.OpCode == Opcode.TailCall && instruction.B == 1; 28 | 29 | public override string GetObfuscated(ObfuscationContext context) => 30 | "local A=Inst[OP_A];do return Stk[A](); end;"; 31 | } 32 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpTest.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpTest : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.Test && instruction.C == 0; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "if Stk[Inst[OP_A]] then InstrPoint=InstrPoint+1;else InstrPoint=InstrPoint+Inst[OP_B];end;"; 13 | 14 | public override void Mutate(Instruction instruction) 15 | { 16 | instruction.B = instruction.Chunk.Instructions[instruction.PC + 1].B + 1; 17 | instruction.InstructionType = InstructionType.AsBxC; 18 | } 19 | } 20 | 21 | public class OpTestC : VOpcode 22 | { 23 | public override bool IsInstruction(Instruction instruction) => 24 | instruction.OpCode == Opcode.Test && instruction.C != 0; 25 | 26 | public override string GetObfuscated(ObfuscationContext context) => 27 | "if not Stk[Inst[OP_A]] then InstrPoint=InstrPoint+1;else InstrPoint=InstrPoint+Inst[OP_B];end;"; 28 | 29 | public override void Mutate(Instruction instruction) 30 | { 31 | instruction.B = instruction.Chunk.Instructions[instruction.PC + 1].B + 1; 32 | instruction.InstructionType = InstructionType.AsBxC; 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpTestSet.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpTestSet : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.TestSet && instruction.C == 0; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "local B=Stk[Inst[OP_B]];if B then InstrPoint=InstrPoint+1;else Stk[Inst[OP_A]]=B;InstrPoint=InstrPoint+Instr[InstrPoint+1][OP_B]+1;end;"; 13 | } 14 | 15 | public class OpTestSetC : VOpcode 16 | { 17 | public override bool IsInstruction(Instruction instruction) => 18 | instruction.OpCode == Opcode.TestSet && instruction.C != 0; 19 | 20 | public override string GetObfuscated(ObfuscationContext context) => 21 | "local B=Stk[Inst[OP_B]];if not B then InstrPoint=InstrPoint+1;else Stk[Inst[OP_A]]=B;InstrPoint=InstrPoint+Instr[InstrPoint+1][OP_B]+1;end;"; 22 | 23 | } 24 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpUnm.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpUnm : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.Unm; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "Stk[Inst[OP_A]]=-Stk[Inst[OP_B]];"; 13 | } 14 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Opcodes/OpVarArg.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.Bytecode; 2 | using EssaFuscator.Bytecode_Library.IR; 3 | 4 | namespace EssaFuscator.Obfuscator.Opcodes 5 | { 6 | public class OpVarArg : VOpcode 7 | { 8 | public override bool IsInstruction(Instruction instruction) => 9 | instruction.OpCode == Opcode.VarArg && instruction.B != 0; 10 | 11 | public override string GetObfuscated(ObfuscationContext context) => 12 | "local A=Inst[OP_A];local B=Inst[OP_B];for Idx=A,A+B-1 do Stk[Idx]=Vararg[Idx-A];end;"; 13 | } 14 | 15 | public class OpVarArgB0 : VOpcode 16 | { 17 | public override bool IsInstruction(Instruction instruction) => 18 | instruction.OpCode == Opcode.VarArg && instruction.B == 0; 19 | 20 | public override string GetObfuscated(ObfuscationContext context) => 21 | "local A=Inst[OP_A];Top=A+Varargsz-1;for Idx=A,Top do local VA=Vararg[Idx-A];Stk[Idx]=VA;end;"; 22 | } 23 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Rewriters/LuaIntegerSolver.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Loretta.CodeAnalysis; 3 | using Loretta.CodeAnalysis.Lua; 4 | using Loretta.CodeAnalysis.Lua.Syntax; 5 | 6 | namespace EssaFuscator.Obfuscator.Rewriters; 7 | 8 | public class LuaIntegerSolver : LuaSyntaxRewriter 9 | { 10 | public override SyntaxNode? VisitLiteralExpression(LiteralExpressionSyntax node) 11 | { 12 | if (node.Kind() != SyntaxKind.NumericalLiteralExpression) return base.VisitLiteralExpression(node); 13 | 14 | if (node.Token.Value is long num) 15 | { 16 | // ReSharper disable once CompareOfFloatsByEqualityOperator 17 | return SyntaxFactory.BinaryExpression(SyntaxKind.ExclusiveOrExpression, node, SyntaxFactory.Token(SyntaxKind.PipeToken), SyntaxFactory.LiteralExpression(SyntaxKind.NumericalLiteralExpression, SyntaxFactory.Literal(1))); 18 | } 19 | 20 | return base.VisitLiteralExpression(node); 21 | } 22 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/Rewriters/StringEncryption.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | using System.Text.Unicode; 4 | using Loretta.CodeAnalysis; 5 | using Loretta.CodeAnalysis.Lua; 6 | using Loretta.CodeAnalysis.Lua.Syntax; 7 | 8 | namespace EssaFuscator.Obfuscator.Rewriters; 9 | 10 | public class StringEncryption : LuaSyntaxRewriter 11 | { 12 | public readonly int EncryptionKey; 13 | 14 | public StringEncryption() 15 | { 16 | EncryptionKey = new Random().Next(1, 255); 17 | } 18 | 19 | private (int, int, int, int) EncryptedTuple(int constant) 20 | { 21 | var (b0, b1, b2, b3) = (0,0,0,0); 22 | 23 | constant ^= EncryptionKey; 24 | b3 = constant & 0xff; 25 | constant >>= 8; 26 | b2 = constant & 0xff; 27 | constant >>= 8; 28 | b1 = constant & 0xff; 29 | constant >>= 8; 30 | b0 = constant & 0xff; 31 | 32 | return (b0, b1, b2, b3); 33 | } 34 | 35 | public override SyntaxNode? VisitLiteralExpression(LiteralExpressionSyntax node) 36 | { 37 | if (node.Kind() != SyntaxKind.StringLiteralExpression || node.Parent is FunctionCallExpressionSyntax) return base.VisitLiteralExpression(node); 38 | 39 | var expressionFields = SyntaxFactory.SeparatedList(); 40 | 41 | var bytes = Encoding.UTF8.GetBytes((string) node.Token.Value!); 42 | 43 | foreach (var bit in bytes) 44 | { 45 | var (b0, b1, b2, b3) = EncryptedTuple(bit); 46 | 47 | expressionFields = expressionFields.Add(SyntaxFactory.UnkeyedTableField(SyntaxFactory.ParseExpression($"{{{b0}, {b1}, {b2}, {b3}}}"))); 48 | } 49 | 50 | var list = SyntaxFactory.SeparatedList(); 51 | list = list.Add(SyntaxFactory.TableConstructorExpression(expressionFields)); 52 | 53 | return SyntaxFactory.FunctionCallExpression(SyntaxFactory.IdentifierName("__DecryptString__"), SyntaxFactory.ExpressionListFunctionArgument(list)); 54 | } 55 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/Obfuscator/VOpcode.cs: -------------------------------------------------------------------------------- 1 | using EssaFuscator.Bytecode_Library.IR; 2 | 3 | namespace EssaFuscator.Obfuscator 4 | { 5 | public abstract class VOpcode 6 | { 7 | public int VIndex; 8 | 9 | public abstract bool IsInstruction(Instruction instruction); 10 | public abstract string GetObfuscated(ObfuscationContext context); 11 | public virtual void Mutate(Instruction instruction) { } 12 | } 13 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/bin/Debug/netcoreapp2.2/EssaFuscator.deps.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeTarget": { 3 | "name": ".NETCoreApp,Version=v2.2", 4 | "signature": "" 5 | }, 6 | "compilationOptions": {}, 7 | "targets": { 8 | ".NETCoreApp,Version=v2.2": { 9 | "EssaFuscator/1.0.0": { 10 | "dependencies": { 11 | "System.Text.Encoding.CodePages": "4.6.0-preview.18571.3" 12 | }, 13 | "runtime": { 14 | "EssaFuscator.dll": {} 15 | } 16 | }, 17 | "System.Runtime.CompilerServices.Unsafe/4.6.0-preview.18571.3": { 18 | "runtime": { 19 | "lib/netcoreapp2.0/System.Runtime.CompilerServices.Unsafe.dll": { 20 | "assemblyVersion": "4.0.5.0", 21 | "fileVersion": "4.7.18.57103" 22 | } 23 | } 24 | }, 25 | "System.Text.Encoding.CodePages/4.6.0-preview.18571.3": { 26 | "dependencies": { 27 | "System.Runtime.CompilerServices.Unsafe": "4.6.0-preview.18571.3" 28 | }, 29 | "runtime": { 30 | "lib/netstandard2.0/System.Text.Encoding.CodePages.dll": { 31 | "assemblyVersion": "4.1.2.0", 32 | "fileVersion": "4.7.18.57103" 33 | } 34 | }, 35 | "runtimeTargets": { 36 | "runtimes/win/lib/netcoreapp2.0/System.Text.Encoding.CodePages.dll": { 37 | "rid": "win", 38 | "assetType": "runtime", 39 | "assemblyVersion": "4.1.2.0", 40 | "fileVersion": "4.7.18.57103" 41 | } 42 | } 43 | } 44 | } 45 | }, 46 | "libraries": { 47 | "EssaFuscator/1.0.0": { 48 | "type": "project", 49 | "serviceable": false, 50 | "sha512": "" 51 | }, 52 | "System.Runtime.CompilerServices.Unsafe/4.6.0-preview.18571.3": { 53 | "type": "package", 54 | "serviceable": true, 55 | "sha512": "sha512-RlKzUOKfzOvQsexDiEai+zgs5ZDM75D9awG+hPrAPq6iChW2opzjPruDwrhVq1n0HrCPbTfvrL6A6nL2+rDpnA==", 56 | "path": "system.runtime.compilerservices.unsafe/4.6.0-preview.18571.3", 57 | "hashPath": "system.runtime.compilerservices.unsafe.4.6.0-preview.18571.3.nupkg.sha512" 58 | }, 59 | "System.Text.Encoding.CodePages/4.6.0-preview.18571.3": { 60 | "type": "package", 61 | "serviceable": true, 62 | "sha512": "sha512-MYFHOtbSfHdWXtG8gqqfFdEfy6mkIGqyIeI1H8U5ChlSx5/VW595B7JAtbX942lYUHzC6CXCcoILD7scN05c9Q==", 63 | "path": "system.text.encoding.codepages/4.6.0-preview.18571.3", 64 | "hashPath": "system.text.encoding.codepages.4.6.0-preview.18571.3.nupkg.sha512" 65 | } 66 | } 67 | } -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/bin/Debug/netcoreapp2.2/EssaFuscator.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorMain/EssaFuscator/EssaFuscator/bin/Debug/netcoreapp2.2/EssaFuscator.dll -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/bin/Debug/netcoreapp2.2/EssaFuscator.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorMain/EssaFuscator/EssaFuscator/bin/Debug/netcoreapp2.2/EssaFuscator.pdb -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/bin/Debug/netcoreapp2.2/LuaCompiler-O.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorMain/EssaFuscator/EssaFuscator/bin/Debug/netcoreapp2.2/LuaCompiler-O.dll -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/bin/Debug/netcoreapp2.2/LuaCompiler-O.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorMain/EssaFuscator/EssaFuscator/bin/Debug/netcoreapp2.2/LuaCompiler-O.exp -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/bin/Debug/netcoreapp2.2/LuaCompiler-O.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorMain/EssaFuscator/EssaFuscator/bin/Debug/netcoreapp2.2/LuaCompiler-O.lib -------------------------------------------------------------------------------- /EssaFuscatorMain/EssaFuscator/EssaFuscator/bin/Debug/netcoreapp2.2/LuaCompiler-O.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorMain/EssaFuscator/EssaFuscator/bin/Debug/netcoreapp2.2/LuaCompiler-O.pdb -------------------------------------------------------------------------------- /EssaFuscatorPackageV2/AD/EssaFuscatorADAR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorPackageV2/AD/EssaFuscatorADAR.png -------------------------------------------------------------------------------- /EssaFuscatorPackageV2/AD/EssaFuscatorADEN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorPackageV2/AD/EssaFuscatorADEN.png -------------------------------------------------------------------------------- /EssaFuscatorPackageV2/BANNER/EssaFuscator CleanBrand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorPackageV2/BANNER/EssaFuscator CleanBrand.png -------------------------------------------------------------------------------- /EssaFuscatorPackageV2/BANNER/EssaFuscator Header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorPackageV2/BANNER/EssaFuscator Header.png -------------------------------------------------------------------------------- /EssaFuscatorPackageV2/BANNER/EssaFuscatorCool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorPackageV2/BANNER/EssaFuscatorCool.png -------------------------------------------------------------------------------- /EssaFuscatorPackageV2/BANNER/EssaFuscatorInvitre.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorPackageV2/BANNER/EssaFuscatorInvitre.png -------------------------------------------------------------------------------- /EssaFuscatorPackageV2/Logo/EssaFuscatorBurn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorPackageV2/Logo/EssaFuscatorBurn.png -------------------------------------------------------------------------------- /EssaFuscatorPackageV2/Logo/EssaFuscatorClean.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorPackageV2/Logo/EssaFuscatorClean.png -------------------------------------------------------------------------------- /EssaFuscatorPackageV2/LogoGIF/Animation.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorPackageV2/LogoGIF/Animation.gif -------------------------------------------------------------------------------- /EssaFuscatorPackageV2/LogoGIF/Atom Logo Final GIF Compressed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorPackageV2/LogoGIF/Atom Logo Final GIF Compressed.gif -------------------------------------------------------------------------------- /EssaFuscatorPackageV2/LogoGIF/Logo Reveal Final Video.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorPackageV2/LogoGIF/Logo Reveal Final Video.mp4 -------------------------------------------------------------------------------- /EssaFuscatorPackageV2/PFP/EssaFuscator PFP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorPackageV2/PFP/EssaFuscator PFP.png -------------------------------------------------------------------------------- /EssaFuscatorPackageV2/Status/Status.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorPackageV2/Status/Status.png -------------------------------------------------------------------------------- /EssaFuscatorStatus/Akira_Expanded.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorStatus/Akira_Expanded.otf -------------------------------------------------------------------------------- /EssaFuscatorStatus/Status.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorStatus/Status.png -------------------------------------------------------------------------------- /EssaFuscatorStatus/starter.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | node index.js 3 | PAUSE -------------------------------------------------------------------------------- /EssaFuscatorWebsite/img/efus.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorWebsite/img/efus.webp -------------------------------------------------------------------------------- /EssaFuscatorWebsite/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorWebsite/img/favicon.ico -------------------------------------------------------------------------------- /EssaFuscatorWebsite/img/index.html: -------------------------------------------------------------------------------- 1 |

image cdn by baba essaprime

2 | essaprime هو بابا
-------------------------------------------------------------------------------- /EssaFuscatorWebsite/img/uae.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorWebsite/img/uae.webp -------------------------------------------------------------------------------- /EssaFuscatorWebsite/img/uk.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EssaPrime/EssaFuscatorOpenSource/475f0afa1cd46b486a4d8aa676db4cc9a4b597ca/EssaFuscatorWebsite/img/uk.webp -------------------------------------------------------------------------------- /EssaFuscatorWebsite/login.php: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /EssaFuscatorWebsite/outsourced/index.html: -------------------------------------------------------------------------------- 1 |

bootstrap&jquery loader by baba essaprime

2 | essaprime هو بابا
-------------------------------------------------------------------------------- /EssaFuscatorWebsite/phpfunc/config.php: -------------------------------------------------------------------------------- 1 | '; 13 | echo 'window.location.href="'.$url.'";'; 14 | echo ''; 15 | echo ''; 18 | exit; 19 | } 20 | } 21 | 22 | function is_animated($avatar) 23 | { 24 | $ext = substr($avatar, 0, 2); 25 | if ($ext == "a_") 26 | { 27 | return ".gif"; 28 | } 29 | else 30 | { 31 | return ".png"; 32 | } 33 | } 34 | ?> 35 | -------------------------------------------------------------------------------- /EssaFuscatorWebsite/phpfunc/index.html: -------------------------------------------------------------------------------- 1 |

php loader by baba essaprime

2 | essaprime هو بابا
-------------------------------------------------------------------------------- /EssaFuscatorWebsite/phpfunc/upload.php: -------------------------------------------------------------------------------- 1 | "alert-danger", 12 | "message" => "Unexpected Error, Contact Essa \n\n ايرور غير متوقع, تواصل مع عيسى." 13 | ); 14 | return; 15 | } 16 | 17 | if (!file_exists($_FILES["fileUpload"]["tmp_name"])) { 18 | $resMessage = array( 19 | "status" => "alert-danger", 20 | "message" => "You Have To Put A File \n\n لازم تحط ملف." 21 | ); 22 | return; 23 | } else { 24 | $postdata = json_encode( 25 | array( 26 | 'script' => file_get_contents($_FILES["fileUpload"]["tmp_name"]), // Script 27 | 'watermark' => $_POST["wotahmark"] // Watermark 28 | ) 29 | ); 30 | 31 | $opts = array('http' => 32 | array( 33 | 'method' => 'POST', 34 | 'header' => array( 35 | 'Content-Type: application/json', 36 | 'EssaFuscatorAPIKey: ESSA-'.$_SESSION["user"]["id"] 37 | ), 38 | 'content' => $postdata, 39 | 'ignore_errors' => true 40 | ) 41 | ); 42 | $context = stream_context_create($opts); 43 | $result = file_get_contents('http://api.essafuscator.net/v2/obfuscate/'.$_POST["byteskin"], false, $context); 44 | $status_line = $http_response_header[0]; 45 | preg_match('{HTTP\/\S*\s(\d{3})}', $status_line, $match); 46 | 47 | $status = $match[1]; 48 | // 49 | if ($status == 400) { 50 | 51 | $resMessage = array( 52 | "status" => "alert-danger", 53 | "message" => "There Was An Error While Obfuscating: [".json_decode($result,true)["error"]."]" 54 | ); 55 | return; 56 | }elseif($status == 200){ 57 | /* 58 | $epoch = time(); 59 | $filepath = "obfuscated/EFuscated-".$epoch.".lua"; 60 | $myfile = fopen($filepath, "w") or die("Unable to open file!"); 61 | 62 | fwrite($myfile, json_decode($result,true)['obfscript']); 63 | fclose($myfile); 64 | 65 | if (file_exists($filepath)) { 66 | header('Content-Description: File Transfer'); 67 | header('Content-Type: application/octet-stream'); 68 | header('Content-Disposition: attachment; filename="' . basename($filepath) . '"'); 69 | header('Expires: 0'); 70 | header('Cache-Control: must-revalidate'); 71 | header('Pragma: public'); 72 | header('Content-Length: ' . filesize($filepath)); 73 | readfile($filepath); 74 | flush(); 75 | exit; 76 | }*/ 77 | $resMessage = array( 78 | "status" => "alert-success", 79 | "message" => "File Obfuscated Successfully." 80 | ); 81 | header("Location: ".str_replace("?json=true","?json=false",json_decode($result,true)['cdnlink'])); 82 | exit(); 83 | return; 84 | }else{ 85 | $resMessage = array( 86 | "status" => "alert-danger", 87 | "message" => "There Was An Unknown Error, Contact ! EssaPrime#0001 On Discord!" 88 | ); 89 | return; 90 | } 91 | 92 | } 93 | 94 | } 95 | ?> -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2022 EssaPrime 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # EssaFuscator 3 | 4 | A Lua Obfuscation System Created For CfxLua (5.3-5.4) 5 | 6 | ## Folder Info 7 | 8 | - [/EssaFuscatorAPIRestructered](https://github.com/EssaPrime/EssaFuscatorOpenSource/tree/main/EssaFuscatorAPIRestructered) - The Backend API. 9 | - [/EssaFuscatorBot](https://github.com/EssaPrime/EssaFuscatorOpenSource/tree/main/EssaFuscatorBot) - The Discord Bot (v13). 10 | - [/EssaFuscatorBotDeployable](https://github.com/EssaPrime/EssaFuscatorOpenSource/tree/main/EssaFuscatorBotDeployable) - An Example Bot For Your Server, uses the essafuscator npm package. 11 | - [/EssaFuscatorMain](https://github.com/EssaPrime/EssaFuscatorOpenSource/tree/main/EssaFuscatorMain/EssaFuscator) - Obfuscator Source. 12 | - [/EssaFuscatorPackageV2](https://github.com/EssaPrime/EssaFuscatorOpenSource/tree/main/EssaFuscatorMain/EssaFuscatorPackageV2) - The Design Package. 13 | - [/EssaFuscatorWebsite](https://github.com/EssaPrime/EssaFuscatorOpenSource/tree/main/EssaFuscatorWebsite) - The Frontend Website. 14 | 15 | 16 | 17 | ## FAQ 18 | 19 | #### Can you help me start the system? 20 | 21 | No. 22 | 23 | #### Can i use parts of the source for my own project? 24 | 25 | Yes. 26 | 27 | #### Where can i contact you? 28 | 29 | ! EssaPrime#0001 [Click here for direct link](https://discord.com/users/217353461933670403) 30 | 31 | #### Essafuscator uses Loretta to rewrite Syntax Trees 32 | 33 | [](https://github.com/LorettaDevs/) 34 | ## 35 | 36 |

essaprime

37 | 38 | 39 | --------------------------------------------------------------------------------