There is no similar feature for javaJava byte code.
In javaJava bytecode, there is no neccesitynecessity to do this. Function names, variable names, and similar information is present in the compiled bytecode anyway. The "standard library", rt.jar
, isn't embedded into the bytecode either, so if a class uses an ArrayList
, the class will have a reference to java.util.ArrayList
even after the obfuscation process. So, nothing to do here for a signature analyzer.
If the application choseschooses to obfuscate the standard library as well, it needs to include that obfuscated library into its own jar files. This will probably raise some licensing issues, but apart from that, as the obfuscator will rename methods and fields, the byte code of that obfuscated library will be too different from the original byte code to be recognizable by a feature like IDA's FLIRT. Also, you can't just rename the method in IDA, because you'd have to modify all the references as well.
However, there is at least one open source project that has a similar problem like yours, and they seem to have solved it quite well. Minecraft is a popular game that includes a server that's written in javaJava (and obfuscated); the Spigot project decompiles this server, changes some things, adds an API, and distributes the result. Specifically, to avoid licensing issues, they distribute a build system which downloads, decompiles, patches, and recompiles the minecraftMinecraft server on the user's machine.
The source code, which is generated using these maps, is obviously way more readable than the original one. And, at least for the spigot project, recompiling this source (after adding some patches to create an API) yields a working minecraftMinecraft server.
So, maybe, this could be a way for you to proceed - use fernflower to decompile your classes, load them into an editor to find some useful code and assign readable class names, write a mapping file, and repeat this a few times. Then, when you want to do some dynamic analysis, recompile the decompiled javaJava code and load that into IDA.
- you will still have to identify each function manually - but as i said, you probably won't find any standard library functions in your code anyway. And, there are no existing signature libraries for whichever method you use, so there's probably no way around that.
- the decompiled/recompiled code may not work, because of bugs/shortcomings in the javaJava decompiler itself
- the decompiled/recompiled code may not work because of the obfuscator; for example, the obfuscator might replace all string constants with something like
Obfuscator::decode("some_crypted_stuff")
, where thedecode
function uses the name of the calling class as its decryption key, meaning the decryption fails when the class gets renamed - the obfuscator might bring its own class loader, which mangles the class name before loading it; for example, it might know to turn a
com.obfuscate.SOME_BASE_64_STRING
class into the decoded base64 string, socom.obfuscate.amF2YS51dGlsLkFycmF5TGlzdAo.something()
would calljava.util.ArrayList.something()
. This breaks the visible connection between caller and callee (but the name mapping could solve this problem quite well and you could automate a lot)
It's questionable if these approaches beat manual reverseengineeringreverse engineering within IDA, but as IDA doesn't have this feature, and as there are no generic signature libraries (and they wouldn't work anyway, see above), it's the best i have to offer.
Turns out iI have a little project where iI could use some deobfuscation mapping myself, and checked into the deobfuscation process of the minecraftMinecraft decompiling step a bit more.