View Single Post
Old 10-08-2010, 08:53 PM   #11
adq has a complete set of Star Wars action figures.adq has a complete set of Star Wars action figures.adq has a complete set of Star Wars action figures.adq has a complete set of Star Wars action figures.
Posts: 26
Karma: 326
Join Date: Sep 2010
Device: kindle
Originally Posted by mubertmumphrey View Post
adq, first of all - Wow! I'm impressed with all the work you've done, and in such short time. Thank you for sharing it.

I took a look at the deobfuscator and the fernflower decompiler tonight. My goal was to compile one of the simpler booklet jars: msp.jar (minesweeper). I was unsuccessful, though I think I got a good feel for the process. I'm not sure if you've been able to recompile any of the jars yet, and I'm wondering if I made a mistake somewhere along the way.

Though I'm familiar with Java, I'm more of a C# and C/C++ developer, so I'm not entirely familiar with Eclipse and some of the workings of Java. Anyway, here's what I did:
  1. Pretty dumb, but it took me a little while to figure out that I should deobfuscate the jar files before decompiling them. I did this with all of the relevant lib files individually in addition to msp.jar. The result was a bunch of new deobfuscated jar files, presumably. I'm not sure it was needed, but framework-impl.jar would throw an exception when attempting to deobfuscate, so i skipped it.
  2. I decompiled the deobfuscated msp.jar and threw it into a new Java project in Eclipse
  3. I threw all of the deobfuscated lib jar files into the project and added them to the build path so they became referenced libraries. As I hoped, this killed a ton of compiler errors, but some remained, such as unrecognized classes (which look like they should have been contained in libraries that were already referenced).

Is this generally the procedure you had in mind for deobfuscating / decompiling the files? I'm wondering if, instead of deobfuscating and referencing the lib jar files, I should have instead expanded them into their class files and deobfuscated / referenced those instead.

What I did was unzip absolutely everything into one directory, then deobfuscate it all into another directory. After that I kinda had to zip up subdirectories and run them through fernfllower individually, because of the limits.

I'm really just interested in finding out how to use their APIs right now, rather than recompiling stuff, so this works ok for that. My decompiler does still have bugs in it I noticed, I'll try and fix them sometime, but I'm now busy with KIF.

Another suggestion would be to use a bytecode disassembler to disassemble the stuff; I think that generally doesn't have the same problem the obfuscated names that decompiled code does, but obviously you're then just looking at raw java VM assembler...
adq is offline   Reply With Quote