octarine-noise / simpledeobf

simple deobfuscator for Minecraft mods
MIT License
82 stars 13 forks source link

Obfuscated 'SourceFile-Attribute' in deobfuscated Inner Classes #5

Open EmanuelMairoll opened 6 years ago

EmanuelMairoll commented 6 years ago

When deobfuscating a Jar (tested with 1.8.9.jar and stable_20 mappings), despite being named correctly in the code, the "InnerClass-Name" Attribute of the Outer Class Files, as well as the SourceFile-Attribute of Inner Class Files do not change. This actually "confuses" FernFlower decompiling the Inner Classes back to obfuscated names, which makes it pretty much unusable with IntelliJ.

This is a example, namely the C03PacketPlayer and its inner classes, examined with 'Java Class Editor' by tanmaykm: http://classeditor.sourceforge.net

image image
octarine-noise commented 6 years ago

It seems like you are trying to deobfuscate the Minecraft jar itself. This is not the intended use case, ForgeGradle will do that for you. Simpledeobf is meant to deobfuscate other mods, which generally do not have inner classes with obfuscated names.

That being said, this is a possible blind spot, and it looks like it's a (intentional) limitation of the ASM library that I use for the remapping, see here.

I've pushed a commit that will also remap inner class names, but I can't replicate your setup. Can you checkout the master branch, and try deobfuscating with that to see if it solves your problem?

EmanuelMairoll commented 6 years ago

Despite being such a tiny fix it now seems to works flawlessly. I already managed to fix it myself using another Application pretty much "fixing" the output jar. If you are interested, I did not upload it on a GitHub-Repo: RICAF.txt Thank you anyways, at least deobfuscating the Minecraft jar itself is now also a feature you can list in your README 🙂

EmanuelMairoll commented 6 years ago

Wait... I don't really know what is happening there, but...

image
octarine-noise commented 6 years ago

Ummm... yeah, looks like it's not quite as simple as that. Names are definitely mixed up, CrashReportCategory and EnumChatFormatting should not be subclasses of C03PacketPlayer.

I'll take a deeper look at what's going on when I have some time.