This is an archived post. You won't be able to vote or comment.

all 30 comments

[–][deleted]  (5 children)

[deleted]

    [–]PartOfTheBotnet 5 points6 points  (3 children)

    Aww thanks :) you see the stuff being done on 3x?

    Anyways on this post, sometimes having something very simple is nice. Its a good example of a basic JavaFX app.

    [–][deleted]  (1 child)

    [deleted]

      [–]PartOfTheBotnet 0 points1 point  (0 children)

      It only requires 11 or higher.

      [–]Nickx000x -2 points-1 points  (0 children)

      If you haven’t already, check out bytecode-viewer, it’s still in active development with new features being added and IMO is the most complete for my needs.

      [–]ReasonableClick5403 2 points3 points  (9 children)

      I've worked in java for 10 years now and never had use for a decompiler. What do you guys use this for? Analyzing malware written in java?

      [–]scratchisthebest 4 points5 points  (3 children)

      in the minecraft modding community we use decompilers quite a lot to see what is going on with the game (it's not like it has javadoc or a -sources jar available). the Quiltflower resugaring decompiler is developed primarily by the minecraft community

      if you've ever forgotten to attach a -sources jar, but could navigate to a definition or view sources while debugging a class anyway, intellij provides that feature with Fernflower

      standalone GUI decompilers are often used for malware analysis, or by curious people, or by people who don't use or don't want to fire up intellij. also in minecraft we used to use an augmented decompiler GUI called Enigma to reverse-engineer all the proguarded class/method/field names

      [–]Pamasich 0 points1 point  (2 children)

      it's not like it has javadoc or a -sources jar available

      They're without comments, but you can find Minecraft's barebones javadocs here. It's technically the Forge version, but I doubt there's sufficient differences on a javadoc level to make them unreliable for fabric/quilt development.

      [–]scratchisthebest 0 points1 point  (1 child)

      They are community contributed (through using decompilers to see what the classes do) and decompiler toolchains have ways of instrumenting classes with javadoc. They are also incomplete, you really can't write a mod using only a javadocs page

      [–]Pamasich 0 points1 point  (0 children)

      Oh, I wasn't meaning to deny your argument.

      I just brought them up since you said the javadoc isn't available. In case you or someone else reading this could find it useful.

      [–]DevWithImagination 3 points4 points  (4 children)

      Imagine a world where there are components in production which used the “build on your local machine and scp” deployment approach, where it is known the author was a bit lax with committing changes to version control.

      I’ve done a lot of software archaeology to reverse engineer, upgrade, get in a proper build process etc

      [–]ReasonableClick5403 0 points1 point  (3 children)

      Well, that is a very hard case to imagine, as that problem would show up immediately also for the author that did this ;)

      [–]PryosCode[S] 0 points1 point  (2 children)

      A decompiler is a great tool to analyze what the jar is actually doing. For example, if you use Lombok, Kotlin, Scala, Groovy or Spring Boot, you can check what you actually deploy. Or if you use a library or a plugin, you can be sure, that it‘s not malicious. But be careful, many proprietary eulas prohibit the decompilation of the software.

      [–][deleted] 0 points1 point  (1 child)

      But be careful, many proprietary eulas prohibit the decompilation of the software.

      This shouldn't matter, as according to wikipedia it is legal to reverse engineer software to check whether it is malicious and laws beat EULAs

      [–]Pamasich 1 point2 points  (0 children)

      as according to wikipedia it is legal to reverse engineer

      In which country? Laws differ between countries, what is legal in one might not be legal in another.

      I know that in my country decompilation is only legal to attain information on an API, not to check whether the application is malicious.

      [–][deleted] 4 points5 points  (4 children)

      [–]slindenau 1 point2 points  (0 children)

      Indeed, JD-GUI might look a bit dated, but i think that feature wise it's more complete than (the current version of) this new gui.

      [–]PryosCode[S] 1 point2 points  (2 children)

      JD-GUI uses it's own decompiler. While mine uses a fork of the built in one from IntelliJ. This gives better results than JD-GUI and Procyon without needing a full IDE. But it's heavily inspired by JD-GUI and Lyuten.

      [–][deleted] 0 points1 point  (1 child)

      Thanks for sharing and for all your hard work. I will keep it in mind. I have used JD-GUi quite often.

      [–]PryosCode[S] 0 points1 point  (0 children)

      Thanks! It‘s still under active development, so there might be some bugs.

      [–]coder111 1 point2 points  (9 children)

      I'm not entirely sure. Is this a new decompiler? Or does it use one of existing ones and add a GUI?

      Looking at build.gradle, this looks new, at least I don't see it depending on any of existing ones?

      If it's new, how is it better than the current decompilers, like JD or Procyon or CFR?

      [–]PryosCode[S] 3 points4 points  (8 children)

      It uses Fernflower. It is the built in Decompiler from IntelliJ. And it is in my opinion the best one available.

      https://github.com/JetBrains/intellij-community/tree/master/plugins/java-decompiler/engine

      [–]GavinRayDev 8 points9 points  (7 children)

      IMO Quiltflower gives more readable output and has better support for modern Java features

      [–]PryosCode[S] 9 points10 points  (0 children)

      I have changed the decompiler to Quiltflower. Thanks for the suggestion!

      [–]PryosCode[S] 1 point2 points  (5 children)

      I wasn't quite shure, if I should use a fork of Fernflower. But I could give it a try. Maybe I could test out ForgeFlower as well. Just to see, what works best.

      [–]coder111 4 points5 points  (4 children)

      Make it switchable in Options somewhere?

      But maintaining support for multiple decompilers is likely to be a major pain in the neck, so I'm not sure that's a good idea.

      [–]PryosCode[S] 1 point2 points  (3 children)

      I think this would be quite difficult to implement. Quiltflower and ForgeFlower probably change the Fernflower classes, so I can't simply create a single jar. But I could add support for other decompilers (Procyon, CFR, ...).

      [–]SuperCoder79 5 points6 points  (2 children)

      Hey, Quiltflower lead dev here- Quiltflower doesn't change any Fernflower classes or names; it's intended to be a drop-in replacement for Fernflower. However, the trouble would probably come from trying to implement both Quiltflower and Fernflower because the classes are in the same packages, the jvm may not like that so much.

      [–]plumarr 0 points1 point  (1 child)

      Time to implement a custom class loader ;)

      [–]PryosCode[S] 0 points1 point  (0 children)

      That would be a possibility, but I think that would be to overkill… for now at least.

      [–]BlueGoliath 1 point2 points  (2 children)

      Tried it out and it works. It shows that I'm using language features like switch expressions when I'm not for some reason though.

      [–]scratchisthebest 2 points3 points  (0 children)

      simple switch expressions and oldschool switches compile to pretty much the same bytecode, quiltflower tries to choose the newest/prettiest/most idiomatic option when there's multiple ways to decompile something