simplify v1.3 releases: Generic Android Deobfuscator
Simplify
Simplify virtually executes an app to understand its behavior and then tries to optimize the code so that it behaves identically but is easier for a human to understand. Each optimization type is simple and generic, so it doesn’t matter what the specific type of obfuscation is used.
Before and After
The code on the left is decompilation of an obfuscated app, and the code on the right has been deobfuscated.
There are three parts to the project: smalivm, simplify, and the demo app.
- smalivm: Provides a virtual machine sandbox for executing Dalvik methods. After executing a method, it returns a graph containing all possible register and class values for every execution path. It works even if some values are unknown, such as file and network I/O. For example, any if or switch conditional with an unknown value results in both branches being taken.
- simplify: Analyzes the execution graphs from smalivm and applies optimizations such as constant propagation, dead code removal, unreflection, and some peephole optimizations. These are fairly simple, but when applied together repeatedly, they’ll decrypt strings, remove reflection, and greatly simplify the code. It does not rename methods and classes.
- demoapp: Contains simple, heavily commented examples for using smalivm in your own project. If you’re building something that needs to execute Dalvik code, check it out.
Usage
Changelog v1.3
This version has a few fixes but mostly the new Smali Debugger tool which allows you to step through smalivm executions line by line, set breakpoints, etc. It was an experiment to see if smalivm could easily be used as a library (it’s easier now) and to play with Kotlin. Check it out and let me know what you think.
Version bump to 1.3.x because of some changes to the API.
Here’s the changelog.
- Many small improvements to make smalivm a better library for more than just simplify
- Fix correctness bugs around invoking methods and maintaining correct state
- Updated dependencies
Download
Copyright (C) 2016 CalebFenton