Obfustication, why?

    Joined
    Jun 25, 2013
    Messages
    403
    Reaction score
    11
    • Legacy Citizen 2
    • Legacy Citizen
    Well, JDGui doesn\'t seem to handle case sensitivity. Ad.class is the main entity class, but in the source you have there is only ad.class.

    JDO is a de-obfusticator, not a decompiler. You use it as a pre-processor to a decompiler. It takes care of case names in the class files and multiple method names that are identical. So I think we should use *both* :).

    JD is more modern that JAD. But there\'s still some things that JAD does better. In the hand-work I\'ve done I\'ve mostly used JAD (partly because it was written by an IBMer!) but pulled in from JD when it had a better interpretation. I think settling on one is the only sane way to proceede. I like that you can route name via a .csv file. So I\'cool with JDGui if you find that most convienent.
     
    Joined
    Jun 24, 2013
    Messages
    17
    Reaction score
    0
    Abou .csv that does MCP\'s custom written Python program. Not JDGui, I think about naming by hand and then on the way developing tools to make it faster. Also where is StarMade logo located...?

    EDIT: Nevermind found it.
     
    Joined
    Jun 25, 2013
    Messages
    403
    Reaction score
    11
    • Legacy Citizen 2
    • Legacy Citizen
    So using csnewman\'s hacked JRename for de-obfustication, and tambre\'s JD-GUI for de-compiling, I came up with a source base with all the files present. The source is far from compiling, though. Looking at the class I\'m most familiar with (Ad.class) I see a number of systematic problems.

    De-obfustication (we have the source):

    • The original jar has several entries with the same name (e.g. \"META-INF/LICENSE.txt\"). When it writes the output jar Java chokes on that. We\'ll have to extend the renaming to include non-java files
    • It doesn\'t seem to handle inheritance well. When it renames the method in the interface or parent class, it does not exactly rename the method in the subclass. We can either track all of that, or else change it to use a deterministic method (e.g. insertion of hungarian notation).
    • I didn\'t see an option to create some sort of table of what it renamed. This is necessary to reverse the process.
    • I didn\'t see an option to override it\'s renaming. We\'ll need this to \"refactor\" the code into more meaningful names.
    • I didn\'t see an option to reverse the process. Although if it can take an input file, then I think we can just feed that back in switch to reverse things.

    Decompiler (we don\'t have the source?):

    • Casts seem to disappear. I rather suspect they don\'t exist at the bytecode level, so it\'s unclear if this problem can be fixed at all.
    • Exceptions seem to disappear. This may also not exist at the bytecode level.
    • Variable names are frequently re-used. I think this is a feature of the obfusticator. It makes things difficult to follow. I\'m not sure if this is best addressed in de-obfustication or post-decompile refactoring.
    • Enumerations are not handled at all (e.g. class_Af)

    Overall I\'m more concerned about the decompiler problems. I\'m not sure we have the source, and I think some of the problems are insoluable. Which needs we\'re going to need some heavy human intervention and a system to merge human changes into a changing source base.
     
    Joined
    Jun 24, 2013
    Messages
    17
    Reaction score
    0
    I repeat that JD-GUI doesn\'t take those. That tool that takes them and renames those sources is their custom tool. So what we should do? I don\'t know any tools better for decompiling.
     
    Joined
    Jun 25, 2013
    Messages
    403
    Reaction score
    11
    • Legacy Citizen 2
    • Legacy Citizen
    Do We Have TheSource For Jd? If We Can\'t Fix It We Have Do Deal With A Good Post Edit And Merge Tool. Know Of AsNY? (Sorry, Damn Phone On The Freak!)
     
    Joined
    Jun 24, 2013
    Messages
    17
    Reaction score
    0
    No there aint. But seems like they just released a new snapshot, they haven\'t released a version for a year!
     
    Joined
    Jun 25, 2013
    Messages
    403
    Reaction score
    11
    • Legacy Citizen 2
    • Legacy Citizen
    Yeah, worked out it is in C++, which would hurt my brain right now. Those neural pathways have atrophied. There doesn\'t seem to be any de-compiler that is up to date.

    Anyway, I had a long post last night suggesting how we deal with this, but then my machine froze. I hate this forum software. :-(

    I\'ll retype when I get over being grumpy. Maybe lunchtime. >_<
     
    Joined
    Jul 2, 2013
    Messages
    4
    Reaction score
    0
    • Purchased!
    • Legacy Citizen 3
    Mojang doesn\'t like people distributing unmodified .class files, source files (original, obfuscated, or deobfuscated), and, with the new launcher *modified* .class files. Why would this game be any different?



    If you want to write your own tools, Oracle has an interesting document you might find useful.
     
    Joined
    Jun 25, 2013
    Messages
    403
    Reaction score
    11
    • Legacy Citizen 2
    • Legacy Citizen
    Mojang is in its current mess because they have a huge number of people interested in modding their code and they obfusticated it. Modifying class files is the worst way to extend a code base. They are only just getting on board to making the code base extensible via sane methods.

    I would hope this game would be different by realizing the huge value the community can contribute to the game and making it easily extended from the start without having to go through silly hoops like we\'re discussing.

    Worst case, I\'d rather do the minimum mod necessary to the base system to make it possible to extend. That minimizes the crazyness and gives the devs something to incorporate later to open the system up to all these people who want to add value to their product.
     
    Joined
    Jun 24, 2013
    Messages
    17
    Reaction score
    0
    I agree though I still find player written APIs good. We can extend or fix bug API for example 2weeks after release of new version. Minecraft wouldn\'t on other side want to do it and would ask someone to create a fix or find a workaround. Plus players can contribute their own stuff on Github.
     
    Joined
    Jun 25, 2013
    Messages
    403
    Reaction score
    11
    • Legacy Citizen 2
    • Legacy Citizen
    I\'ve got my work-so-far into a pull request. Three main contributions:

    1) Entity read/write code. This works but for the SERIALIZED data type. I need to look at that more closely.

    2) Ship header & logic files. Read only.

    3) Unit tests. If you want to use them, you need to set the sm.basedir system property to your StarMade directory. It will then loop through your data file and run its (non-destructive) tests on them.
     
    Joined
    Jun 24, 2013
    Messages
    710
    Reaction score
    11
    Because I support the intentions of this thread a lot, and I think this should be fired up again, others are interested as well.
     
    Joined
    Jul 10, 2013
    Messages
    61
    Reaction score
    25
    • Community Content - Bronze 2
    • Purchased!
    • Legacy Citizen 8
    Yep.



    And now that i wonder.... how long it\'d actually take to compile AND obfuscate a program of the same entity as SM.... i mean... even if obfuscation is a \"security measure against improper modifications\", in a game as early as SM where the already kinda \"limited\" community (how many people play StarMade, really, maybe 1k, 2k? there, 5k given i\'m willing to be positive about this), i hardly think that someone would want to modify their clients in a way that they need to when they can already do whatever they want with the game in its current state.



    Schema doesn\'t want direct modding? Then spit out an API documentation for external applications, dammit!