Coder Social home page Coder Social logo

col-e / jremapper Goto Github PK

View Code? Open in Web Editor NEW
120.0 7.0 16.0 4.49 MB

Remapping tool for compiled java programs.

License: MIT License

Java 96.83% CSS 3.17%
java bytecode bytecode-engineering reverse-engineering deobfuscation decompile decompiler jvm-bytecode mappings

jremapper's Introduction

JRemapper

An easy to use GUI for remapping classes, methods, and fields of compiled java programs.

For information on how to use JRemapper and other details about it, check out the wiki.

The TLDR usage is as follows:

  • Global keybinds
    • Control + N Open a jar file
    • Control + O Open mappings file
    • Control + E Export jar file (mappings are applied to output)
    • Control + S Save mappings to file (Json)
    • Control + Z Undo mapping change
    • Control + Y Redo mapping change
  • Editor pane keybinds
    • N Navigate to selected item
    • Backspace Go to last item

Download

See the releases page for the latest build, or compile it yourself with mvn package

Screenshot

Screenshot

jremapper's People

Contributors

col-e avatar spartars 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

jremapper's Issues

Move selection logic to JavaParser

As of writing, current commit has begun the process, but some classes break selection entirely because of the output of CFR, usually related to invoke-dynamics. Some work-around would be necessary for this like INDY replacement (at least when passed to CFR) via resolving to invokevirts/statics or replacing with dummy methods.

Reimplement program-wide search functions

Control + F searches for matches in the current code-area, but adding back the old mechanism for searching the entire jar would be useful.

Something simple would probably manage well enough over the very verbose search API that recaf has.

  • Search decompiled text (slow, but all-encompassing)
  • Search string constants (fast)

Feature Ideas

  • Allow multiple classes to be open at once
    • Make tabs closable
  • Better context algorithms (One that does not assume the context of a line, but rather of any given word based on surroundings)
  • Package renaming
  • Make right-click context menu
    • Open selected class in new tab
    • Search where selected class is:
      • Referenced in descriptors
      • Referenced by name
      • Instantiated
    • Reset class name to original
    • Auto-rename class if it has a parent of a known type (Like if it implements List, rename to ListImpl)
  • History menu
    • Go back to last selected (not neccsarily closed) class.
    • Undo renames
      • Keybind for this
    • Open closed classes
      • Keybind for this
  • Search menu
    • Search text of current decompiled class
    • Search UTF8 consts of loaded classes
      • Option for strings only vs UTF8's used in any context
    • Search for method handle / field reference by name or descriptor
    • Search for method containing series of opcodes
    • Search results displayed on side menu with similar style of class selection menu
  • Keybinds for actions such as searching, other basic tasks
  • Dark theme

Rename repo

I'm not that creative with names and for those that don't know that CFR is a java decompiler it doesn't immediately convey the functionality of the program.

Parse error with a class that contains functions named do/for/while

I have a class, it contains method named "do", and the parser fails to parse it.

[ERRR:21.06.19 23:00]   (line 75,col 12) Parse error. Found "do", expected one of  "enum" "exports" "module" "open" "opens" "provides" "requires" "strictfp" "to" "transitive" "uses" "with" <IDENTIFIER>
Problem stacktrace :
  com.github.javaparser.GeneratedJavaParser.generateParseException(GeneratedJavaParser.java:10316)
  com.github.javaparser.GeneratedJavaParser.jj_consume_token(GeneratedJavaParser.java:10175)
  com.github.javaparser.GeneratedJavaParser.Identifier(GeneratedJavaParser.java:2154)
  com.github.javaparser.GeneratedJavaParser.SimpleName(GeneratedJavaParser.java:2093)
  com.github.javaparser.GeneratedJavaParser.MethodDeclaration(GeneratedJavaParser.java:1206)
  com.github.javaparser.GeneratedJavaParser.ClassOrInterfaceBodyDeclaration(GeneratedJavaParser.java:952)
  com.github.javaparser.GeneratedJavaParser.ClassOrInterfaceBody(GeneratedJavaParser.java:846)
  com.github.javaparser.GeneratedJavaParser.ClassOrInterfaceDeclaration(GeneratedJavaParser.java:408)
  com.github.javaparser.GeneratedJavaParser.CompilationUnit(GeneratedJavaParser.java:154)
  com.github.javaparser.JavaParser.parse(JavaParser.java:130)
  me.coley.jremapper.ui.CodePane.setupRegions(CodePane.java:445)
  me.coley.jremapper.ui.CodePane.updateStyleAndRegions(CodePane.java:367)
  me.coley.jremapper.ui.CodePane.lambda$setupCode$1(CodePane.java:141)
  org.reactfx.util.NonAccumulativeStreamNotifications.lambda$head$0(NotificationAccumulator.java:134)
  org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:68)
  org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:57)
  org.reactfx.ProperEventStream.emit(ProperEventStream.java:18)
  org.reactfx.FilterStream.lambda$observeInputs$0(FilterStream.java:20)
  org.reactfx.util.NonAccumulativeStreamNotifications.lambda$head$0(NotificationAccumulator.java:134)
  org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:68)
  org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:57)
  org.reactfx.ProperEventStream.emit(ProperEventStream.java:18)
  java.util.Collections$SingletonList.forEach(Unknown Source)
  org.fxmisc.richtext.model.EditableStyledDocument$2.lambda$observeInputs$0(EditableStyledDocument.java:101)
  org.reactfx.util.QueuingStreamNotifications.lambda$head$0(NotificationAccumulator.java:217)
  org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:68)
  org.reactfx.SuspendableBase.resume(SuspendableBase.java:64)
  org.reactfx.CloseableOnceGuard.close(Guard.java:49)
  org.reactfx.MultiGuard.close(Guard.java:83)
  org.reactfx.Suspendable$1.resumeSource(Suspendable.java:118)
  org.reactfx.Suspendable$1.suspendSource(Suspendable.java:104)
  org.reactfx.util.NonAccumulativeStreamNotifications.lambda$head$0(NotificationAccumulator.java:134)
  org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:68)
  org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:57)
  org.reactfx.ProperEventStream.emit(ProperEventStream.java:18)
  org.reactfx.EventStreams$3.lambda$observeInputs$0(EventStreams.java:105)
  org.reactfx.value.ChangeListenerWrapper.accept(Val.java:786)
  org.reactfx.util.AbstractReducingStreamNotifications.lambda$head$0(NotificationAccumulator.java:248)
  org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:68)
  org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:57)
  org.reactfx.value.ValBase.invalidate(ValBase.java:32)
  org.reactfx.SuspendableBoolean.release(SuspendableBoolean.java:24)
  org.reactfx.CloseableOnceGuard.close(Guard.java:49)
  org.reactfx.Suspendable.suspendWhile(Suspendable.java:49)
  org.fxmisc.richtext.model.GenericEditableStyledDocumentBase.updateMulti(GenericEditableStyledDocumentBase.java:215)
  org.fxmisc.richtext.model.GenericEditableStyledDocumentBase.updateSingle(GenericEditableStyledDocumentBase.java:207)
  org.reactfx.util.Tuple3.exec(Tuple3.java:43)
  org.fxmisc.richtext.model.GenericEditableStyledDocumentBase.replace(GenericEditableStyledDocumentBase.java:142)
  org.fxmisc.richtext.model.SimpleEditableStyledDocument.replace(SimpleEditableStyledDocument.java:10)
  org.fxmisc.richtext.GenericStyledArea.replace(GenericStyledArea.java:1195)
  org.fxmisc.richtext.GenericStyledArea.replaceText(GenericStyledArea.java:1182)
  org.fxmisc.richtext.EditActions.insertText(EditActions.java:32)
  org.fxmisc.richtext.EditActions.appendText(EditActions.java:15)
  me.coley.jremapper.ui.CodePane.refreshCode(CodePane.java:378)
  me.coley.jremapper.ui.CodePane.setupCode(CodePane.java:200)
  me.coley.jremapper.ui.CodePane.<init>(CodePane.java:120)
  me.coley.jremapper.ui.CodePane.open(CodePane.java:126)
  me.coley.jremapper.util.History.push(History.java:61)
  me.coley.jremapper.ui.ContentPane.onClassOpen(ContentPane.java:21)
  sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
  sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  java.lang.reflect.Method.invoke(Unknown Source)
  me.coley.event.Bus$Handler$InvokeWrapper.post(Bus.java:189)
  me.coley.event.Bus$Handler.lambda$post$1(Bus.java:167)
  java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source)
  java.util.stream.SortedOps$SizedRefSortingSink.end(Unknown Source)
  java.util.stream.AbstractPipeline.copyInto(Unknown Source)
  java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
  java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source)
  java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source)
  java.util.stream.AbstractPipeline.evaluate(Unknown Source)
  java.util.stream.ReferencePipeline.forEach(Unknown Source)
  me.coley.event.Bus$Handler.post(Bus.java:167)
  me.coley.event.Bus.post_(Bus.java:86)
  me.coley.event.Bus.post(Bus.java:46)
  me.coley.jremapper.ui.FilePane$2.handle(FilePane.java:68)
  me.coley.jremapper.ui.FilePane$2.handle(FilePane.java:61)
  com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
  com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
  com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
  com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
  com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
  com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
  com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
  com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
  com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
  com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
  com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
  com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
  com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
  com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
  javafx.event.Event.fireEvent(Event.java:198)
  javafx.scene.Scene$ClickGenerator.postProcess(Scene.java:3470)
  javafx.scene.Scene$ClickGenerator.access$8100(Scene.java:3398)
  javafx.scene.Scene$MouseHandler.process(Scene.java:3766)
  javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3485)
  javafx.scene.Scene.impl_processMouseEvent(Scene.java:1762)
  javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2494)
  com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:394)
  com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:295)
  java.security.AccessController.doPrivileged(Native Method)
  com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$358(GlassViewEventHandler.java:432)
  com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389)
  com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:431)
  com.sun.glass.ui.View.handleMouseEvent(View.java:555)
  com.sun.glass.ui.View.notifyMouse(View.java:937)
  com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
  com.sun.glass.ui.win.WinApplication.lambda$null$152(WinApplication.java:177)
  java.lang.Thread.run(Unknown Source)```

Jar file doesn't launch

I tried to launch the jar file, but it didn't, so I did java -jar and got the following error :

Graphics Device initialization failed for : es2, sw
Error initializing QuantumRenderer: no suitable pipeline found
java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
at com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:280)
at com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:222)
at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:260)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:94)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
... 1 more
Exception in thread "main" java.lang.RuntimeException: No toolkit found
at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:272)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
at java.base/java.lang.Thread.run(Thread.java:834)

Aggressive overload checks

Right now there are no checks on selecting methods with the same name but different parameter types. Adding a check for parameter types would allow more accurate selection.

This does not affect method declarations. This only affects method references that are in the method-code.

Command-line usage

Hi, is there any way to use the tool in a batch mode, without a GUI, just supplying a list of operations in a file?

If not, what would it take to implement?

Thanks.

Inheritance checks

With the rewrite, inherited methods do not remain members across the hierarchy.

stacktrace

[ERRR:20/03/01 8:45] IndexOutOfBoundsException: Index: 16, Size: 15
   java.util.ArrayList.rangeCheckForAdd(Unknown Source)
   java.util.ArrayList.add(Unknown Source)
   com.sun.javafx.collections.ObservableListWrapper.doAdd(ObservableListWrapper.java:101)
   javafx.collections.ModifiableObservableListBase.add(ModifiableObservableListBase.java:151)
   me.coley.jremapper.ui.FilePane$FileTreeItem.addOrdered(FilePane.java:312)
   me.coley.jremapper.ui.FilePane$FileTreeItem.addFile(FilePane.java:287)
   me.coley.jremapper.ui.FilePane.addToRoot(FilePane.java:235)
   me.coley.jremapper.ui.FilePane.onMappingUpdate(FilePane.java:176)
   sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
   sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   java.lang.reflect.Method.invoke(Unknown Source)
   me.coley.event.Bus$Handler$InvokeWrapper.post(Bus.java:189)
   me.coley.event.Bus$Handler.lambda$post$1(Bus.java:167)
   java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source)
   java.util.stream.SortedOps$SizedRefSortingSink.end(Unknown Source)
   java.util.stream.AbstractPipeline.copyInto(Unknown Source)

Renaming class fields with common name

In obfuscated programs, a class may contain multiple fields with the same name, distinguished only by type (I am not sure how exactly this works on .class-level)

Renaming such field will currently rename all other fields with the same name in that class. This limits JRemapper's usefulness as an interactive de-obfuscation tool.

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.