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

Error with ConstantObfuscation, only obfuscates strings in methods not outside (not for all classes I dont think) "due to low method capacity" #12

Open
Napoleon-x opened this issue Oct 3, 2021 · 5 comments
Labels
bug Something isn't working legacy old bozar

Comments

@Napoleon-x
Copy link

Describe the bug
When I try constant obfuscation, it seems to only obfuscate constants that are inside of a method and wont obfuscate the ones outside it

To Reproduce
Turn on Constant Obfuscation, have strings outside of a method, The class must be slightly big ish, I cant give you access to the jar here on github because it contains private things but I can give you one if you have discord

Expected behaviour
I wanted all strings to be obfuscated but it forgot some strings outside of methods and gave an error

Screenshots

image
image
image
image
image

Bozar version
1.7.0 built from master

Additional context
Problem happened when I was trying to obfuscate an important joke java program with special strings, It fails at those strings with a "due to low method capacity" error

@Napoleon-x Napoleon-x added the bug Something isn't working label Oct 3, 2021
@Napoleon-x Napoleon-x changed the title Error with ConstantObfuscation, only obfuscates strings in methods "due to low method capacity" Error with ConstantObfuscation, only obfuscates strings in methods not outside (not for all classes) "due to low method capacity" Oct 3, 2021
@Napoleon-x Napoleon-x changed the title Error with ConstantObfuscation, only obfuscates strings in methods not outside (not for all classes) "due to low method capacity" Error with ConstantObfuscation, only obfuscates strings in methods not outside (not for all classes I dont think) "due to low method capacity" Oct 3, 2021
@Napoleon-x
Copy link
Author

Napoleon-x commented Oct 3, 2021

Maybe not as much as a "bug" as someone told me such constants need to have values assigned by a method to to be string obfuscated?, but most obfuscators should make a method or class to give constants its values and do this default? Superblaubeere27 (opensource) Obfuscator does something like this I am pretty sure, I am not very experienced in any of this java bytecode related things, perhaps you could also link me to useful sites to further improve my knowledge?

@vimasig
Copy link
Owner

vimasig commented Oct 4, 2021

I should add [WARN] prefix to that message :/
I explained the meaning of that warning in #11

About your question, we can assign String values to fields directly. But our goal is to scramble that logic using bytecode instructions. We can't add bytecode instructions to field nodes (afaik). We have to create a method to do that.
We can also assign obfuscated String value first, then decrypt on all references (so it's possible but there are things like reflection, and finding references of that is hard).

And about your problem, try "Light" control flow obfuscation option. If it still gives that warning for most classes, then it means I should make a new lighter constant obfuscation 😀
You can also try moving some of your fields to an inner class as a workaround

@vimasig
Copy link
Owner

vimasig commented May 8, 2023

I should add [WARN] prefix to that message :/ I explained the meaning of that warning in #11
About your question, we can assign String values to fields directly. But our goal is to scramble that logic using bytecode instructions. We can't add bytecode instructions to field nodes (afaik). We have to create a method to do that. We can also assign obfuscated String value first, then decrypt on all references (so it's possible but there are things like reflection, and finding references of that is hard).
And about your problem, try "Light" control flow obfuscation option. If it still gives that warning for most classes, then it means I should make a new lighter constant obfuscation 😀 You can also try moving some of your fields to an inner class as a workaround

now my program is not working

@wenaly can you provide more details about the issue you're experiencing? Did the obfuscation process complete successfully?

@vimasig vimasig added the legacy old bozar label Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working legacy old bozar
Projects
None yet
Development

No branches or pull requests

3 participants
@Napoleon-x @vimasig and others