forked from javascript-obfuscator/javascript-obfuscator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStringArrayCallsWrapperRc4CodeHelper.ts
More file actions
46 lines (40 loc) · 1.7 KB
/
Copy pathStringArrayCallsWrapperRc4CodeHelper.ts
File metadata and controls
46 lines (40 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import { injectable, } from 'inversify';
import { AtobTemplate } from './templates/string-array-calls-wrapper/AtobTemplate';
import { Rc4Template } from './templates/string-array-calls-wrapper/Rc4Template';
import { StringArrayRC4DecodeTemplate } from './templates/string-array-calls-wrapper/StringArrayRC4DecodeTemplate';
import { StringArrayCallsWrapperCodeHelper } from './StringArrayCallsWrapperCodeHelper';
@injectable()
export class StringArrayCallsWrapperRc4CodeHelper extends StringArrayCallsWrapperCodeHelper {
/**
* @returns {string}
*/
protected override getDecodeStringArrayTemplate (): string {
const atobFunctionName: string = this.randomGenerator.getRandomString(6);
const rc4FunctionName: string = this.randomGenerator.getRandomString(6);
const atobPolyfill: string = this.customCodeHelperFormatter.formatTemplate(
AtobTemplate(this.options.selfDefending),
{
atobFunctionName
}
);
const rc4Polyfill: string = this.customCodeHelperFormatter.formatTemplate(
Rc4Template(),
{
atobFunctionName,
rc4FunctionName
}
);
const selfDefendingCode: string = this.getSelfDefendingTemplate();
return this.customCodeHelperFormatter.formatTemplate(
StringArrayRC4DecodeTemplate(this.randomGenerator),
{
atobPolyfill,
rc4FunctionName,
rc4Polyfill,
selfDefendingCode,
stringArrayCallsWrapperName: this.stringArrayCallsWrapperName,
stringArrayCacheName: this.stringArrayCacheName
}
);
}
}