Giter Site home page Giter Site logo

fabricmc / enigma Goto Github PK

View Code? Open in Web Editor NEW
438.0 17.0 115.0 5.59 MB

This is a fork of cuchaz's Enigma, a deobfuscation/remapping tool for Java software.

License: GNU Lesser General Public License v3.0

HTML 0.11% Java 99.89%
java deobfuscator remapping

enigma's Introduction

Enigma

A tool for deobfuscation of Java bytecode. Forked from https://bitbucket.org/cuchaz/enigma, copyright Jeff Martin.

License

Enigma is distributed under the LGPL-3.0.

Enigma includes the following open-source libraries:

Usage

Pre-compiled jars can be found on the fabric maven.

Launching the GUI

java -jar enigma.jar

On the command line

java -cp enigma.jar cuchaz.enigma.command.Main

enigma's People

Contributors

2xsaiko avatar asiekierka avatar cuchaz avatar enbrain avatar gegy avatar howtonotwin avatar jamieswhiteshirt avatar juuxel avatar lclc98 avatar liach avatar marysaka avatar mikesmiffy128 avatar modmuss50 avatar mudkipdev avatar nardpw avatar natanfudge avatar nebelnidas avatar phase avatar polaris257 avatar ramidzkh avatar runemoro avatar samirmokiem avatar shadowfacts avatar shartte avatar shnupbups avatar thiakil avatar thog avatar toshimichi0915 avatar wgaylord avatar yanisbft avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

enigma's Issues

Missing inner classes during decompilation

Enigma is not able to decompile inner classes correctly in some cases

Example:

Original:

public class Testing
{
    public static class NotRemapped
    {
        public void a()
        {
            System.out.println("YEP");
        }
    }

    public static class TestingEnigma<T extends NotRemapped & Cloneable>
    {
        public void a()
        {
            System.out.println("NOPE");
        }
    }

    public void a(String test, String nope)
    {
        TestingEnigma testingEnigma = new TestingEnigma();
        System.out.println("Hello bytecode!" + test + nope);
    }
}

Output:

public class Testing
{
    public void a(String s1, String s2) {
        Testing.TestingEnigma testingEnigma = new Testing.TestingEnigma();
        System.out.println("Hello bytecode!" + s1+ s2);
    }
}

This is not a Procyon issue or related to the generic fix, already checked (Output is correct using Procyon DecompileDriver, maybe it's a TypeLoader related issue?)

Converter - Rework the method mapper

Because I have a bad memory
Thog: For the method remapper
if a method signature is not unique in the class or provided by an interface
it should compare lists of fields accessed by a given method

NPE on editing method name

Got the following error when trying to name World#ak

java.lang.NullPointerException
    at cuchaz.enigma.gui.Gui.moveClassTree(Gui.java:778)
    at cuchaz.enigma.gui.GuiController.rename(GuiController.java:202)
    at cuchaz.enigma.gui.GuiController.rename(GuiController.java:192)
    at cuchaz.enigma.gui.Gui.finishRename(Gui.java:582)
    at cuchaz.enigma.gui.Gui.access$500(Gui.java:54)
    at cuchaz.enigma.gui.Gui$6.keyPressed(Gui.java:556)
    at java.awt.Component.processKeyEvent(Component.java:6493)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2832)
    at java.awt.Component.processEvent(Component.java:6312)
    at java.awt.Container.processEvent(Container.java:2236)
    at java.awt.Component.dispatchEventImpl(Component.java:4891)
    at java.awt.Container.dispatchEventImpl(Container.java:2294)
    at java.awt.Component.dispatchEvent(Component.java:4713)
    at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1954)
    at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:806)
    at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1074)
    at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:945)
    at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:771)
    at java.awt.Component.dispatchEventImpl(Component.java:4762)
    at java.awt.Container.dispatchEventImpl(Container.java:2294)
    at java.awt.Window.dispatchEventImpl(Window.java:2750)
    at java.awt.Component.dispatchEvent(Component.java:4713)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.awt.EventQueue$4.run(EventQueue.java:729)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Ignorable crash on inner class rename attempt

java.lang.NullPointerException
at cuchaz.enigma.gui.Gui.moveClassTree(Gui.java:780)
at cuchaz.enigma.gui.GuiController.rename(GuiController.java:202)
at cuchaz.enigma.gui.GuiController.rename(GuiController.java:192)
at cuchaz.enigma.gui.Gui.finishRename(Gui.java:583)
at cuchaz.enigma.gui.Gui.access$500(Gui.java:55)
at cuchaz.enigma.gui.Gui$6.keyPressed(Gui.java:557)
at java.awt.Component.processKeyEvent(Component.java:6491)
at javax.swing.JComponent.processKeyEvent(JComponent.java:2832)
at java.awt.Component.processEvent(Component.java:6310)
at java.awt.Container.processEvent(Container.java:2236)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Container.dispatchEventImpl(Container.java:2294)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1954)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:806)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1074)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:945)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:771)
at java.awt.Component.dispatchEventImpl(Component.java:4760)
at java.awt.Container.dispatchEventImpl(Container.java:2294)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Unexpected FIELD entry

After the latest updates I encounter the following error when loading the pomf mappings. It doesn't seem very useful, so if you need further debugging let me know.

cuchaz.enigma.throwables.MappingParseException: Line 2: Unexpected FIELD entry here!
    at cuchaz.enigma.mapping.MappingsEnigmaReader.readFile(MappingsEnigmaReader.java:103)
    at cuchaz.enigma.mapping.MappingsEnigmaReader.readDirectory(MappingsEnigmaReader.java:36)
    at cuchaz.enigma.mapping.MappingsEnigmaReader.readDirectory(MappingsEnigmaReader.java:38)
    at cuchaz.enigma.mapping.MappingsEnigmaReader.read(MappingsEnigmaReader.java:21)
    at cuchaz.enigma.gui.GuiController.openEnigmaMappings(GuiController.java:65)
    at cuchaz.enigma.Main.main(Main.java:32)

Mass-open should skip hidden and backup files

I use VIM.

VIM tends to put .*.swp and sometimes .*.swo files in the directory unless told otherwise.

Enigma tends to open these.

Please, if you are doing a mass-open and the filename itself starts with a '.', or ends with a '~' (my setup doesn't use this but some editors do), just skip that file.

Thank you for understanding.

Use tabs for the editor

Having tabbed editor would be very convenient as keeping track of multiple not-yet-deobfuscated classes is sort of hard.

Crash with BlockPropertyEnum

Stacktrace:

java.lang.IllegalArgumentException: Don't use MethodEntry for a constructor!
    at cuchaz.enigma.mapping.MethodEntry.<init>(MethodEntry.java:32)
    at cuchaz.enigma.mapping.ProcyonEntryFactory.getMethodEntry(ProcyonEntryFactory.java:25)
    at cuchaz.enigma.analysis.SourceIndexBehaviorVisitor.visitParameterDeclaration(SourceIndexBehaviorVisitor.java:104)
    at cuchaz.enigma.analysis.SourceIndexBehaviorVisitor.visitParameterDeclaration(SourceIndexBehaviorVisitor.java:21)
    at com.strobel.decompiler.languages.java.ast.ParameterDeclaration.acceptVisitor(ParameterDeclaration.java:84)
    at cuchaz.enigma.analysis.SourceIndexVisitor.recurse(SourceIndexVisitor.java:32)
    at cuchaz.enigma.analysis.SourceIndexVisitor.visitConstructorDeclaration(SourceIndexVisitor.java:44)
    at cuchaz.enigma.analysis.SourceIndexVisitor.visitConstructorDeclaration(SourceIndexVisitor.java:19)
    at com.strobel.decompiler.languages.java.ast.ConstructorDeclaration.acceptVisitor(ConstructorDeclaration.java:61)
    at cuchaz.enigma.analysis.SourceIndexClassVisitor.visitConstructorDeclaration(SourceIndexClassVisitor.java:77)
    at cuchaz.enigma.analysis.SourceIndexClassVisitor.visitConstructorDeclaration(SourceIndexClassVisitor.java:22)
    at com.strobel.decompiler.languages.java.ast.ConstructorDeclaration.acceptVisitor(ConstructorDeclaration.java:61)
    at cuchaz.enigma.analysis.SourceIndexVisitor.recurse(SourceIndexVisitor.java:32)
    at cuchaz.enigma.analysis.SourceIndexClassVisitor.visitTypeDeclaration(SourceIndexClassVisitor.java:41)
    at cuchaz.enigma.analysis.SourceIndexClassVisitor.visitTypeDeclaration(SourceIndexClassVisitor.java:22)
    at com.strobel.decompiler.languages.java.ast.TypeDeclaration.acceptVisitor(TypeDeclaration.java:90)
    at cuchaz.enigma.analysis.SourceIndexVisitor.visitTypeDeclaration(SourceIndexVisitor.java:27)
    at cuchaz.enigma.analysis.SourceIndexVisitor.visitTypeDeclaration(SourceIndexVisitor.java:19)
    at com.strobel.decompiler.languages.java.ast.TypeDeclaration.acceptVisitor(TypeDeclaration.java:90)
    at cuchaz.enigma.analysis.SourceIndexVisitor.recurse(SourceIndexVisitor.java:32)
    at cuchaz.enigma.analysis.SourceIndexVisitor.visitCompilationUnit(SourceIndexVisitor.java:244)
    at cuchaz.enigma.analysis.SourceIndexVisitor.visitCompilationUnit(SourceIndexVisitor.java:19)
    at com.strobel.decompiler.languages.java.ast.CompilationUnit.acceptVisitor(CompilationUnit.java:81)
    at cuchaz.enigma.Deobfuscator.getSourceIndex(Deobfuscator.java:216)
    at cuchaz.enigma.Deobfuscator.getSourceIndex(Deobfuscator.java:204)
    at cuchaz.enigma.gui.GuiController$1.run(GuiController.java:311)

Show all calls of overridden methods

Currently, using "Show Calls" on overridden methods or interface implementations only shows calls to the overridden version of the method, requiring you to first go to the base implementation to see all uses.

Perhaps it would be useful to mark the additional calls differently in the call graph, such as using a dark gray text color (or partial opacity on the list item?).

Folders close when renaming

When you change the name of something, the state of all the folders in the De-obf classes view resets. It would be nice if these stayed open when renaming, to allow faster renaming of things in an entire package.

Unable to map complex method args

Trying to map a3 in the screenshot below results in the first argument being renamed rather than a3. Unable to rename a1 or a2 directly, method is found in none/p.

screen shot 2016-08-28 at 9 21 26 am

Going to symbol in call graph sometimes broken

Sometimes double-clicking gets me to the wrong point in the file, other times it just stays at the top of the file, at one point it even caused an error:

line 1034 columns 27831-27832

I'm noticing this a lot with World / WorldServer / WorldClient currently.

Class name must be in JVM format.

When trying to name a class, the following error will be produced if I try to name using . as the dividing character. The message hints that we should be using / instead, however the mapping with . will apply correctly. Although a refresh is required to see it.

java.lang.IllegalArgumentException: Class name must be in JVM format. ie, path/to/package/class$inner : net.minecraft.util.test.TestName
    at cuchaz.enigma.mapping.ClassEntry.<init>(ClassEntry.java:26)
    at cuchaz.enigma.gui.Gui.moveClassTree(Gui.java:776)
    at cuchaz.enigma.gui.GuiController.rename(GuiController.java:202)
    at cuchaz.enigma.gui.GuiController.rename(GuiController.java:192)
    at cuchaz.enigma.gui.Gui.finishRename(Gui.java:582)
    at cuchaz.enigma.gui.Gui.access$500(Gui.java:54)
    at cuchaz.enigma.gui.Gui$6.keyPressed(Gui.java:556)
    at java.awt.Component.processKeyEvent(Component.java:6493)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2832)
    at java.awt.Component.processEvent(Component.java:6312)
    at java.awt.Container.processEvent(Container.java:2236)
    at java.awt.Component.dispatchEventImpl(Component.java:4891)
    at java.awt.Container.dispatchEventImpl(Container.java:2294)
    at java.awt.Component.dispatchEvent(Component.java:4713)
    at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1954)
    at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:806)
    at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1074)
    at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:945)
    at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:771)
    at java.awt.Component.dispatchEventImpl(Component.java:4762)
    at java.awt.Container.dispatchEventImpl(Container.java:2294)
    at java.awt.Window.dispatchEventImpl(Window.java:2750)
    at java.awt.Component.dispatchEvent(Component.java:4713)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.awt.EventQueue$4.run(EventQueue.java:729)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Context menu opens for previous click

You have to left-click something to select it, and then right-click anywhere to open the context menu.
The context menu should open on whatever element you are pointing at, without needing a left-click.

User configuration

We need something to permit more user customization in Enigna. The config folder will be store in the HOME of the user and will permit to :

  • Disable/Enable the param default naming scheme changes (implemented in #43)
  • Disable or enable the system layout (e32e2e9)
  • Change keybindings
  • Change highlighting colors
  • Configure Procyon decompilation settings (38a7904)

Improve saving times?

Currently Enigma takes several seconds to save on my desktop PC. This isn't too great for just quickly saving changes made. It appears that it deletes all mappings files and then re-saves them all. Not sure if it's possible, but it would be nice if it only did this for files that were changed since the last save.

Allow marking things as something other than fully deobfuscated

It may be nice if it was possible to mark things as "could be named better" (yellow border) or "request changes" (orange border). That way we can map more things we're unsure about without worrying about them staying like that, and it allows others browsing the code to see names people are unsure about and see if they can provide better alternatives.

I suggest replacing the "mark as obfuscated" option with a "mark as" submenu that allows selecting from "deobfuscated", "improvable", "requesting changes" and "obfuscated".

Unable to name methods from inner classes.

I was unable to rename methods in BlockStateFactory$BlockState that are defined in IBlockInfoProxy. It would just not apply. One example method is isFullBoundsCube b ()Z. The workaround was to go to the interface and name them there.

Double-click in right panel does two things

Currently when double-clicking an item in Inheritance/Implementations/Call Graph does two things:

  • Go to the clicked file and location
  • Open/close the element if it has child elements

I feel like it should only be one. I have two preferred solutions:

  • Disable open/close using double-click (not in the package explorer though). Click the +/- to open/close them. The root element should always be open.
  • Make it dependent on where you click: Folder icon = open/close, text = go to location.

Visual error on constructor arguments

Was renaming the constructor arguments of Item$ToolMaterial and encountered this issue. While renaming the first argument, the fourth argument had issues. Not sure if this effects the mappings or not. We had this issue on the OML fork, however it was later resolved. Unfortunately no issue were added to our issue tracker for it.

image

[Request] Add descriptive names to placeholder parameters

If we know the params are VertexBuffer a, float b, it would be helpful if it was shown as something like VertexBuffer vertexBuffer1, float float1 or something like that. This helps piece together puzzling functions a bit better, since they can be hard to figure out initially when nothing is named.

Can't modify constructor argument of the witch model

While trying to modify the witch model constructor, I run into an issue where it will not update the display. Here is my local, as the issue will probably go away if I purge.

CLASS none/blp net/minecraft/client/render/entity/model/EntityModelWitch

Duplicate Inherited Fields

It is currently possible for a class to have fields with the same name as a field in a parent class. This can lead to situations where methods within the class are accessing the newer fields rather than the ones inherited. Below are a few screenshots of where this can become an issue.

image
image

Reset obf seems unefective

I accidently named a parameter in a sub class. Using reset to obf had seemingly no effect from the sub class. By going to the main class and resetting it there, it did work, however all sub classes still have the new mapping.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.