j4k0xb / webcrack

Deobfuscate obfuscator.io, unminify and unpack bundled javascript
https://webcrack.netlify.app
MIT License
647 stars 73 forks source link

Duplicated variable initialization when unminifying #54

Closed mobapedia closed 5 months ago

mobapedia commented 5 months ago

Any variables initialized inside a for loop inside an inline if statement will be duplicated when unminifying.

for example:

if (1) for (a=1,b=2,c=3;a<10;a++){}

will turn into:

if (1) {
  a = 1;
  b = 2;
  c = 3;
  a = 1;
  b = 2;
  c = 3;
  for (; a < 10; a++) {}
}
j4k0xb commented 5 months ago

Nice catch 👍🏻 Fixed in https://github.com/j4k0xb/webcrack/commit/2d889c69be4f81f223d369f3e1c28720f932503c (playground is already updated, npm release will follow soon)