UNPKG

vanzy-protect

Version:

Epic Obfuscator Yeahhh

26 lines (25 loc) 1.47 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.generateProxyFunction = void 0; const Randomizer_1 = require("../random/Randomizer"); const comment_1 = require("./comment"); const numberObf_1 = require("./numberObf"); function generateProxyFunction(name, v1, v2) { const decoyArray = new Array(Randomizer_1.Randomizer.INSTANCE.rand(15, 50)); const selectedIndex = Randomizer_1.Randomizer.INSTANCE.rand(0, decoyArray.length - 1); const randomConstant = Randomizer_1.Randomizer.INSTANCE.rand(5, 80); for (let i = 0; i < decoyArray.length; i++) { decoyArray[i] = Randomizer_1.Randomizer.INSTANCE.rand(-17836, 17836); } const result = decoyArray[selectedIndex] - randomConstant; const stringifiedArray = decoyArray.map(i => '(' + (0, numberObf_1.numberObf)(i) + ')').join(',' + (0, comment_1.comment)(3)); return ` const ${v1}${(0, comment_1.comment)(3)}=${(0, comment_1.comment)(2)}[${stringifiedArray}]${(0, comment_1.comment)(1)}; const ${v2}${(0, comment_1.comment)(3)}=${(0, comment_1.comment)(2)}!((${v1}[${selectedIndex}]-${(0, comment_1.comment)(2)}${randomConstant}) === ${result}); function ${(0, comment_1.comment)(3)}${name}(řඞŘඞ, řඞŘඞř)${(0, comment_1.comment)(2)} { if (${v2}) {return${(0, comment_1.comment)(1)}(String(Object));} else {return(${(0, comment_1.comment)(2)}řඞŘඞř + řඞŘඞ);} }; `; } exports.generateProxyFunction = generateProxyFunction;