-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[feature] Allow plugins to edit BlockNodes #2335
Comments
Sure, that's a good start.
Yeah, I should add some docs on passes, but I am awful at writing, I started many times and still not finished it 🤣 |
Yes good idea! I'm manually removing unused blocks and calling BlockProcessor again to reassing attributes. |
@eybisi I have added method to update blocks data: BlockProcessor.updateBlocksData(mth); Also, jadx libs snapshot updated, hope it works fine 🙂 |
Allow plugins to edit BlockNodes
Plugins can't edit block nodes after BlockProcessor run, since blocks are locked. I mention specifically BlockProcessor because it adds very useful data to MethodNode (loops, dominators etc). These information can used to edit control flows For example I've used loops information from method node to find switch cases and manipulated control flow to recover it from obfuscator link
We can move
mth.finishBasicBlocks();
out of BlockProcessor to another visitor lets say BlockFinisher. Then plugins can attach into .before('BlockFinisher') to manipulate blocks. I have a PR ready for this if its okay.Also writing document to give general information about visitors for deobfuscation (or general) plugins will be very useful. For example if a deobfuscator plugin does MBA simplification to deobfuscate instructions when it should run? Which visitor gives best information ? I think generic cases for deobfuscation would be instruction editing, control flow editing, string deobfuscation
The text was updated successfully, but these errors were encountered: