Skip to content

'high-obfuscation' preset does not do 'split-strings' by default #1236

@gunsh

Description

Expected Behavior

Judging by the docs and source code --split-strings true should be the default when using --options-preset high-obfuscation but it does not seem to work.

It is expected that the high-obfuscation preset includes split-string by default. Source code seems to indicate exactly that but the tests disprove it.

Current Behavior

Running the two commands below yield significantly different file sizes (especially on a large file).

  • ./javascript-obfuscator --options-preset high-obfuscation file.js
  • ./javascript-obfuscator --options-preset high-obfuscation --split-strings true file.js

Looking at the generated code here are the related bits, respectively.

  • 'This\x20is\x20a\x20long\x20string\x20and\x20it\x20should\x20really\x20be\x20split\x20by\x20the\x20obfuscator!'
  • const _0x483d67 = a0_0x56a5, _0x3e020d = (_0x483d67(0x93) + 'long\x20strin' + 'g\x20and\x20it\x20s' + 'hould\x20real' + _0x483d67(0x8a) + _0x483d67(0x94) + 'bfuscator!')[_0x483d67(0x91)][_0x483d67(0x8b)](_0x3e020d);

Steps to Reproduce

  1. Use a file.js with a large enough string (sample file attached)
  2. Run the two commands above and note how the string gets split only in the 2nd run

Your Environment

  • Obfuscator version used: 4.1.0_2023-09-05T17:31:38.835Z
  • Node version used: v20.10.0

file.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions