Open ohnnnooo opened 2 months ago
Full error/stack:
DeobfuscateContext.tsx:55 Error: Cannot read properties of undefined (reading 'charAt')
at c.onmessage (index.js:235:53)
(anonymous) @ DeobfuscateContext.tsx:55
Which seems to correspond to this section of the code:
Specifically that error seems to come from evalCode
:
At a bit of an informed guess, I believe that is being triggered by this section of sandbox code as passed into the main webcrack
function:
With options.sandbox
passed to applyTransformAsync
here as part of options.deobfuscate
:
And applyTransformAsync
is defined here:
As a naive guess, I think this may be caused by one of the 'deobfuscate' rules that relies on eval'ing the code; and presumably that code doesn't execute properly in eval
in whatever state it is when it's being run (eg. maybe because it relies on not being unminified/etc at that point)
It looks like when this error is hit, the whole deobfuscate process may bail out. I haven't looked too deeply, but I wonder if it would be possible to skip the eval
part when it errors out, or return the partially decrypted code at that point or similar?
I wonder if it also might be helpful to add some extra context to that evalCode
catch
within DeobfuscateContext.tsx
so that it makes it more obvious that the error comes from trying to eval the minified code, and not from a bug in webcrack
itself.
Describe the bug
Getting Error: Cannot read properties of undefined (reading 'charAt') when using https://webcrack.netlify.app/ to deobfuscate
Expected Behaviour
Deobfuscate
Code
Logs
No response