|
|
|
@@ -213,9 +213,9 @@ module.exports =
|
|
|
|
|
|
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
|
|
|
|
|
|
var estraverse = __webpack_require__(5);
|
|
|
|
|
var NodeType_1 = __webpack_require__(3);
|
|
|
|
|
var Nodes_1 = __webpack_require__(2);
|
|
|
|
|
var estraverse = __webpack_require__(3);
|
|
|
|
|
var NodeType_1 = __webpack_require__(2);
|
|
|
|
|
var Nodes_1 = __webpack_require__(8);
|
|
|
|
|
var Utils_1 = __webpack_require__(0);
|
|
|
|
|
|
|
|
|
|
var NodeUtils = function () {
|
|
|
|
@@ -329,11 +329,231 @@ module.exports =
|
|
|
|
|
"use strict";
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
var Utils_1 = __webpack_require__(0);
|
|
|
|
|
exports.NodeType = Utils_1.Utils.strEnumify({
|
|
|
|
|
ArrayExpression: 'ArrayExpression',
|
|
|
|
|
ArrowFunctionExpression: 'ArrowFunctionExpression',
|
|
|
|
|
AssignmentExpression: 'AssignmentExpression',
|
|
|
|
|
BinaryExpression: 'BinaryExpression',
|
|
|
|
|
BlockStatement: 'BlockStatement',
|
|
|
|
|
CallExpression: 'CallExpression',
|
|
|
|
|
CatchClause: 'CatchClause',
|
|
|
|
|
ClassDeclaration: 'ClassDeclaration',
|
|
|
|
|
ExpressionStatement: 'ExpressionStatement',
|
|
|
|
|
FunctionDeclaration: 'FunctionDeclaration',
|
|
|
|
|
FunctionExpression: 'FunctionExpression',
|
|
|
|
|
Identifier: 'Identifier',
|
|
|
|
|
IfStatement: 'IfStatement',
|
|
|
|
|
Literal: 'Literal',
|
|
|
|
|
LogicalExpression: 'LogicalExpression',
|
|
|
|
|
MemberExpression: 'MemberExpression',
|
|
|
|
|
MethodDefinition: 'MethodDefinition',
|
|
|
|
|
ObjectExpression: 'ObjectExpression',
|
|
|
|
|
Program: 'Program',
|
|
|
|
|
Property: 'Property',
|
|
|
|
|
ReturnStatement: 'ReturnStatement',
|
|
|
|
|
TryStatement: 'TryStatement',
|
|
|
|
|
UnaryExpression: 'UnaryExpression',
|
|
|
|
|
UpdateExpression: 'UpdateExpression',
|
|
|
|
|
VariableDeclaration: 'VariableDeclaration',
|
|
|
|
|
VariableDeclarator: 'VariableDeclarator',
|
|
|
|
|
WhileStatement: 'WhileStatement'
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/***/ },
|
|
|
|
|
/* 3 */
|
|
|
|
|
/***/ function(module, exports) {
|
|
|
|
|
|
|
|
|
|
module.exports = require("estraverse");
|
|
|
|
|
|
|
|
|
|
/***/ },
|
|
|
|
|
/* 4 */
|
|
|
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
|
|
|
|
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
|
|
|
|
|
|
var NodeType_1 = __webpack_require__(3);
|
|
|
|
|
var AppendState_1 = __webpack_require__(6);
|
|
|
|
|
var NodeUtils_1 = __webpack_require__(1);
|
|
|
|
|
|
|
|
|
|
var Node = function () {
|
|
|
|
|
function Node(options) {
|
|
|
|
|
_classCallCheck(this, Node);
|
|
|
|
|
|
|
|
|
|
this.appendState = AppendState_1.AppendState.BeforeObfuscation;
|
|
|
|
|
this.options = options;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_createClass(Node, [{
|
|
|
|
|
key: "getAppendState",
|
|
|
|
|
value: function getAppendState() {
|
|
|
|
|
return this.appendState;
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "getNode",
|
|
|
|
|
value: function getNode() {
|
|
|
|
|
NodeUtils_1.NodeUtils.parentize(this.node);
|
|
|
|
|
return this.node;
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "setNode",
|
|
|
|
|
value: function setNode(node) {
|
|
|
|
|
this.node = node;
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "updateNode",
|
|
|
|
|
value: function updateNode() {
|
|
|
|
|
this.node = this.getNodeStructure();
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
return Node;
|
|
|
|
|
}();
|
|
|
|
|
|
|
|
|
|
exports.Node = Node;
|
|
|
|
|
|
|
|
|
|
/***/ },
|
|
|
|
|
/* 5 */
|
|
|
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
|
|
|
|
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
|
|
|
|
|
|
var estraverse = __webpack_require__(3);
|
|
|
|
|
var JSFuck_1 = __webpack_require__(9);
|
|
|
|
|
var Nodes_1 = __webpack_require__(8);
|
|
|
|
|
var Utils_1 = __webpack_require__(0);
|
|
|
|
|
|
|
|
|
|
var NodeObfuscator = function () {
|
|
|
|
|
function NodeObfuscator(nodes, options) {
|
|
|
|
|
_classCallCheck(this, NodeObfuscator);
|
|
|
|
|
|
|
|
|
|
this.nodes = nodes;
|
|
|
|
|
this.options = options;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_createClass(NodeObfuscator, [{
|
|
|
|
|
key: "isReservedName",
|
|
|
|
|
value: function isReservedName(name) {
|
|
|
|
|
return this.options.get('reservedNames').some(function (reservedName) {
|
|
|
|
|
return new RegExp(reservedName, 'g').test(name);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "storeIdentifiersNames",
|
|
|
|
|
value: function storeIdentifiersNames(node, namesMap) {
|
|
|
|
|
if (Nodes_1.Nodes.isIdentifierNode(node) && !this.isReservedName(node.name)) {
|
|
|
|
|
namesMap.set(node.name, Utils_1.Utils.getRandomVariableName());
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
return estraverse.VisitorOption.Skip;
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "replaceIdentifiersWithRandomNames",
|
|
|
|
|
value: function replaceIdentifiersWithRandomNames(node, parentNode, namesMap) {
|
|
|
|
|
if (Nodes_1.Nodes.isIdentifierNode(node) && namesMap.has(node.name)) {
|
|
|
|
|
var parentNodeIsPropertyNode = Nodes_1.Nodes.isPropertyNode(parentNode) && parentNode.key === node,
|
|
|
|
|
parentNodeIsMemberExpressionNode = Nodes_1.Nodes.isMemberExpressionNode(parentNode) && parentNode.computed === false && parentNode.property === node;
|
|
|
|
|
if (parentNodeIsPropertyNode || parentNodeIsMemberExpressionNode) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
node.name = namesMap.get(node.name);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "replaceLiteralBooleanWithJSFuck",
|
|
|
|
|
value: function replaceLiteralBooleanWithJSFuck(nodeValue) {
|
|
|
|
|
return nodeValue ? JSFuck_1.JSFuck.True : JSFuck_1.JSFuck.False;
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "replaceLiteralNumberWithHexadecimalValue",
|
|
|
|
|
value: function replaceLiteralNumberWithHexadecimalValue(nodeValue) {
|
|
|
|
|
var prefix = '0x';
|
|
|
|
|
if (!Utils_1.Utils.isInteger(nodeValue)) {
|
|
|
|
|
return String(nodeValue);
|
|
|
|
|
}
|
|
|
|
|
return "" + prefix + Utils_1.Utils.decToHex(nodeValue);
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "replaceLiteralValueWithUnicodeValue",
|
|
|
|
|
value: function replaceLiteralValueWithUnicodeValue(nodeValue) {
|
|
|
|
|
var value = nodeValue,
|
|
|
|
|
replaceWithUnicodeArrayFlag = Math.random() <= this.options.get('unicodeArrayThreshold');
|
|
|
|
|
if (this.options.get('encodeUnicodeLiterals') && replaceWithUnicodeArrayFlag) {
|
|
|
|
|
value = Utils_1.Utils.btoa(value);
|
|
|
|
|
}
|
|
|
|
|
value = Utils_1.Utils.stringToUnicode(value);
|
|
|
|
|
if (!this.options.get('unicodeArray') || !replaceWithUnicodeArrayFlag) {
|
|
|
|
|
return value;
|
|
|
|
|
}
|
|
|
|
|
return this.replaceLiteralValueWithUnicodeArrayCall(value);
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "replaceLiteralValueWithUnicodeArrayCall",
|
|
|
|
|
value: function replaceLiteralValueWithUnicodeArrayCall(value) {
|
|
|
|
|
var unicodeArrayNode = this.nodes.get('unicodeArrayNode'),
|
|
|
|
|
unicodeArray = unicodeArrayNode.getNodeData(),
|
|
|
|
|
sameIndex = unicodeArray.indexOf(value),
|
|
|
|
|
index = void 0,
|
|
|
|
|
hexadecimalIndex = void 0;
|
|
|
|
|
if (sameIndex >= 0) {
|
|
|
|
|
index = sameIndex;
|
|
|
|
|
} else {
|
|
|
|
|
index = unicodeArray.length;
|
|
|
|
|
unicodeArrayNode.updateNodeData(value);
|
|
|
|
|
}
|
|
|
|
|
hexadecimalIndex = this.replaceLiteralNumberWithHexadecimalValue(index);
|
|
|
|
|
if (this.options.get('wrapUnicodeArrayCalls')) {
|
|
|
|
|
return this.nodes.get('unicodeArrayCallsWrapper').getNodeIdentifier() + "('" + hexadecimalIndex + "')";
|
|
|
|
|
}
|
|
|
|
|
return unicodeArrayNode.getNodeIdentifier() + "[" + hexadecimalIndex + "]";
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
return NodeObfuscator;
|
|
|
|
|
}();
|
|
|
|
|
|
|
|
|
|
exports.NodeObfuscator = NodeObfuscator;
|
|
|
|
|
|
|
|
|
|
/***/ },
|
|
|
|
|
/* 6 */
|
|
|
|
|
/***/ function(module, exports) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
(function (AppendState) {
|
|
|
|
|
AppendState[AppendState["AfterObfuscation"] = 0] = "AfterObfuscation";
|
|
|
|
|
AppendState[AppendState["BeforeObfuscation"] = 1] = "BeforeObfuscation";
|
|
|
|
|
})(exports.AppendState || (exports.AppendState = {}));
|
|
|
|
|
var AppendState = exports.AppendState;
|
|
|
|
|
|
|
|
|
|
/***/ },
|
|
|
|
|
/* 7 */
|
|
|
|
|
/***/ function(module, exports) {
|
|
|
|
|
|
|
|
|
|
module.exports = require("esprima");
|
|
|
|
|
|
|
|
|
|
/***/ },
|
|
|
|
|
/* 8 */
|
|
|
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
|
|
|
|
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
|
|
|
|
|
|
var NodeType_1 = __webpack_require__(2);
|
|
|
|
|
|
|
|
|
|
var Nodes = function () {
|
|
|
|
|
function Nodes() {
|
|
|
|
@@ -395,216 +615,6 @@ module.exports =
|
|
|
|
|
|
|
|
|
|
exports.Nodes = Nodes;
|
|
|
|
|
|
|
|
|
|
/***/ },
|
|
|
|
|
/* 3 */
|
|
|
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
var Utils_1 = __webpack_require__(0);
|
|
|
|
|
exports.NodeType = Utils_1.Utils.strEnumify({
|
|
|
|
|
ArrayExpression: 'ArrayExpression',
|
|
|
|
|
ArrowFunctionExpression: 'ArrowFunctionExpression',
|
|
|
|
|
AssignmentExpression: 'AssignmentExpression',
|
|
|
|
|
BinaryExpression: 'BinaryExpression',
|
|
|
|
|
BlockStatement: 'BlockStatement',
|
|
|
|
|
CallExpression: 'CallExpression',
|
|
|
|
|
CatchClause: 'CatchClause',
|
|
|
|
|
ClassDeclaration: 'ClassDeclaration',
|
|
|
|
|
ExpressionStatement: 'ExpressionStatement',
|
|
|
|
|
FunctionDeclaration: 'FunctionDeclaration',
|
|
|
|
|
FunctionExpression: 'FunctionExpression',
|
|
|
|
|
Identifier: 'Identifier',
|
|
|
|
|
IfStatement: 'IfStatement',
|
|
|
|
|
Literal: 'Literal',
|
|
|
|
|
LogicalExpression: 'LogicalExpression',
|
|
|
|
|
MemberExpression: 'MemberExpression',
|
|
|
|
|
MethodDefinition: 'MethodDefinition',
|
|
|
|
|
ObjectExpression: 'ObjectExpression',
|
|
|
|
|
Program: 'Program',
|
|
|
|
|
Property: 'Property',
|
|
|
|
|
ReturnStatement: 'ReturnStatement',
|
|
|
|
|
TryStatement: 'TryStatement',
|
|
|
|
|
UnaryExpression: 'UnaryExpression',
|
|
|
|
|
UpdateExpression: 'UpdateExpression',
|
|
|
|
|
VariableDeclaration: 'VariableDeclaration',
|
|
|
|
|
VariableDeclarator: 'VariableDeclarator',
|
|
|
|
|
WhileStatement: 'WhileStatement'
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/***/ },
|
|
|
|
|
/* 4 */
|
|
|
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
|
|
|
|
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
|
|
|
|
|
|
var AppendState_1 = __webpack_require__(7);
|
|
|
|
|
var NodeUtils_1 = __webpack_require__(1);
|
|
|
|
|
|
|
|
|
|
var Node = function () {
|
|
|
|
|
function Node(options) {
|
|
|
|
|
_classCallCheck(this, Node);
|
|
|
|
|
|
|
|
|
|
this.appendState = AppendState_1.AppendState.BeforeObfuscation;
|
|
|
|
|
this.options = options;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_createClass(Node, [{
|
|
|
|
|
key: "getAppendState",
|
|
|
|
|
value: function getAppendState() {
|
|
|
|
|
return this.appendState;
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "getNode",
|
|
|
|
|
value: function getNode() {
|
|
|
|
|
NodeUtils_1.NodeUtils.parentize(this.node);
|
|
|
|
|
return this.node;
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "setNode",
|
|
|
|
|
value: function setNode(node) {
|
|
|
|
|
this.node = node;
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "updateNode",
|
|
|
|
|
value: function updateNode() {
|
|
|
|
|
this.node = this.getNodeStructure();
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
return Node;
|
|
|
|
|
}();
|
|
|
|
|
|
|
|
|
|
exports.Node = Node;
|
|
|
|
|
|
|
|
|
|
/***/ },
|
|
|
|
|
/* 5 */
|
|
|
|
|
/***/ function(module, exports) {
|
|
|
|
|
|
|
|
|
|
module.exports = require("estraverse");
|
|
|
|
|
|
|
|
|
|
/***/ },
|
|
|
|
|
/* 6 */
|
|
|
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
|
|
|
|
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
|
|
|
|
|
|
var JSFuck_1 = __webpack_require__(9);
|
|
|
|
|
var Nodes_1 = __webpack_require__(2);
|
|
|
|
|
var Utils_1 = __webpack_require__(0);
|
|
|
|
|
|
|
|
|
|
var NodeObfuscator = function () {
|
|
|
|
|
function NodeObfuscator(nodes, options) {
|
|
|
|
|
_classCallCheck(this, NodeObfuscator);
|
|
|
|
|
|
|
|
|
|
this.nodes = nodes;
|
|
|
|
|
this.options = options;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_createClass(NodeObfuscator, [{
|
|
|
|
|
key: "isReservedName",
|
|
|
|
|
value: function isReservedName(name) {
|
|
|
|
|
return this.options.get('reservedNames').some(function (reservedName) {
|
|
|
|
|
return new RegExp(reservedName, 'g').test(name);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "replaceNodeIdentifierByNewValue",
|
|
|
|
|
value: function replaceNodeIdentifierByNewValue(node, parentNode, namesMap) {
|
|
|
|
|
if (Nodes_1.Nodes.isIdentifierNode(node) && namesMap.has(node.name)) {
|
|
|
|
|
var parentNodeIsPropertyNode = Nodes_1.Nodes.isPropertyNode(parentNode) && parentNode.key === node,
|
|
|
|
|
parentNodeIsMemberExpressionNode = Nodes_1.Nodes.isMemberExpressionNode(parentNode) && parentNode.computed === false && parentNode.property === node;
|
|
|
|
|
if (parentNodeIsPropertyNode || parentNodeIsMemberExpressionNode) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
node.name = namesMap.get(node.name);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "replaceLiteralBooleanByJSFuck",
|
|
|
|
|
value: function replaceLiteralBooleanByJSFuck(nodeValue) {
|
|
|
|
|
return nodeValue ? JSFuck_1.JSFuck.True : JSFuck_1.JSFuck.False;
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "replaceLiteralNumberByHexadecimalValue",
|
|
|
|
|
value: function replaceLiteralNumberByHexadecimalValue(nodeValue) {
|
|
|
|
|
var prefix = '0x';
|
|
|
|
|
if (!Utils_1.Utils.isInteger(nodeValue)) {
|
|
|
|
|
return String(nodeValue);
|
|
|
|
|
}
|
|
|
|
|
return "" + prefix + Utils_1.Utils.decToHex(nodeValue);
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "replaceLiteralValueByUnicodeValue",
|
|
|
|
|
value: function replaceLiteralValueByUnicodeValue(nodeValue) {
|
|
|
|
|
var value = nodeValue,
|
|
|
|
|
replaceByUnicodeArrayFlag = Math.random() <= this.options.get('unicodeArrayThreshold');
|
|
|
|
|
if (this.options.get('encodeUnicodeLiterals') && replaceByUnicodeArrayFlag) {
|
|
|
|
|
value = Utils_1.Utils.btoa(value);
|
|
|
|
|
}
|
|
|
|
|
value = Utils_1.Utils.stringToUnicode(value);
|
|
|
|
|
if (!this.options.get('unicodeArray') || !replaceByUnicodeArrayFlag) {
|
|
|
|
|
return value;
|
|
|
|
|
}
|
|
|
|
|
return this.replaceLiteralValueByUnicodeArrayCall(value);
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "replaceLiteralValueByUnicodeArrayCall",
|
|
|
|
|
value: function replaceLiteralValueByUnicodeArrayCall(value) {
|
|
|
|
|
var unicodeArrayNode = this.nodes.get('unicodeArrayNode'),
|
|
|
|
|
unicodeArray = unicodeArrayNode.getNodeData(),
|
|
|
|
|
sameIndex = unicodeArray.indexOf(value),
|
|
|
|
|
index = void 0,
|
|
|
|
|
hexadecimalIndex = void 0;
|
|
|
|
|
if (sameIndex >= 0) {
|
|
|
|
|
index = sameIndex;
|
|
|
|
|
} else {
|
|
|
|
|
index = unicodeArray.length;
|
|
|
|
|
unicodeArrayNode.updateNodeData(value);
|
|
|
|
|
}
|
|
|
|
|
hexadecimalIndex = this.replaceLiteralNumberByHexadecimalValue(index);
|
|
|
|
|
if (this.options.get('wrapUnicodeArrayCalls')) {
|
|
|
|
|
return this.nodes.get('unicodeArrayCallsWrapper').getNodeIdentifier() + "('" + hexadecimalIndex + "')";
|
|
|
|
|
}
|
|
|
|
|
return unicodeArrayNode.getNodeIdentifier() + "[" + hexadecimalIndex + "]";
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
return NodeObfuscator;
|
|
|
|
|
}();
|
|
|
|
|
|
|
|
|
|
exports.NodeObfuscator = NodeObfuscator;
|
|
|
|
|
|
|
|
|
|
/***/ },
|
|
|
|
|
/* 7 */
|
|
|
|
|
/***/ function(module, exports) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
(function (AppendState) {
|
|
|
|
|
AppendState[AppendState["AfterObfuscation"] = 0] = "AfterObfuscation";
|
|
|
|
|
AppendState[AppendState["BeforeObfuscation"] = 1] = "BeforeObfuscation";
|
|
|
|
|
})(exports.AppendState || (exports.AppendState = {}));
|
|
|
|
|
var AppendState = exports.AppendState;
|
|
|
|
|
|
|
|
|
|
/***/ },
|
|
|
|
|
/* 8 */
|
|
|
|
|
/***/ function(module, exports) {
|
|
|
|
|
|
|
|
|
|
module.exports = require("esprima");
|
|
|
|
|
|
|
|
|
|
/***/ },
|
|
|
|
|
/* 9 */
|
|
|
|
|
/***/ function(module, exports) {
|
|
|
|
@@ -687,7 +697,7 @@ module.exports =
|
|
|
|
|
|
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
|
|
|
|
|
|
var esprima = __webpack_require__(8);
|
|
|
|
|
var esprima = __webpack_require__(7);
|
|
|
|
|
var escodegen = __webpack_require__(10);
|
|
|
|
|
var Obfuscator_1 = __webpack_require__(16);
|
|
|
|
|
var Options_1 = __webpack_require__(17);
|
|
|
|
@@ -807,9 +817,9 @@ module.exports =
|
|
|
|
|
|
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
|
|
|
|
|
|
var estraverse = __webpack_require__(5);
|
|
|
|
|
var AppendState_1 = __webpack_require__(7);
|
|
|
|
|
var NodeType_1 = __webpack_require__(3);
|
|
|
|
|
var estraverse = __webpack_require__(3);
|
|
|
|
|
var AppendState_1 = __webpack_require__(6);
|
|
|
|
|
var NodeType_1 = __webpack_require__(2);
|
|
|
|
|
var CatchClauseObfuscator_1 = __webpack_require__(31);
|
|
|
|
|
var ConsoleOutputDisableExpressionNode_1 = __webpack_require__(19);
|
|
|
|
|
var DebugProtectionNodesGroup_1 = __webpack_require__(28);
|
|
|
|
@@ -1037,7 +1047,7 @@ module.exports =
|
|
|
|
|
|
|
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
|
|
|
|
|
|
|
|
var esprima = __webpack_require__(8);
|
|
|
|
|
var esprima = __webpack_require__(7);
|
|
|
|
|
var Node_1 = __webpack_require__(4);
|
|
|
|
|
var NodeUtils_1 = __webpack_require__(1);
|
|
|
|
|
|
|
|
|
@@ -1085,7 +1095,7 @@ module.exports =
|
|
|
|
|
|
|
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
|
|
|
|
|
|
|
|
var NodeType_1 = __webpack_require__(3);
|
|
|
|
|
var NodeType_1 = __webpack_require__(2);
|
|
|
|
|
var Node_1 = __webpack_require__(4);
|
|
|
|
|
var NodeUtils_1 = __webpack_require__(1);
|
|
|
|
|
|
|
|
|
@@ -1144,7 +1154,7 @@ module.exports =
|
|
|
|
|
|
|
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
|
|
|
|
|
|
|
|
var NodeType_1 = __webpack_require__(3);
|
|
|
|
|
var NodeType_1 = __webpack_require__(2);
|
|
|
|
|
var Node_1 = __webpack_require__(4);
|
|
|
|
|
var NodeUtils_1 = __webpack_require__(1);
|
|
|
|
|
|
|
|
|
@@ -1228,7 +1238,7 @@ module.exports =
|
|
|
|
|
|
|
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
|
|
|
|
|
|
|
|
var esprima = __webpack_require__(8);
|
|
|
|
|
var esprima = __webpack_require__(7);
|
|
|
|
|
var Node_1 = __webpack_require__(4);
|
|
|
|
|
var NodeUtils_1 = __webpack_require__(1);
|
|
|
|
|
var Utils_1 = __webpack_require__(0);
|
|
|
|
@@ -1288,8 +1298,8 @@ module.exports =
|
|
|
|
|
|
|
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
|
|
|
|
|
|
|
|
var esprima = __webpack_require__(8);
|
|
|
|
|
var AppendState_1 = __webpack_require__(7);
|
|
|
|
|
var esprima = __webpack_require__(7);
|
|
|
|
|
var AppendState_1 = __webpack_require__(6);
|
|
|
|
|
var JSFuck_1 = __webpack_require__(9);
|
|
|
|
|
var NoCustomNodesPreset_1 = __webpack_require__(13);
|
|
|
|
|
var JavaScriptObfuscator_1 = __webpack_require__(11);
|
|
|
|
@@ -1354,8 +1364,8 @@ module.exports =
|
|
|
|
|
|
|
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
|
|
|
|
|
|
|
|
var esprima = __webpack_require__(8);
|
|
|
|
|
var AppendState_1 = __webpack_require__(7);
|
|
|
|
|
var esprima = __webpack_require__(7);
|
|
|
|
|
var AppendState_1 = __webpack_require__(6);
|
|
|
|
|
var Node_1 = __webpack_require__(4);
|
|
|
|
|
var NodeUtils_1 = __webpack_require__(1);
|
|
|
|
|
var Utils_1 = __webpack_require__(0);
|
|
|
|
@@ -1428,9 +1438,9 @@ module.exports =
|
|
|
|
|
|
|
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
|
|
|
|
|
|
|
|
var esprima = __webpack_require__(8);
|
|
|
|
|
var esprima = __webpack_require__(7);
|
|
|
|
|
var JavaScriptObfuscator_1 = __webpack_require__(11);
|
|
|
|
|
var AppendState_1 = __webpack_require__(7);
|
|
|
|
|
var AppendState_1 = __webpack_require__(6);
|
|
|
|
|
var JSFuck_1 = __webpack_require__(9);
|
|
|
|
|
var NoCustomNodesPreset_1 = __webpack_require__(13);
|
|
|
|
|
var Node_1 = __webpack_require__(4);
|
|
|
|
@@ -1509,8 +1519,8 @@ module.exports =
|
|
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
|
|
|
|
|
|
|
|
var escodegen = __webpack_require__(10);
|
|
|
|
|
var AppendState_1 = __webpack_require__(7);
|
|
|
|
|
var NodeType_1 = __webpack_require__(3);
|
|
|
|
|
var AppendState_1 = __webpack_require__(6);
|
|
|
|
|
var NodeType_1 = __webpack_require__(2);
|
|
|
|
|
var Node_1 = __webpack_require__(4);
|
|
|
|
|
var NodeUtils_1 = __webpack_require__(1);
|
|
|
|
|
var Utils_1 = __webpack_require__(0);
|
|
|
|
@@ -1618,8 +1628,8 @@ module.exports =
|
|
|
|
|
|
|
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
|
|
|
|
|
|
|
|
var esprima = __webpack_require__(8);
|
|
|
|
|
var AppendState_1 = __webpack_require__(7);
|
|
|
|
|
var esprima = __webpack_require__(7);
|
|
|
|
|
var AppendState_1 = __webpack_require__(6);
|
|
|
|
|
var JSFuck_1 = __webpack_require__(9);
|
|
|
|
|
var NoCustomNodesPreset_1 = __webpack_require__(13);
|
|
|
|
|
var JavaScriptObfuscator_1 = __webpack_require__(11);
|
|
|
|
@@ -1828,10 +1838,8 @@ module.exports =
|
|
|
|
|
|
|
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
|
|
|
|
|
|
|
|
var estraverse = __webpack_require__(5);
|
|
|
|
|
var NodeObfuscator_1 = __webpack_require__(6);
|
|
|
|
|
var Nodes_1 = __webpack_require__(2);
|
|
|
|
|
var Utils_1 = __webpack_require__(0);
|
|
|
|
|
var estraverse = __webpack_require__(3);
|
|
|
|
|
var NodeObfuscator_1 = __webpack_require__(5);
|
|
|
|
|
|
|
|
|
|
var CatchClauseObfuscator = function (_NodeObfuscator_1$Nod) {
|
|
|
|
|
_inherits(CatchClauseObfuscator, _NodeObfuscator_1$Nod);
|
|
|
|
@@ -1854,33 +1862,28 @@ module.exports =
|
|
|
|
|
_createClass(CatchClauseObfuscator, [{
|
|
|
|
|
key: 'obfuscateNode',
|
|
|
|
|
value: function obfuscateNode(catchClauseNode) {
|
|
|
|
|
this.storeCatchClauseParam(catchClauseNode);
|
|
|
|
|
this.replaceCatchClauseParam(catchClauseNode);
|
|
|
|
|
this.replaceCatchClauseParamInBlockStatement(catchClauseNode);
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: 'replaceCatchClauseParam',
|
|
|
|
|
value: function replaceCatchClauseParam(catchClauseNode) {
|
|
|
|
|
key: 'storeCatchClauseParam',
|
|
|
|
|
value: function storeCatchClauseParam(catchClauseNode) {
|
|
|
|
|
var _this2 = this;
|
|
|
|
|
|
|
|
|
|
estraverse.replace(catchClauseNode.param, {
|
|
|
|
|
leave: function leave(node, parentNode) {
|
|
|
|
|
if (Nodes_1.Nodes.isIdentifierNode(node) && !_this2.isReservedName(node.name)) {
|
|
|
|
|
_this2.catchClauseParam.set(node.name, Utils_1.Utils.getRandomVariableName());
|
|
|
|
|
node.name = _this2.catchClauseParam.get(node.name);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
return estraverse.VisitorOption.Skip;
|
|
|
|
|
estraverse.traverse(catchClauseNode.param, {
|
|
|
|
|
leave: function leave(node) {
|
|
|
|
|
return _this2.storeIdentifiersNames(node, _this2.catchClauseParam);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: 'replaceCatchClauseParamInBlockStatement',
|
|
|
|
|
value: function replaceCatchClauseParamInBlockStatement(catchClauseNode) {
|
|
|
|
|
key: 'replaceCatchClauseParam',
|
|
|
|
|
value: function replaceCatchClauseParam(catchClauseNode) {
|
|
|
|
|
var _this3 = this;
|
|
|
|
|
|
|
|
|
|
estraverse.replace(catchClauseNode.body, {
|
|
|
|
|
estraverse.replace(catchClauseNode, {
|
|
|
|
|
leave: function leave(node, parentNode) {
|
|
|
|
|
_this3.replaceNodeIdentifierByNewValue(node, parentNode, _this3.catchClauseParam);
|
|
|
|
|
_this3.replaceIdentifiersWithRandomNames(node, parentNode, _this3.catchClauseParam);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
@@ -1906,12 +1909,10 @@ module.exports =
|
|
|
|
|
|
|
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
|
|
|
|
|
|
|
|
var estraverse = __webpack_require__(5);
|
|
|
|
|
var NodeType_1 = __webpack_require__(3);
|
|
|
|
|
var NodeObfuscator_1 = __webpack_require__(6);
|
|
|
|
|
var Nodes_1 = __webpack_require__(2);
|
|
|
|
|
var estraverse = __webpack_require__(3);
|
|
|
|
|
var NodeType_1 = __webpack_require__(2);
|
|
|
|
|
var NodeObfuscator_1 = __webpack_require__(5);
|
|
|
|
|
var NodeUtils_1 = __webpack_require__(1);
|
|
|
|
|
var Utils_1 = __webpack_require__(0);
|
|
|
|
|
|
|
|
|
|
var FunctionDeclarationObfuscator = function (_NodeObfuscator_1$Nod) {
|
|
|
|
|
_inherits(FunctionDeclarationObfuscator, _NodeObfuscator_1$Nod);
|
|
|
|
@@ -1937,34 +1938,29 @@ module.exports =
|
|
|
|
|
if (parentNode.type === NodeType_1.NodeType.Program) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
this.storeFunctionName(functionDeclarationNode);
|
|
|
|
|
this.replaceFunctionName(functionDeclarationNode);
|
|
|
|
|
this.replaceFunctionCalls(functionDeclarationNode);
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "replaceFunctionName",
|
|
|
|
|
value: function replaceFunctionName(functionDeclarationNode) {
|
|
|
|
|
key: "storeFunctionName",
|
|
|
|
|
value: function storeFunctionName(functionDeclarationNode) {
|
|
|
|
|
var _this2 = this;
|
|
|
|
|
|
|
|
|
|
estraverse.replace(functionDeclarationNode.id, {
|
|
|
|
|
estraverse.traverse(functionDeclarationNode.id, {
|
|
|
|
|
leave: function leave(node) {
|
|
|
|
|
if (Nodes_1.Nodes.isIdentifierNode(node) && !_this2.isReservedName(node.name)) {
|
|
|
|
|
_this2.functionName.set(node.name, Utils_1.Utils.getRandomVariableName());
|
|
|
|
|
node.name = _this2.functionName.get(node.name);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
return estraverse.VisitorOption.Skip;
|
|
|
|
|
return _this2.storeIdentifiersNames(node, _this2.functionName);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "replaceFunctionCalls",
|
|
|
|
|
value: function replaceFunctionCalls(functionDeclarationNode) {
|
|
|
|
|
key: "replaceFunctionName",
|
|
|
|
|
value: function replaceFunctionName(functionDeclarationNode) {
|
|
|
|
|
var _this3 = this;
|
|
|
|
|
|
|
|
|
|
var scopeNode = NodeUtils_1.NodeUtils.getBlockScopeOfNode(functionDeclarationNode);
|
|
|
|
|
estraverse.replace(scopeNode, {
|
|
|
|
|
enter: function enter(node, parentNode) {
|
|
|
|
|
_this3.replaceNodeIdentifierByNewValue(node, parentNode, _this3.functionName);
|
|
|
|
|
_this3.replaceIdentifiersWithRandomNames(node, parentNode, _this3.functionName);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
@@ -1990,10 +1986,8 @@ module.exports =
|
|
|
|
|
|
|
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
|
|
|
|
|
|
|
|
var estraverse = __webpack_require__(5);
|
|
|
|
|
var NodeObfuscator_1 = __webpack_require__(6);
|
|
|
|
|
var Nodes_1 = __webpack_require__(2);
|
|
|
|
|
var Utils_1 = __webpack_require__(0);
|
|
|
|
|
var estraverse = __webpack_require__(3);
|
|
|
|
|
var NodeObfuscator_1 = __webpack_require__(5);
|
|
|
|
|
|
|
|
|
|
var FunctionObfuscator = function (_NodeObfuscator_1$Nod) {
|
|
|
|
|
_inherits(FunctionObfuscator, _NodeObfuscator_1$Nod);
|
|
|
|
@@ -2016,37 +2010,36 @@ module.exports =
|
|
|
|
|
_createClass(FunctionObfuscator, [{
|
|
|
|
|
key: 'obfuscateNode',
|
|
|
|
|
value: function obfuscateNode(functionNode) {
|
|
|
|
|
this.storeFunctionParams(functionNode);
|
|
|
|
|
this.replaceFunctionParams(functionNode);
|
|
|
|
|
this.replaceFunctionParamsInBlockStatement(functionNode);
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: 'replaceFunctionParams',
|
|
|
|
|
value: function replaceFunctionParams(functionNode) {
|
|
|
|
|
key: 'storeFunctionParams',
|
|
|
|
|
value: function storeFunctionParams(functionNode) {
|
|
|
|
|
var _this2 = this;
|
|
|
|
|
|
|
|
|
|
functionNode.params.forEach(function (paramsNode) {
|
|
|
|
|
estraverse.replace(paramsNode, {
|
|
|
|
|
estraverse.traverse(paramsNode, {
|
|
|
|
|
leave: function leave(node) {
|
|
|
|
|
if (Nodes_1.Nodes.isIdentifierNode(node) && !_this2.isReservedName(node.name)) {
|
|
|
|
|
_this2.functionParams.set(node.name, Utils_1.Utils.getRandomVariableName());
|
|
|
|
|
node.name = _this2.functionParams.get(node.name);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
return estraverse.VisitorOption.Skip;
|
|
|
|
|
return _this2.storeIdentifiersNames(node, _this2.functionParams);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: 'replaceFunctionParamsInBlockStatement',
|
|
|
|
|
value: function replaceFunctionParamsInBlockStatement(functionNode) {
|
|
|
|
|
key: 'replaceFunctionParams',
|
|
|
|
|
value: function replaceFunctionParams(functionNode) {
|
|
|
|
|
var _this3 = this;
|
|
|
|
|
|
|
|
|
|
estraverse.replace(functionNode.body, {
|
|
|
|
|
var replaceVisitor = {
|
|
|
|
|
leave: function leave(node, parentNode) {
|
|
|
|
|
_this3.replaceNodeIdentifierByNewValue(node, parentNode, _this3.functionParams);
|
|
|
|
|
_this3.replaceIdentifiersWithRandomNames(node, parentNode, _this3.functionParams);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
functionNode.params.forEach(function (paramsNode) {
|
|
|
|
|
estraverse.replace(paramsNode, replaceVisitor);
|
|
|
|
|
});
|
|
|
|
|
estraverse.replace(functionNode.body, replaceVisitor);
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
@@ -2073,8 +2066,8 @@ module.exports =
|
|
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
|
|
|
|
|
|
|
|
var escodegen = __webpack_require__(10);
|
|
|
|
|
var NodeObfuscator_1 = __webpack_require__(6);
|
|
|
|
|
var Nodes_1 = __webpack_require__(2);
|
|
|
|
|
var NodeObfuscator_1 = __webpack_require__(5);
|
|
|
|
|
var Nodes_1 = __webpack_require__(8);
|
|
|
|
|
|
|
|
|
|
var LiteralObfuscator = function (_NodeObfuscator_1$Nod) {
|
|
|
|
|
_inherits(LiteralObfuscator, _NodeObfuscator_1$Nod);
|
|
|
|
@@ -2097,13 +2090,13 @@ module.exports =
|
|
|
|
|
var content = void 0;
|
|
|
|
|
switch (_typeof(literalNode.value)) {
|
|
|
|
|
case 'boolean':
|
|
|
|
|
content = this.replaceLiteralBooleanByJSFuck(literalNode.value);
|
|
|
|
|
content = this.replaceLiteralBooleanWithJSFuck(literalNode.value);
|
|
|
|
|
break;
|
|
|
|
|
case 'number':
|
|
|
|
|
content = this.replaceLiteralNumberByHexadecimalValue(literalNode.value);
|
|
|
|
|
content = this.replaceLiteralNumberWithHexadecimalValue(literalNode.value);
|
|
|
|
|
break;
|
|
|
|
|
case 'string':
|
|
|
|
|
content = this.replaceLiteralValueByUnicodeValue(literalNode.value);
|
|
|
|
|
content = this.replaceLiteralValueWithUnicodeValue(literalNode.value);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
return;
|
|
|
|
@@ -2138,10 +2131,10 @@ module.exports =
|
|
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
|
|
|
|
|
|
|
|
var escodegen = __webpack_require__(10);
|
|
|
|
|
var estraverse = __webpack_require__(5);
|
|
|
|
|
var NodeType_1 = __webpack_require__(3);
|
|
|
|
|
var NodeObfuscator_1 = __webpack_require__(6);
|
|
|
|
|
var Nodes_1 = __webpack_require__(2);
|
|
|
|
|
var estraverse = __webpack_require__(3);
|
|
|
|
|
var NodeType_1 = __webpack_require__(2);
|
|
|
|
|
var NodeObfuscator_1 = __webpack_require__(5);
|
|
|
|
|
var Nodes_1 = __webpack_require__(8);
|
|
|
|
|
|
|
|
|
|
var MemberExpressionObfuscator = function (_NodeObfuscator_1$Nod) {
|
|
|
|
|
_inherits(MemberExpressionObfuscator, _NodeObfuscator_1$Nod);
|
|
|
|
@@ -2180,7 +2173,7 @@ module.exports =
|
|
|
|
|
literalNode = {
|
|
|
|
|
raw: '\'' + nodeValue + '\'',
|
|
|
|
|
'x-verbatim-property': {
|
|
|
|
|
content: this.replaceLiteralValueByUnicodeValue(nodeValue),
|
|
|
|
|
content: this.replaceLiteralValueWithUnicodeValue(nodeValue),
|
|
|
|
|
precedence: escodegen.Precedence.Primary
|
|
|
|
|
},
|
|
|
|
|
type: NodeType_1.NodeType.Literal,
|
|
|
|
@@ -2198,7 +2191,7 @@ module.exports =
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
node['x-verbatim-property'] = {
|
|
|
|
|
content: this.replaceLiteralValueByUnicodeValue(node.value),
|
|
|
|
|
content: this.replaceLiteralValueWithUnicodeValue(node.value),
|
|
|
|
|
precedence: escodegen.Precedence.Primary
|
|
|
|
|
};
|
|
|
|
|
break;
|
|
|
|
@@ -2228,9 +2221,9 @@ module.exports =
|
|
|
|
|
|
|
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
|
|
|
|
|
|
|
|
var estraverse = __webpack_require__(5);
|
|
|
|
|
var NodeObfuscator_1 = __webpack_require__(6);
|
|
|
|
|
var Nodes_1 = __webpack_require__(2);
|
|
|
|
|
var estraverse = __webpack_require__(3);
|
|
|
|
|
var NodeObfuscator_1 = __webpack_require__(5);
|
|
|
|
|
var Nodes_1 = __webpack_require__(8);
|
|
|
|
|
var Utils_1 = __webpack_require__(0);
|
|
|
|
|
|
|
|
|
|
var MethodDefinitionObfuscator = function (_NodeObfuscator_1$Nod) {
|
|
|
|
@@ -2265,7 +2258,7 @@ module.exports =
|
|
|
|
|
leave: function leave(node) {
|
|
|
|
|
if (Nodes_1.Nodes.isIdentifierNode(node) && !Utils_1.Utils.arrayContains(_this2.ignoredNames, node.name) && methodDefinitionNode.computed === false) {
|
|
|
|
|
methodDefinitionNode.computed = true;
|
|
|
|
|
node.name = _this2.replaceLiteralValueByUnicodeValue(node.name);
|
|
|
|
|
node.name = _this2.replaceLiteralValueWithUnicodeValue(node.name);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
return estraverse.VisitorOption.Skip;
|
|
|
|
@@ -2297,10 +2290,10 @@ module.exports =
|
|
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
|
|
|
|
|
|
|
|
var escodegen = __webpack_require__(10);
|
|
|
|
|
var estraverse = __webpack_require__(5);
|
|
|
|
|
var NodeType_1 = __webpack_require__(3);
|
|
|
|
|
var NodeObfuscator_1 = __webpack_require__(6);
|
|
|
|
|
var Nodes_1 = __webpack_require__(2);
|
|
|
|
|
var estraverse = __webpack_require__(3);
|
|
|
|
|
var NodeType_1 = __webpack_require__(2);
|
|
|
|
|
var NodeObfuscator_1 = __webpack_require__(5);
|
|
|
|
|
var Nodes_1 = __webpack_require__(8);
|
|
|
|
|
var Utils_1 = __webpack_require__(0);
|
|
|
|
|
|
|
|
|
|
var ObjectExpressionObfuscator = function (_NodeObfuscator_1$Nod) {
|
|
|
|
@@ -2386,10 +2379,9 @@ module.exports =
|
|
|
|
|
|
|
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
|
|
|
|
|
|
|
|
var estraverse = __webpack_require__(5);
|
|
|
|
|
var NodeType_1 = __webpack_require__(3);
|
|
|
|
|
var NodeObfuscator_1 = __webpack_require__(6);
|
|
|
|
|
var Nodes_1 = __webpack_require__(2);
|
|
|
|
|
var estraverse = __webpack_require__(3);
|
|
|
|
|
var NodeType_1 = __webpack_require__(2);
|
|
|
|
|
var NodeObfuscator_1 = __webpack_require__(5);
|
|
|
|
|
var NodeUtils_1 = __webpack_require__(1);
|
|
|
|
|
var Utils_1 = __webpack_require__(0);
|
|
|
|
|
|
|
|
|
@@ -2417,30 +2409,25 @@ module.exports =
|
|
|
|
|
if (parentNode.type === NodeType_1.NodeType.Program) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
this.replaceVariableName(variableDeclarationNode);
|
|
|
|
|
this.replaceVariableCalls(variableDeclarationNode, parentNode);
|
|
|
|
|
this.storeVariableNames(variableDeclarationNode);
|
|
|
|
|
this.replaceVariableNames(variableDeclarationNode, parentNode);
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "replaceVariableName",
|
|
|
|
|
value: function replaceVariableName(variableDeclarationNode) {
|
|
|
|
|
key: "storeVariableNames",
|
|
|
|
|
value: function storeVariableNames(variableDeclarationNode) {
|
|
|
|
|
var _this2 = this;
|
|
|
|
|
|
|
|
|
|
variableDeclarationNode.declarations.forEach(function (declarationNode) {
|
|
|
|
|
estraverse.replace(declarationNode.id, {
|
|
|
|
|
estraverse.traverse(declarationNode.id, {
|
|
|
|
|
enter: function enter(node) {
|
|
|
|
|
if (Nodes_1.Nodes.isIdentifierNode(node) && !_this2.isReservedName(node.name)) {
|
|
|
|
|
_this2.variableNames.set(node.name, Utils_1.Utils.getRandomVariableName());
|
|
|
|
|
node.name = _this2.variableNames.get(node.name);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
return estraverse.VisitorOption.Skip;
|
|
|
|
|
return _this2.storeIdentifiersNames(node, _this2.variableNames);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "replaceVariableCalls",
|
|
|
|
|
value: function replaceVariableCalls(variableDeclarationNode, variableParentNode) {
|
|
|
|
|
key: "replaceVariableNames",
|
|
|
|
|
value: function replaceVariableNames(variableDeclarationNode, variableParentNode) {
|
|
|
|
|
var _this3 = this;
|
|
|
|
|
|
|
|
|
|
var scopeNode = variableDeclarationNode.kind === 'var' ? NodeUtils_1.NodeUtils.getBlockScopeOfNode(variableDeclarationNode) : variableParentNode,
|
|
|
|
@@ -2451,7 +2438,7 @@ module.exports =
|
|
|
|
|
if (Utils_1.Utils.arrayContains(functionNodes, node.type)) {
|
|
|
|
|
estraverse.replace(node, {
|
|
|
|
|
enter: function enter(node, parentNode) {
|
|
|
|
|
_this3.replaceNodeIdentifierByNewValue(node, parentNode, _this3.variableNames);
|
|
|
|
|
_this3.replaceIdentifiersWithRandomNames(node, parentNode, _this3.variableNames);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
@@ -2459,7 +2446,7 @@ module.exports =
|
|
|
|
|
isNodeAfterVariableDeclaratorFlag = true;
|
|
|
|
|
}
|
|
|
|
|
if (isNodeAfterVariableDeclaratorFlag) {
|
|
|
|
|
_this3.replaceNodeIdentifierByNewValue(node, parentNode, _this3.variableNames);
|
|
|
|
|
_this3.replaceIdentifiersWithRandomNames(node, parentNode, _this3.variableNames);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|