-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Support for unicode static variable names in smali bytecode regex #18
Comments
Yes, you are right. The regex does not include all the possible The correct regex for
Reference: https://source.android.com/docs/core/runtime/dex-format#simplename |
Also, did you get it to work just by modifying that regex? Your sample contains functions with parameters, where those parameters are used to call
|
No, I didn’t. I attempted to comment out the section of the code that raises exceptions, and it partially works —— some strings do get restored. However, I’m unable to recompile the modified Smali code back into a DEX file :( |
Forgot to mention, you regex is valid. Never thought about it that way. Great job!
Yep, I need to write new code to handle this case. |
Your solution was exactly what I needed 👍. I successfully managed to deobfuscate and reassemble the app, significantly removed the string obfuscation. Thank you very much for your quick response and for your hard work on this project!
The details in #19 were especially helpful, and I realized how hard it is. I have a quick question: are the remaining references caused by optimization, or is this the intended behavior of the obfuscator? Thanks again for your help! |
Actually, I've never seen anything like this. I am almost certain that this is not the expected behavior of Btw, I added a function that saves the chunks to a file and you can manually "deobfuscate" a string by giving it a Example: $ python -m paranoid_deobfuscator helpers extract-chunks tests/samples/LuckyTool_v1.2.7.18005 luckytools-chunks.json
$ python -m paranoid_deobfuscator helpers deobfuscate-string -- luckytools-chunks.json -650834787994841
[-24fee48588cd9]:<this> In this case, the string is NOTE: You have to include Let me know if you have any problems. Commit: 5ec909f EDIT: In your case, you have 8 methods that uses For example: Now, copy each of those values and put them inside the command above, you'll get the deobfuscated string. The other option is for you to write a Frida script. |
Thank you for the amazing work.
I'm currently working with some modules that have been obfuscated by LSParanoid, which appears to use Unicode static variable names for further obfuscation.
The existing regular expression approach for smali bytecode doesn't match Unicode static variable names.
I attempted to modify the regex this way:
It seems to work, but I'm unsure if this regex is safe and what the equivalent would be for invoke-static and other bytecodes that interact with static variable names.
The text was updated successfully, but these errors were encountered: