col-e / jremapper Goto Github PK
View Code? Open in Web Editor NEWRemapping tool for compiled java programs.
License: MIT License
Remapping tool for compiled java programs.
License: MIT License
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.
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)
This is fine:
public List getAttributes()
This fails:
public List<Attribute> getAttributes()
Stripping generics would work but I'd like to be able to select the generic type as well if it's a valid class name.
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.
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.
With the rewrite, inherited methods do not remain members across the hierarchy.
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.
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.
Current work-around is having CFR show the java.lang.*
imports
This is largely an issue with BMF, but an issue here wouldn't hurt either.
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)```
Reproduction:
me/coley/Options
->me/coley/Options2
And now the class in the file tree me/coley/Options
won't open. No exceptions seem to be thrown.
[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)
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.
Unsure if it's CFR or the editor. Will have to check both.
For example :
public class SomeOuterClass.SomeInnerClass {
...
This is not detected as SomeOuterClass$SomeInnerClass
. However, they can still be renamed by loading a mappings file.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.