Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected reserved word 'await' #285

Open
TheGreyRaven opened this issue Jan 21, 2025 · 6 comments
Open

Unexpected reserved word 'await' #285

TheGreyRaven opened this issue Jan 21, 2025 · 6 comments

Comments

@TheGreyRaven
Copy link

root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:359
    const error = new SyntaxError();
                  ^

SyntaxError: unknown: Unexpected reserved word 'await'. (638:6)

  636 |         return true;
  637 |       };
> 638 |       await _0x1f488e();
      |       ^
  639 |       clearInterval(_0x284d18);
  640 |       _0x284d18 = setInterval(_0x1f488e, 1000);
  641 |       $("#p_div_panel").show();
    at constructor (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:359:19)
    at Parser.raise (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:3327:19)
    at Parser.checkReservedWord (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:11878:12)
    at Parser.parseIdentifierName (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:11858:12)
    at Parser.parseIdentifier (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:11833:23)
    at Parser.parseExprAtom (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:11076:27)
    at Parser.parseExprSubscripts (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:10734:23)
    at Parser.parseUpdate (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:10719:21)
    at Parser.parseMaybeUnary (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:10699:23)
    at Parser.parseMaybeUnaryOrPrivate (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:10553:61)
    at Parser.parseExprOps (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:10558:23)
    at Parser.parseMaybeConditional (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:10535:23)
    at Parser.parseMaybeAssign (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:10498:21)
    at Parser.parseExpressionBase (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:10452:23)
    at /root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:10448:39
    at Parser.allowInAnd (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:12064:16)
    at Parser.parseExpression (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:10448:17)
    at Parser.parseStatementContent (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:12508:23)
    at Parser.parseStatementLike (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:12375:17)
    at Parser.parseStatementListItem (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:12355:17)
    at Parser.parseBlockOrModuleBlockBody (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:12929:61)
    at Parser.parseBlockBody (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:12922:10)
    at Parser.parseBlock (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:12910:10)
    at Parser.parseFunctionBody (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:11752:24)
    at Parser.parseFunctionBodyAndFinish (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:11738:10)
    at Parser.parseMethod (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:11696:31)
    at Parser.parseObjectMethod (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:11599:19)
    at Parser.parseObjPropValue (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:11630:23)
    at Parser.parsePropertyDefinition (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:11570:17)
    at Parser.parseObjectLike (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:11485:21)
    at Parser.parseExprAtom (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:11000:23)
    at Parser.parseExprSubscripts (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:10734:23)
    at Parser.parseUpdate (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:10719:21)
    at Parser.parseMaybeUnary (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:10699:23)
    at Parser.parseMaybeUnaryOrPrivate (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:10553:61)
    at Parser.parseExprOps (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:10558:23)
    at Parser.parseMaybeConditional (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:10535:23)
    at Parser.parseMaybeAssign (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:10498:21)
    at /root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:10468:39
    at Parser.allowInAnd (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:12069:12)
    at Parser.parseMaybeAssignAllowIn (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:10468:17)
    at Parser.parseObjectProperty (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:11605:83)
    at Parser.parseObjPropValue (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:11630:100)
    at Parser.parsePropertyDefinition (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:11570:17)
    at Parser.parseObjectLike (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:11485:21)
    at Parser.parseExprAtom (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:11000:23)
    at Parser.parseExprSubscripts (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:10734:23)
    at Parser.parseUpdate (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:10719:21)
    at Parser.parseMaybeUnary (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:10699:23)
    at Parser.parseMaybeUnaryOrPrivate (/root/.local/share/fnm/node-versions/v22.13.0/installation/lib/node_modules/humanifyjs/node_modules/@babel/parser/lib/index.js:10553:61) {
  code: 'BABEL_PARSE_ERROR',
  reasonCode: 'UnexpectedReservedWord',
  loc: Position { line: 638, column: 6, index: 21637 },
  pos: 21637,
  syntaxPlugin: undefined
}

I have a quite heavily obfuscated file that fails with the following error shown above.
Not sure what you might need to debug this further, let me know and I can assist with both the file that I'm trying to deobfuscate.

I had a few other files that also contained some awaits and such and those files successfully deobfuscated, so not sure what might be the issue.
Also I'm running the local 2b to deobfuscate.

@0xdevalias
Copy link

@TheGreyRaven I would probably start by seeing if bumping to the latest version of @j4k0xb 's webcrack resolves the issue:

If it does, then the version in humanify needs to be updated.

If not and the issue is still present there, then it's probably worth opening an upstream issue and providing an ideally minimal example of the code to reproduce the error:

If not, but it works upstream, then providing an ideally minimal example of the code to reproduce the error here would make the most sense I think.

@TheGreyRaven
Copy link
Author

Ah I see, I tested pasting the obfuscated code into their online ide and there it deobuscated most of the code just fine.
Perhaps a version update would be a good idea!

@0xdevalias
Copy link

0xdevalias commented Jan 23, 2025

This project currently seems to be using 2.13.0:

"webcrack": "^2.13.0"

Latest webcrack seems to be 2.15.0:

@TheGreyRaven If you feel like doing a little more digging, it would be useful to know if you get the same error running webcrack directly on version 2.13.0, and which newer version seems to fix it. That would help provide relevant context for this bug report.

@j4k0xb
Copy link
Contributor

j4k0xb commented Jan 23, 2025

I remember a similar discussion regarding the version in this repo
It should already use the latest version due to the ^?

Since it works fine the first time I assume the generated code get's corrupted at some point.
Remember that the babel parser is used by humanify itself, webcrack, and prettier.

@brianjenkins94
Copy link

You can use overrides for quick testing:

#67 (comment)

@VivaLaPanda
Copy link

With overriding to latest webcrack, I still see this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants