j4k0xb / webcrack

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

Reference Error #13

Closed BotSolver closed 1 year ago

BotSolver commented 1 year ago

Describe the bug

says ReferenceError [Error]: __DECODE_0__ is not defined at vm.js:4:9 at vm.js:5:9

Expected Behaviour

to deobfuscate the code with no issues.

Code

https://gofile.io/d/YzWlw7

Logs

webcrack:transforms prepare: started +0ms
  webcrack:transforms prepare: finished with 6722 changes +1s
  webcrack:transforms deobfuscate: started +1ms
  webcrack:deobfuscate String Array: yes +0ms
  webcrack:deobfuscate  - length: 4039 +1ms
  webcrack:deobfuscate  - function __STRING_ARRAY__(){var _0x57d5e9=["Server response not verifi … e9};return __STRING_ARRAY__()} +42ms
  webcrack:deobfuscate String Array Rotate: yes +4ms
  webcrack:deobfuscate  - (function(_0x41e1f8,_0x32060c){var _0x19df2c=a3_0x11e7;var _0x119013=_ … }}})(__STRING_ARRAY__,371229); +3ms
  webcrack:deobfuscate String Array Encodings: 1 +18ms
  webcrack:transforms objectLiterals: started +2s
  webcrack:transforms objectLiterals: finished with 0 changes +342ms
  webcrack:deobfuscate  - function __DECODE_0__(_0x54f465,_0x3665fb){var _0x521afc=__STRING_ARRA … CODE_0__(_0x54f465,_0x3665fb)} +342ms
  webcrack:transforms inlineDecoderWrappers: started +1ms
  webcrack:transforms inlineDecoderWrappers: finished with 25046 changes +1s
  webcrack:transforms inlineDecodedStrings: started +14ms

node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^
ReferenceError [Error]: __DECODE_0__ is not defined
    at vm.js:4:9
    at vm.js:5:9
    at Script.runInContext (node:vm:141:12)
    at VM.runScript (C:\Users\ladyg\AppData\Local\npm-cache\_npx\0b61241d7c17bcbb\node_modules\vm2\lib\vm.js:288:18)
    at C:\Users\ladyg\AppData\Local\npm-cache\_npx\0b61241d7c17bcbb\node_modules\vm2\lib\vm.js:512:16
    at timeout_bridge.js:1:1
    at Script.runInContext (node:vm:141:12)
    at doWithTimeout (C:\Users\ladyg\AppData\Local\npm-cache\_npx\0b61241d7c17bcbb\node_modules\vm2\lib\vm.js:135:29)
    at VM.run (C:\Users\ladyg\AppData\Local\npm-cache\_npx\0b61241d7c17bcbb\node_modules\vm2\lib\vm.js:511:10)
    at VMDecoder.sandbox (file:///C:/Users/ladyg/AppData/Local/npm-cache/_npx/0b61241d7c17bcbb/node_modules/webcrack/dist/index.js:981:15)
j4k0xb commented 1 year ago

fixed in https://github.com/j4k0xb/webcrack/releases/tag/v2.6.2 the issue was missing new lines when concatenating code for the sandbox, which caused __DECODE_0__ to end up in a comment:

//# sourceMappingURL=background.bundle.js.mapfunction __DECODE_0__(_0x54f465,_0x3665fb){var _0x521afc=__STRING_ARRAY__();__DECODE_0__=function(_0x11e78f,_0x4a86e9){_0x11e78f=_0x11e78f-0xdc;var _0x4e74d9=_0x521afc[_0x11e78f];return _0x4e74d9;};return __DECODE_0__(_0x54f465,_0x3665fb);}

deobfuscation works fine now. also fixed the extremely slow bundle detection in 609943f64ad7823dbb184aef2139ff273fe6c342 (2mins -> 4s), which will probably be released after I support unpacking this different webpack format