Improvements of stringArrayEncoding: base64 and rc4

This commit is contained in:
sanex3339
2020-07-02 10:13:57 +03:00
parent e625757ae0
commit 7eb25bb403
16 changed files with 85 additions and 53 deletions
@@ -7,6 +7,7 @@ import { NO_ADDITIONAL_NODES_PRESET } from '../../../../../src/options/presets/N
import { readFileAsString } from '../../../../helpers/readFileAsString';
import { getRegExpMatch } from '../../../../helpers/getRegExpMatch';
import { swapLettersCase } from '../../../../helpers/swapLettersCase';
import { JavaScriptObfuscator } from '../../../../../src/JavaScriptObfuscatorFacade';
@@ -186,7 +187,7 @@ describe('LiteralTransformer', () => {
});
describe('Variant #8: base64 encoding', () => {
const stringArrayRegExp: RegExp = /^var _0x([a-f0-9]){4} *= *\['dGVzdA=='\];/;
const stringArrayRegExp: RegExp = new RegExp(`^var _0x([a-f0-9]){4} *= *\\['${swapLettersCase('dGVzdA==')}'];`);
const stringArrayCallRegExp: RegExp = /var test *= *_0x([a-f0-9]){4}\('0x0'\);/;
let obfuscatedCode: string;