javascript-deobfuscator icon indicating copy to clipboard operation
javascript-deobfuscator copied to clipboard

Cannot deobfuscate private fields

Open Kaizer69 opened this issue 2 years ago • 2 comments

Hello! I try to deobfuscate a file that have private fields (hash char #): here docs on mozilla

..............node_modules\shift-parser\dist\tokenizer.js:1536
        throw this.createILLEGAL();
        ^
Error: [1:6801]: Unexpected "#"
Console error:
  index: 6800,
  line: 1,
  column: 6801,
  parseErrorLine: 1,
  parseErrorColumn: 6801,
  description: 'Unexpected "#"'

I guess it's a problem related to shift-parser that not support those new spec.

Kaizer69 avatar Aug 01 '22 09:08 Kaizer69

Yeah it is, only option to fix that would be rewriting the repo using another parser lib which I don't have time to do currently sadly

ben-sb avatar Aug 02 '22 20:08 ben-sb

I, too, was uninspired when choosing a parser for a more targeted deobfuscator. I went with esprima, which doesn't support a lot of newer language features as well. As a workaround I found that transpiling the code to a compatible version via babel before deobfuscation works well and removes the need of rewriting the project with another parser.

0x1Avram avatar Jan 03 '23 15:01 0x1Avram