Closed ParkerM closed 1 year ago
c is the minified parameter name of isVariableDeclaration
(would be a good idea to use sourcemaps).
This was fixed in 2.4.0: https://github.com/relative/synchrony/blob/4a470f5fc0c3478e4e7ff174c6bdbac1c26e7422/src/transformers/stringdecoder.ts#L342-L345
Thanks for that @j4k0xb, and this must be the same fix here for the ArrayMap case: https://github.com/relative/synchrony/blob/4a470f5fc0c3478e4e7ff174c6bdbac1c26e7422/src/transformers/arraymap.ts#L30
I reckon I'll close this and open another issue about the outdated live version.
Reproduced at https://deobfuscate.relative.im/ on Firefox latest stable. (using whatever the default configuration is over there)
Function declarations with empty blocks produce
err = TypeError: c is undefined
. I'm not sure whatc
is referring to, but after creating a minimal repro I don't believe it's coming from the input. Example input:Debug log (Firefox dev tools):
```log 14:22:59.668 Running Simplify transformer deobworker.js:179:32933 14:22:59.668 Running MemberExpressionCleaner transformer deobworker.js:179:32933 14:22:59.668 Running LiteralMap transformer deobworker.js:179:32933 14:22:59.668 Running DeadCode transformer deobworker.js:179:32933 14:22:59.669 Running Demangle transformer deobworker.js:179:32933 14:22:59.669 Running StringDecoder transformer deobworker.js:179:32933 14:22:59.669 Caught an error while attempting to run AST visitor! node = Object { "type": "FunctionDeclaration", "start": 0, "end": 33, "range": [ 0, 33 ], "id": { "type": "Identifier", "start": 9, "end": 28, "range": [ 9, 28 ], "name": "emptyBlockStatement" }, "expression": false, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", "start": 31, "end": 33, "range": [ 31, 33 ], "body": [] } } err = TypeError: c is undefined mn https://deobfuscate.relative.im/deobworker.js:179 FunctionDeclaration https://deobfuscate.relative.im/deobworker.js:179 I https://deobfuscate.relative.im/deobworker.js:176 Y https://deobfuscate.relative.im/deobworker.js:34 I https://deobfuscate.relative.im/deobworker.js:176 StaticBlock https://deobfuscate.relative.im/deobworker.js:34 I https://deobfuscate.relative.im/deobworker.js:176 Oe https://deobfuscate.relative.im/deobworker.js:179 funcFinder https://deobfuscate.relative.im/deobworker.js:179 transform https://deobfuscate.relative.im/deobworker.js:179 ur https://deobfuscate.relative.im/deobworker.js:176 ur https://deobfuscate.relative.im/deobworker.js:176 transform https://deobfuscate.relative.im/deobworker.js:179 deobfuscateNode https://deobfuscate.relative.im/deobworker.js:179 E https://deobfuscate.relative.im/deobworker.js:176 deobworker.js:179:32933 14:22:59.670 Running Simplify transformer deobworker.js:179:32933 14:22:59.670 Running MemberExpressionCleaner transformer deobworker.js:179:32933 14:22:59.670 Running Desequence transformer deobworker.js:179:32933 14:22:59.670 Running ControlFlow transformer deobworker.js:179:32933 14:22:59.670 Running Desequence transformer deobworker.js:179:32933 14:22:59.671 Running MemberExpressionCleaner transformer deobworker.js:179:32933 14:22:59.671 Running ArrayMap transformer deobworker.js:179:32933 14:22:59.671 Caught an error while attempting to run AST visitor! node = Object { "type": "FunctionDeclaration", "start": 0, "end": 33, "range": [ 0, 33 ], "id": { "type": "Identifier", "start": 9, "end": 28, "range": [ 9, 28 ], "name": "emptyBlockStatement" }, "expression": false, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", "start": 31, "end": 33, "range": [ 31, 33 ], "body": [] } } err = TypeError: c is undefined mn https://deobfuscate.relative.im/deobworker.js:179 s https://deobfuscate.relative.im/deobworker.js:179 I https://deobfuscate.relative.im/deobworker.js:176 Y https://deobfuscate.relative.im/deobworker.js:34 I https://deobfuscate.relative.im/deobworker.js:176 StaticBlock https://deobfuscate.relative.im/deobworker.js:34 I https://deobfuscate.relative.im/deobworker.js:176 Oe https://deobfuscate.relative.im/deobworker.js:179 demap https://deobfuscate.relative.im/deobworker.js:179 transform https://deobfuscate.relative.im/deobworker.js:179 ur https://deobfuscate.relative.im/deobworker.js:176 ur https://deobfuscate.relative.im/deobworker.js:176 transform https://deobfuscate.relative.im/deobworker.js:179 deobfuscateNode https://deobfuscate.relative.im/deobworker.js:179 E https://deobfuscate.relative.im/deobworker.js:176 deobworker.js:179:32933 14:22:59.671 Running Simplify transformer deobworker.js:179:32933 14:22:59.671 Running DeadCode transformer deobworker.js:179:32933 14:22:59.671 Running Simplify transformer deobworker.js:179:32933 14:22:59.671 Running DeadCode transformer deobworker.js:179:32933 14:22:59.672 GET https://deobfuscate.relative.im/assets/error.png [HTTP/1.1 200 OK 0ms] 14:22:59.685 GET https://deobfuscate.relative.im/assets/success.png [HTTP/1.1 200 OK 0ms] 14:23:00.773 GET https://deobfuscate.relative.im/editor.worker.js [HTTP/2 200 OK 244ms] ... ```Note that the current hosted version claims to be on version 2.2.0, so if it's an issue that's been since fixed, then consider this a request to update the version on the hosted site.
Edit: this may be a same or related issue to #22, although the error messages appear to be different in this case.