You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+31-6
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,5 @@
1
1
# Oracle
2
+
2
3
A pattern based Dalvik deobfuscator which uses limited execution to improve semantic analysis. Also, the inspiration for another Android deobfuscator: [Simplify](https://github.com/CalebFenton/simplify).
@@ -11,38 +12,59 @@ A pattern based Dalvik deobfuscator which uses limited execution to improve sema
11
12
**After**
12
13

13
14
15
+
_sha1: a68d5d2da7550d35f7dbefc21b7deebe3f4005f3_
16
+
17
+
_md5: 2dd2eeeda08ac8c15be8a9f2d01adbe8_
18
+
14
19
## Installation
15
20
16
21
### Step 1. Install Smali / Baksmali
17
-
I'm sure since you're an elite Android reverser you already have smali and baksmali on your path.
22
+
23
+
Since you're an elite Android reverser, I'm sure you already have Smali and Baksmali on your path. If for some strange reason it's not already installed, this should get you started, but please examine it carefully before running:
_You must have either an emulator running or a device plugged in for Oracle to work._
37
57
38
58
Oracle needs to execute methods on an live Android system. This can either be on a device or an emulator (preferred). If it's a device, _make sure you don't mind running potentially hostile code on it_.
39
59
40
60
If you'd like to use an emulator, and already have the Android SDK installed, you can create and start emulator images with:
Oracle takes Android apps (APK), Dalvik executables (DEX), and Smali files as inputs. First, if the input is an APK or DEX, it is disassembled into Smali files. Then, the Smali files are passed to various plugins which perform analysis and modifications. Plugins search for patterns which can be transformed into something easier to read. In order to understand what the code is doing, some Dalvik methods are actually executed with and the output is collected. This way, some method calls can be replaced with constants. After that, all of the Smali files are updated. Finally, if the input was an APK or a DEX file, the modified Smali files are recompiled and an updated APK or DEX is created.
69
92
70
-
Method execution is performed by the [Driver](driver/src/main/java/org/cf/oracle/Driver.java). The input APK, DEX, or Smali is combined with the Driver into a single DEX using dexmerge and pushed onto a device or emulator. Oracle then sends method execution information to Driver whenever a plugin requests it. Driver uses Java reflection to execute methods within its own DEX with the arguments provided by Oracle and returns any output or exceptions. This is especially useful for many string decryption methods, which usually take an encrypted string or some One limitation is that execution is limited to static methods.
93
+
Method execution is performed by the [Driver](driver/src/main/java/org/cf/oracle/Driver.java). The input APK, DEX, or Smali is combined with the Driver into a single DEX using dexmerge and is pushed onto a device or emulator. Plugins can then use Driver which uses Java reflection to execute methods from the input DEX. The return values can be used to improve semantic analysis beyond mere pattern recognition. This is especially useful for many string decryption methods, which usually take an encrypted string or some byte array. One limitation is that execution is limited to static methods.
71
94
72
95
## Hacking
73
96
74
97
### Creating Your Own Plugin
98
+
75
99
There are three [plugins](lib/dex-oracle/plugins) which come with Oracle:
76
100
77
101
1.[Undexguard](lib/dex-oracle/plugins/undexguard.rb) - removes certain types of Dexguard obfuscations
@@ -95,6 +119,7 @@ The included plugins should be a good guide for understanding steps #3 and #4. D
95
119
Of course, you're always welcome to share whatever obfuscation you come across and someone may eventually get to it.
96
120
97
121
### Updating Driver
122
+
98
123
First, ensure `dx` is on your path. This is part of the Android SDK, but it's probably not on your path unless you're hardcore.
99
124
100
125
The [driver](driver) folder is a Java project managed by Gradle. Import it into Eclipse, IntelliJ, etc. and make any changes you like. To finish updating the driver, run `./update_driver`. This will rebuild the driver and convert the output JAR into a DEX.
0 commit comments