Skip to content

obfuscate with unicode characters like 䮾, 鸗, 䰱, 䪊 #1074

@the-eric-kwok

Description

@the-eric-kwok

Is your feature request related to a problem? Please describe.
This is not necessary but fun to obfuscate all variable with unicode characters. Now if I use emoji as dictionary and pass it to --identifiers-dictionary, the obfuscator will throw error:

/usr/local/lib/node_modules/javascript-obfuscator/dist/webpack:/javascript-obfuscator/src/generators/identifier-names-generators/DictionaryIdentifierNamesGenerator.ts:84
                throw new Error('Too many identifiers in the code, add more words to identifiers dictionary');
                      ^
Error: Too many identifiers in the code, add more words to identifiers dictionary
    at generateNewDictionaryName (/usr/local/lib/node_modules/javascript-obfuscator/dist/webpack:/javascript-obfuscator/src/generators/identifier-names-generators/DictionaryIdentifierNamesGenerator.ts:84:23)
    at generateNewDictionaryName (/usr/local/lib/node_modules/javascript-obfuscator/dist/webpack:/javascript-obfuscator/src/generators/identifier-names-generators/DictionaryIdentifierNamesGenerator.ts:97:20)
    at o.generateNewDictionaryName (/usr/local/lib/node_modules/javascript-obfuscator/dist/webpack:/javascript-obfuscator/src/generators/identifier-names-generators/DictionaryIdentifierNamesGenerator.ts:99:16)
    at o.generateForLexicalScope (/usr/local/lib/node_modules/javascript-obfuscator/dist/webpack:/javascript-obfuscator/src/generators/identifier-names-generators/DictionaryIdentifierNamesGenerator.ts:73:37)
    at g.storeLocalName (/usr/local/lib/node_modules/javascript-obfuscator/dist/webpack:/javascript-obfuscator/src/node-transformers/rename-identifiers-transformers/replacer/IdentifierReplacer.ts:50:65)
    at N.storeIdentifierName (/usr/local/lib/node_modules/javascript-obfuscator/dist/webpack:/javascript-obfuscator/src/node-transformers/dead-code-injection-transformers/DeadCodeInjectionIdentifiersTransformer.ts:62:33)
    at N.transformScopeThroughIdentifiers (/usr/local/lib/node_modules/javascript-obfuscator/dist/webpack:/javascript-obfuscator/src/node-transformers/dead-code-injection-transformers/DeadCodeInjectionIdentifiersTransformer.ts:58:14)
    at callback (/usr/local/lib/node_modules/javascript-obfuscator/dist/webpack:/javascript-obfuscator/src/node-transformers/dead-code-injection-transformers/DeadCodeInjectionIdentifiersTransformer.ts:49:18)
    at o.traverseScopeThroughIdentifiersRecursive (/usr/local/lib/node_modules/javascript-obfuscator/dist/webpack:/javascript-obfuscator/src/node/ScopeIdentifiersTraverser.ts:76:13)
    at o.traverseScopeThroughIdentifiersRecursive (/usr/local/lib/node_modules/javascript-obfuscator/dist/webpack:/javascript-obfuscator/src/node/ScopeIdentifiersTraverser.ts:83:18)

Describe the solution you'd like
Support passing unicode characters to --identifiers-dictionary


Update: sorry I thought use emoji as variable name is supported.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions