11

Is there a tool to deobfuscate java obfuscated codes?

The codes is extracted from a compiled class but they are obfuscated and non-readable.

Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347
Salar
  • 495
  • 3
  • 6
  • 14

6 Answers6

14

First step would be to learn with which tool it was obfuscated. Maybe there's already a "deobfuscator" around for the particular obfuscator.

On the other hand, you can also just run an IDE and use its refactoring powers. Rename the class, method and variable names to something sensitive. Use your human logical thinking powers to figure what the code actually represents and name them sensitively. And the picture would slowly but surely grow.

Good luck.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • I don't know what obfuscator is used. And on the decompiling process some methods and variables appears as "???" and they are coming from nowhere! I'm using JD-GUI http://java.decompiler.free.fr/ – Salar Nov 02 '09 at 18:33
  • 1
    JDO can help doing that. See http://stackoverflow.com/questions/1662766/tool-to-deobfuscate-java-codes/1662928#1662928 – Pascal Thivent Nov 02 '09 at 18:45
  • 1
    Ah, that way. Well, then the decompiler didn't support the original compiler version, e.g. decompiling against Java 1.5 while the code was compiled with 1.6. This ain't going to work. Read the decompiler's documentation and/or try different ones. – BalusC Nov 02 '09 at 18:47
9

Did you try to make the code less obscure with Java Deobfuscator (aka JDO), a kind of smart decompiler?

Currently JDO does the following:

  • renames obfuscated methods, variables, constants and class names to be unique and more indicative of their type
  • propogates changes throughout the entire source tree (beta)
  • has an easy to use GUI
  • allow you to specify the name for a field, method and class (new feature!)

Currently JDO does not do the following (but it might one day)

  • modify method bytecode in any way
Karussell
  • 17,085
  • 16
  • 97
  • 197
Pascal Thivent
  • 562,542
  • 136
  • 1,062
  • 1,124
6

Not to gravedig but I wrote a tool that works on most commercial obfuscators

https://github.com/Contra/JMD

Contra
  • 1,691
  • 15
  • 14
5

I used Java Deobfuscator (aka JDO) but it has a few bugs. It can't work with case sensitive file names. So I've changed the source and uploaded a patch for that in sourceforge. The patch, Download

Salar
  • 495
  • 3
  • 6
  • 14
1

Maybe it will work on Unix/Linux/MacOS?

If so, you could move one step of your process to a VM, in where you unpack the code, before you rename the too long names. How long is the file name limit on Windows?

user unknown
  • 35,537
  • 11
  • 75
  • 121
1

Most likely only human mindpower to make sense of it. Get the best decompiler available and ponder on its output.

Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347