Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/y21/jsunfuck
Reverse JSFuck output
https://github.com/y21/jsunfuck
Last synced: 24 days ago
JSON representation
Reverse JSFuck output
- Host: GitHub
- URL: https://github.com/y21/jsunfuck
- Owner: y21
- Created: 2022-04-17T23:59:25.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-04-18T10:10:32.000Z (over 2 years ago)
- Last Synced: 2024-10-28T20:53:22.309Z (2 months ago)
- Language: Rust
- Size: 7.81 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# JSUnfuck
> ⚠ This is a work in progress.
[JSFuck](http://jsfuck.com) is an esoteric programming style for JavaScript that makes it possible to write any valid JavaScript code with just six characters: `()+[]!`.
JSUnfuck reverses/simplifies the obfuscated output, so you can read it again.
```sh
$ cat input.js
[+!+[]] + [!+[] + !+[]] + [!+[] + !+[] + !+[]]$ cat input.js | jsunfuck read
"123";
```There are existing tools for this already, many of which approach this by using dictionaries to search for patterns.
This works for output directly from one particular JSFuck code generator, however as soon as the dictionary is different, it no longer works and it requires you to know the dictionary that was used.
For example, `[+[]]+[]`, `[+[]]+[[]]` and `[]+[+![]]` all produce the string `"0"`. This program understands all of those.
This project tries to do this by deducing the syntax tree, without relying on a dictionary.