Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix loop with empty condition #80

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

devnoname120
Copy link
Contributor

In JavaScript for/while loop without a condition is equivalent to a condition always evaluating to true

Fix #79

Q                       A
Fixed Issues ? Fixes #79
License MIT

In JavaScript `for`/`while` loop without a condition is equivalent to a condition always evaluating to true

Fix lorenzoferre#79
@devnoname120
Copy link
Contributor Author

devnoname120 commented Feb 11, 2025

Note that this won't fix loops completely. break statements inside of loops (outside of a switch) are ignored completely so an always true loop is unrolled up to maxIterations.

However this PR doesn't introduce this problem. It was already a problem before this pull request for conditions always evaluating to true in while/for loops.

@lorenzoferre
Copy link
Owner

unfortunately, I soon realized that developing a plugin capable of reconstructing the entire control flow is almost impossible, if not definitely impossible. My first idea was to make the deobfuscator purely static and provide examples where a control flow flattening is reconstructed. I noticed that using a VM generates a lot of potential errors. I would appreciate it if you could tell me your opinions regarding these topics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeError: unknown file: Cannot read properties of null (reading 'tokens')
2 participants