selfDefending test implementation

This commit is contained in:
sanex3339
2016-06-05 16:43:06 +03:00
parent 8384547eaf
commit 416b4e8e55
2 changed files with 12 additions and 6 deletions
@@ -23,9 +23,12 @@ class SelfDefendingUnicodeNode extends Node_1.Node {
getNodeStructure() {
let node = esprima.parse(JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate(`
(function () {
var func = function(){return ${Utils_1.Utils.stringToUnicode('dev')};};
!Function(${Utils_1.Utils.stringToUnicode(`return/\\w+ *\\(\\) *{\\w+ *['|"].+['|"];? *}/`)})().test(func.toString()) ? []['filter']['constructor'](${Utils_1.Utils.stringToJSFuck('while')} + '(${JSFuck_1.JSFuck.True}){}')() : !!!!!![] ? []['filter']['constructor'](${Utils_1.Utils.stringToJSFuck('while')} + '(${JSFuck_1.JSFuck.False}){}')() : []['filter']['constructor'](${Utils_1.Utils.stringToJSFuck('while')} + '(${JSFuck_1.JSFuck.False}){}')();
var func = function(){return ${Utils_1.Utils.stringToUnicode('dev')};},
func2 = function () {
return 'window';
};
!Function(${Utils_1.Utils.stringToUnicode(`return/\\w+ *\\(\\) *{\\w+ *['|"].+['|"];? *}/`)})().test(func.toString()) ? Function(${Utils_1.Utils.stringToUnicode(`return/(\\\\[x|u](\\w){2,4})+/`)})().test(func2.toString()) ? []['filter']['constructor'](${Utils_1.Utils.stringToJSFuck('while')} + '(${JSFuck_1.JSFuck.False}){}')() : []['filter']['constructor'](${Utils_1.Utils.stringToJSFuck('while')} + '(${JSFuck_1.JSFuck.True}){}')() : []['filter']['constructor'](${Utils_1.Utils.stringToJSFuck('while')} + '(${JSFuck_1.JSFuck.False}){}')();
})();
`, NoCustomNodesPreset_1.NO_CUSTOM_NODES_PRESET));
NodeUtils_1.NodeUtils.addXVerbatimPropertyToLiterals(node);
@@ -51,9 +51,12 @@ export class SelfDefendingUnicodeNode extends Node {
let node: INode = esprima.parse(
JavaScriptObfuscator.obfuscate(`
(function () {
var func = function(){return ${Utils.stringToUnicode('dev')};};
!Function(${Utils.stringToUnicode(`return/\\w+ *\\(\\) *{\\w+ *['|"].+['|"];? *}/`)})().test(func.toString()) ? []['filter']['constructor'](${Utils.stringToJSFuck('while')} + '(${JSFuck.True}){}')() : !!!!!![] ? []['filter']['constructor'](${Utils.stringToJSFuck('while')} + '(${JSFuck.False}){}')() : []['filter']['constructor'](${Utils.stringToJSFuck('while')} + '(${JSFuck.False}){}')();
var func = function(){return ${Utils.stringToUnicode('dev')};},
func2 = function () {
return 'window';
};
!Function(${Utils.stringToUnicode(`return/\\w+ *\\(\\) *{\\w+ *['|"].+['|"];? *}/`)})().test(func.toString()) ? Function(${Utils.stringToUnicode(`return/(\\\\[x|u](\\w){2,4})+/`)})().test(func2.toString()) ? []['filter']['constructor'](${Utils.stringToJSFuck('while')} + '(${JSFuck.False}){}')() : []['filter']['constructor'](${Utils.stringToJSFuck('while')} + '(${JSFuck.True}){}')() : []['filter']['constructor'](${Utils.stringToJSFuck('while')} + '(${JSFuck.False}){}')();
})();
`, NO_CUSTOM_NODES_PRESET)
);