j4k0xb / webcrack

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

TypeError: Cannot read properties of undefined (reading 'isVariableDeclaration') #69

Closed manbaum closed 3 months ago

manbaum commented 8 months ago

Error raised when deobfuscate main.js file.

main.zip

The console output:

$ webcrack -o crack app/main.js
  webcrack:transforms prepare: started +0ms
  webcrack:transforms prepare: finished with 23537 changes +5s
  webcrack:transforms deobfuscate: started +1ms
  webcrack:deobfuscate String Array: no +0ms
  webcrack:transforms deobfuscate: finished with 0 changes +4s
  webcrack:transforms transpile, unminify: started +0ms
  webcrack:transforms transpile, unminify: finished with 215971 changes +7s
  webcrack:transforms self-defending, debug-protection, jsx, jsx-new: started +1ms
  webcrack:transforms self-defending, debug-protection, jsx, jsx-new: finished with 0 changes +1s
  webcrack:transforms merge-object-assignments: started +1ms
E:\.nvm\versions\node\v20.11.1\bin\node_modules\webcrack\node_modules\@babel\traverse\lib\scope\index.js:520
    if (path.isVariableDeclaration()) {
             ^

TypeError: Cannot read properties of undefined (reading 'isVariableDeclaration')
    at Scope.registerBinding (E:\.nvm\versions\node\v20.11.1\bin\node_modules\webcrack\node_modules\@babel\traverse\lib\scope\index.js:520:14)
    at Object.Function (E:\.nvm\versions\node\v20.11.1\bin\node_modules\webcrack\node_modules\@babel\traverse\lib\scope\index.js:267:18)
    at NodePath._call (E:\.nvm\versions\node\v20.11.1\bin\node_modules\webcrack\node_modules\@babel\traverse\lib\path\context.js:46:20)
    at NodePath.call (E:\.nvm\versions\node\v20.11.1\bin\node_modules\webcrack\node_modules\@babel\traverse\lib\path\context.js:36:17)
    at NodePath.visit (E:\.nvm\versions\node\v20.11.1\bin\node_modules\webcrack\node_modules\@babel\traverse\lib\path\context.js:82:31)
    at TraversalContext.visitQueue (E:\.nvm\versions\node\v20.11.1\bin\node_modules\webcrack\node_modules\@babel\traverse\lib\context.js:86:16)
    at TraversalContext.visitSingle (E:\.nvm\versions\node\v20.11.1\bin\node_modules\webcrack\node_modules\@babel\traverse\lib\context.js:65:19)
    at TraversalContext.visit (E:\.nvm\versions\node\v20.11.1\bin\node_modules\webcrack\node_modules\@babel\traverse\lib\context.js:109:19)
    at traverseNode (E:\.nvm\versions\node\v20.11.1\bin\node_modules\webcrack\node_modules\@babel\traverse\lib\traverse-node.js:22:17)
    at NodePath.visit (E:\.nvm\versions\node\v20.11.1\bin\node_modules\webcrack\node_modules\@babel\traverse\lib\path\context.js:88:52)

Node.js v20.11.1
j4k0xb commented 8 months ago

fixed, now temporary parameters are added in the default parameter transform instead of undefined

const d = function (e) {
  let t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
  let n = arguments.length > 5 ? arguments[5] : void 0;

->

const d = function (e, t = {}, _param, _param2, _param3, n) {};

can test it in the website, the cli will be released later