Code Monkey home page Code Monkey logo

recaf's Introduction

Recaf Discord Build Status downloads Contributions welcome

screenshot of recaf

An easy to use modern Java bytecode editor that abstracts away the complexities of Java programs. Recaf abstracts away:

  • Constant pool
  • Stack frames
  • Wide instructions
  • And more!

Don't know bytecode? That's ok because Recaf supports recompiling decompiled code and inserting single line Java statements into the bytecode.

For more information: Read the documentation

Important notice for newer versions: 3X and 4X

This video explains what's going on in the the Recaf developer space. What's going on with 3x and 4x, and plans for the future.

Download

See the releases page for the latest build.

Preface

If you're just getting started with reverse-engineering in Java, read primer guide. Then check the documentation pages.

Contributing

Are you a developer?

Check out the open issues, project boards, and many scattered TODO messages throughout the source code. There's plenty to do.

Not a developer?

You can help by reporting bugs, making suggestions, providing translations, and sharing this project.

More information can be found in the contribution guide.

Setting up the project

Clone the repository via git clone https://github.com/Col-E/Recaf.git

Open the project in an IDE or generate the build with maven.

IDE:

  1. Import the project from the pom.xml
    • IntelliJ
    • Eclipse - (Warning: Eclipse's custom compiler cannot compile Recaf because of incorrect generics parsing)
  2. Create a run configuration with the main class me.coley.recaf.Recaf

Without IDE:

  1. Execute build
    • Follow the prompt in the script to build the project.
  2. Run the generated build: java -jar target/recaf-{version}-jar-with-dependencies.jar

For additional information, join the Discord server (https://discord.gg/Bya5HaA)

recaf's People

Contributors

1fxe avatar andylizi avatar anfanik avatar axdsan avatar axiometry avatar charlesdaniels avatar col-e avatar demkom58 avatar dependabot[bot] avatar dmitrijza avatar earthcomputer avatar enaium avatar frankheijden avatar jinshin avatar julienvanelian avatar jumanji144 avatar michaelsavich avatar mmiszczyk avatar ragingcactus avatar shoffmeister-swisscom avatar thexxturboxx avatar timmyovo avatar toshimichi0915 avatar tth05 avatar virb3 avatar win32kbase avatar x4e avatar xtherk avatar xxdark avatar yapht 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  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

recaf's Issues

Recompile Always Fails even when running with JDK

Every time I try and recompile code after de-compiling, an error is given that says the following:

[ERRR:2/3/18 4:30 PM] Could not recompile, user attempted recompile from JRE process (not JDK).
[ERRR:2/3/18 4:30 PM] You cannot use this feature while running Recaf under the JRE.
Recompilation relies on Recaf being executed in a JDK.
Please re-run with a JDK.

I am currently running it with a JDK. The trace I am given is the following:

Trace:
me.coley.recaf.ui.component.panel.DecompilePanel.recompile(DecompilePanel.java:109)
me.coley.recaf.ui.component.panel.DecompilePanel.lambda$new$0(DecompilePanel.java:68)
me.coley.recaf.ui.component.action.ActionMenuItem$1.actionPerformed(ActionMenuItem.java:21)
javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
javax.swing.DefaultButtonModel.setPressed(Unknown Source)
javax.swing.AbstractButton.doClick(Unknown Source)
javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
java.awt.Component.processMouseEvent(Unknown Source)
javax.swing.JComponent.processMouseEvent(Unknown Source)
java.awt.Component.processEvent(Unknown Source)
java.awt.Container.processEvent(Unknown Source)
java.awt.Component.dispatchEventImpl(Unknown Source)
java.awt.Container.dispatchEventImpl(Unknown Source)
java.awt.Component.dispatchEvent(Unknown Source)
java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
java.awt.Container.dispatchEventImpl(Unknown Source)
java.awt.Window.dispatchEventImpl(Unknown Source)
java.awt.Component.dispatchEvent(Unknown Source)
java.awt.EventQueue.dispatchEventImpl(Unknown Source)
java.awt.EventQueue.access$500(Unknown Source)
java.awt.EventQueue$3.run(Unknown Source)
java.awt.EventQueue$3.run(Unknown Source)
java.security.AccessController.doPrivileged(Native Method)
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
java.awt.EventQueue$4.run(Unknown Source)
java.awt.EventQueue$4.run(Unknown Source)
java.security.AccessController.doPrivileged(Native Method)
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
java.awt.EventQueue.dispatchEvent(Unknown Source)
java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
java.awt.EventDispatchThread.pumpEvents(Unknown Source)
java.awt.EventDispatchThread.pumpEvents(Unknown Source)
java.awt.EventDispatchThread.run(Unknown Source)

Any idea as to why this is happening?

Copy method

How to copy method on recaf?

Let assume I had method called setBeeperVolume and I want to copy method to setBeeperVolume2.
is it possible to do?

image

Thanks

Recaf as a Java Agent

It would be REALLY neat if recaf could be applied to a jvm as an agent and the edits would be applied via the instrumentation API.

It'd be sorta like JavaSnoop.

So this would probably pass some arguments to the main method, which would replace the file menu with a "refresh classes" button or something similar. It would still behave largely the same as before with the file tree, as that can just be retrieved via the class path / agent launch args.

Since it would have access to all the libraries I'd imagine there should be some sorta option to limit what is accessible so some operations of recaf aren't slowed to a halt.

Graphing capabilities

Potential applications:

  • Display flow (Bonus for editing, ideal would be a node-like structure)
    • Large-scale: Call mapping entire programs from main([Ljava/lang/String;) entry points
    • Small-scale: Control flow of methods
  • Class relations
    • Inheritance hierarchy (Parent, interfaces, implementations)

Addition of void temp method to edited class

Describe the bug
Recaf is adding the following method to any edited class when exporting
void temp();
Hence you get this error when you try to run the class
java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file

Exception when saving jar

This is exception thrown when saving jar(recaf is built from latest code revision 3d83c59):

NegativeArraySizeException:
Message: null
Trace:
org.objectweb.asm.Frame.merge(Frame.java:1447)
org.objectweb.asm.MethodWriter.visitMaxs(MethodWriter.java:1520)
org.objectweb.asm.tree.MethodNode.accept(MethodNode.java:835)
org.objectweb.asm.tree.MethodNode.accept(MethodNode.java:727)
org.objectweb.asm.tree.ClassNode.accept(ClassNode.java:452)
me.coley.recaf.asm.AsmUtil.toBytes(AsmUtil.java:135)
me.coley.recaf.asm.JarData.save(JarData.java:55)
me.coley.recaf.Recaf.saveFile(Recaf.java:100)
me.coley.recaf.ui.Gui$2.actionPerformed(Gui.java:90)
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
javax.swing.AbstractButton.doClick(AbstractButton.java:376)
javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833)
javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877)
java.awt.Component.processMouseEvent(Component.java:6533)
javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
java.awt.Component.processEvent(Component.java:6298)
java.awt.Container.processEvent(Container.java:2236)
java.awt.Component.dispatchEventImpl(Component.java:4889)
java.awt.Container.dispatchEventImpl(Container.java:2294)
java.awt.Component.dispatchEvent(Component.java:4711)
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
java.awt.Container.dispatchEventImpl(Container.java:2280)
java.awt.Window.dispatchEventImpl(Window.java:2746)
java.awt.Component.dispatchEvent(Component.java:4711)
java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
java.awt.EventQueue.access$500(EventQueue.java:97)
java.awt.EventQueue$3.run(EventQueue.java:709)
java.awt.EventQueue$3.run(EventQueue.java:703)
java.security.AccessController.doPrivileged(Native Method)
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
java.awt.EventQueue$4.run(EventQueue.java:731)
java.awt.EventQueue$4.run(EventQueue.java:729)
java.security.AccessController.doPrivileged(Native Method)
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Cause: null

Methods with the same name show results under one node

Take this example:

class A {
    void x() { String s = "example"; }
    void x(int i) { string s = "example"; }
}

If you were to search strings for example the results would show:

  • Class A
    • Method x
      • "example" <-- belongs to the first method
      • "example" <-- belongs to the second method (int i)

To Reproduce
Steps to reproduce the behavior:

  1. Search for something in an obfuscated assembly where method names match but method descriptors do not
  2. See results that match above

Solution

Associate results with name + description rather than just name. Showing the description is optional. Just the association matters.

compilation failure in Java8

The project failed to compile for me in Java 8:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:compile (default-compile) on project recaf: Compilation failure
[ERROR] /Documents/Crackmes/JavaCrackmes/recaf/Recaf/src/me/coley/recaf/asm/OpcodeUtil.java:[147,72] incompatible types: inference variable T has incompatible bounds
[ERROR] equality constraints: java.lang.String,E
[ERROR] lower bounds: java.lang.Object
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:compile (default-compile) on project recaf: Compilation fai
/Documents/Crackmes/JavaCrackmes/recaf/Recaf/src/me/coley/recaf/asm/OpcodeUtil.java:[147,72] incompatible types: inference variable T has incompatible bounds
equality constraints: java.lang.String,E
lower bounds: java.lang.Object

Eclipse has a bug report that seems to address this (https://bugs.eclipse.org/bugs/show_bug.cgi?id=469297)
As the bug report suggests, Eclipse 4.6.3 did not detect this problem in the code.

Changing the code on line 147:
/**
* Empty list.
*/
public static final Set OPS_EMPTY = Stream.of("").collect(Collectors.toCollection(LinkedHashSet::new));

That allowed it to compile and Recaf seemed to work just fine. Don't know the real consequences of this change!

Opcode list glitches out / gives exception and empty fields

When showing the opcode list of a method, I oftentimes get a number of elements that are missing all text content, including the number in front. The console shows the following warning:


(java:22546): Gtk-WARNING **: Unable to locate theme engine in module_path: "adwaita",
[INFO:5/28/18 11:37 PM] Loaded input from: 'BOSEconomy_0.7.8.1.jar'
Exception in thread "JavaFX Application Thread" java.lang.IllegalArgumentException
        at org.objectweb.asm.Type.getType(Type.java:443)
        at org.objectweb.asm.Type.getReturnType(Type.java:353)
        at org.objectweb.asm.Type.getReturnType(Type.java:555)
        at me.coley.recaf.ui.FormatFactory.addMethodType(FormatFactory.java:149)
        at me.coley.recaf.ui.FormatFactory.addOpcode(FormatFactory.java:203)
        at me.coley.recaf.ui.FormatFactory.opcode(FormatFactory.java:118)
        at me.coley.recaf.ui.component.InsnListEditor$OpcodeList.createFormat(InsnListEditor.java:541)
        at me.coley.recaf.ui.component.InsnListEditor$OpcodeList.lambda$10(InsnListEditor.java:514)
        at com.sun.javafx.application.PlatformImpl.lambda$null$117(PlatformImpl.java:295)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.javafx.application.PlatformImpl.lambda$runLater$118(PlatformImpl.java:294)
        at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
        at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
        at com.sun.glass.ui.gtk.GtkApplication.lambda$null$450(GtkApplication.java:139)
        at java.lang.Thread.run(Thread.java:748)
[ERRR:5/28/18 11:37 PM] Could not locate: org.objectweb.asm.tree.VarInsnNode@211c7108 @1095
[ERRR:5/28/18 11:37 PM] Could not locate: org.objectweb.asm.tree.VarInsnNode@436ee718 @1100

java -version
java version "1.8.0_172"
Java(TM) SE Runtime Environment (build 1.8.0_172-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.172-b11, mixed mode)

also tried:

java -version
openjdk version "1.8.0_162"
OpenJDK Runtime Environment (build 1.8.0_162-8u162-b12-0ubuntu0.16.04.2-b12)
OpenJDK 64-Bit Server VM (build 25.162-b12, mixed mode)

Also I am on Linux Ubuntu 16 with Kubuntu-desktop installed on top of it.

Inserting opcodes shows wrong jump-destination highlights

When inserting new opcodes, it seems the highlighted opcodes are offset by how many new opcodes there are. The issue is fixed by closing and reopening the method opcode list.

To Reproduce
Steps to reproduce the behavior:

  1. Insert an opcode, like GOTO
  2. Select it and notice the destinations are wrong

In this picture the highlighted lines are shifted down by one. The mark function in this case successfully identifies opcode 4 as the fail-case, and opcode 17 as the jump destination. However, the node that receives the CSS class is wrong.
image

Certain methods cause Frame.merge infinite loop

When saving an unedited jar:

image

Currently unsure if the fault is with the input or ASM itself.

The following loop is called in Frame.merge(ClassWriter,Frame,int):

  final boolean merge(final ClassWriter cw, final Frame frame, final int edge) {
        boolean changed = false;
        int i, s, dim, kind, t;

        int nLocal = inputLocals.length;
        int nStack = inputStack.length;
        if (frame.inputLocals == null) {
            frame.inputLocals = new int[nLocal];
            changed = true;
        }

        for (i = 0; i < nLocal; ++i) {
            if (outputLocals != null && i < outputLocals.length) {
                // local and stack stuff, irrelevant for this issue
            } else {
                t = inputLocals[i];
            }
            // init
      
      // Here is the issue line
            changed |= merge(cw, t, frame.inputLocals, i);
        }
    // cut
  }

The referenced method is: Frame.merge(ClassWriter,int,int[],int)

 private static boolean merge(final ClassWriter cw, int t,
            final int[] types, final int index) {
        int u = types[index];
        if (u == t) {
            // if the types are equal, merge(u,t)=u, so there is no change
            return false;
        }
        // cut
 }

Better context menu for selecting members

In NodeClickListener

So for fields:

  • Access
  • Search uses
  • Default Value
  • Edit Definition (This brings up menu containing)
    • Name
    • Desc
    • Signature

And methods:

  • Access
  • Search uses
  • Local Variables
  • Opcodes
  • AST Flow chart
    • This is way out of my league for now
  • Edit Definition (This brings up menu containing)
    • Name
    • Desc
    • Signature

Future changes (re-write)

So I'm currently drafting up a total redesign.

  • The design / architecture is totally different, it is now primarily event-driven.
  • UI is completely reworked in JavaFX (WIP, subject to change).
  • Input (jar or class) is parsed as a virtual-file-system which will allow some new nifty features in the future.
  • Hopefully move away from MDI (multiple inner window UI), not at this point but looking into it. (Editing methods side by side is still a goal though)

Since I'm doing things from the ground up now would be the best time to implement some wild changes (suggestions?), that were previously impossible. When these changes are done the next release will be 1.0 and will no longer be classified as a "pre-release".

Roll-out CI for Recaf

Recaf should have some sort of CI to:

  • Ensure every commit compiles.
  • Ensure documentation is build for every commit.
  • Monitor CheckStyle/FindBugs issue count for every commit.
  • Make build artifacts (jarfile, docs) are available for download.

I suggets investigating Travis CI as it is free for open source projects to use.

Recaf needs unit tests.

Recaf should have unit tests to reduce the probability of regressions between releases. I suggest JUnit as it integrates nicely with Maven and is widely used.

Mapping

For the original message, see the edit history, but with recent changes this has now become much easier than initially thought, so the goals have changed.

Update 6/8/2018 - Renaming things (Currently only supporting class names) updates them across the entire project.

Code quality improvement

Once PR #16 is merged, Recaf will have FindBugs and CheckStyle code-quality metrics as part of the reports in mvn site. I would propose a few things to act on these going forward:

  1. Commit to "ratcheting down" the number of quality issues. I would simply record the number of issues associated with each commit and try to reduce it, or at least not increase it, with every commit.

  2. Make an ongoing effort to reduce the number of quality issues, even if it's just a few at a time.

  3. If necessary, disable certain checks from CheckStyle and FindBugs. Not every check will be useful for every project. That said, be sure when disabling a check project-wide that it really isn't a legitimate quality issue for this project.

  4. Once the total issue count is reduced to 0, make CheckStyle and FindBugs part of mvn compile so that the build fails if any new issues appear.

I would suggest creating issues based on the content of this one, then closing this one, as this is just intended to provoke discussion/planning.

Array type in opcode window show improperly

Referencing a field such as String[] array shows up as GetField String array but should show GetField String[] array

This is only an issue for non-primitives. A byte array for instance shows up correctly as [B

Use maven for dependencies

I tried to clone/explore/debug but you don't specify versions of libraries anywhere. I tried couple of them but they were not correct. Consider better docs or use maven/gradle for dependency management.

Plugin System: Events and Capabilities

With 88b9bf6 I've added a half-dozen events to the plugin system, Plugins can listen to events in the me.coley.recaf.event.impl package and must inherit the me.coley.recaf.plugins.Plugin interface.

An example plugin that has overridden all the default plugin methods:

public class ExamplePlugin implements Plugin {
	@Listener
	public void onFileOpen(EFileOpen event) {
		// Called when user loads a jar file
		System.out.println("Classes: " + event.getClasses().size());
		System.out.println("Resources: " + event.getResources().size());
	}
	
	@Override
	public void init() {
		// Called when plugin is initialized.
		System.out.println("init time:" + System.currentTimeMillis());
	}

	@Override
	public void onMenuClick() {
		// Called when clicked from the UI menu
		System.out.println("clicked from UI!");
	}

	@Override
	public String getID() {
		// Optional, default returns the simplified class name.
		return "Example Plugin";
	}
}

Here are the current events categorized:

  • Generic
    • On recaf initalization
    • On jar select
      • Access to contents of jar, classes & resources
    • On jar save
      • Access to contents of output (all entries as bytes)
    • On class open (Open in UI)
    • On method (opcodes) open (Open in UI)
  • UI Access
    • On context-menu-create : Class window background
    • On context-menu-create : Field menu
    • On context-menu-create : Method menu
    • On context-menu-create : Method opcode menu

What additional events would you like to see? These are just a few basic ones I thought could be useful.

Search improvments

  • Allow exact matches for all search types instead of defaulting to containment checks
  • Regex string search
    • Disables case sensitivity option when active
  • Value search (For numeric values)
  • Opcode pattern matcher
    • Searches for a given sequence of opcodes
  • Configurable search presets
    • Using regex as an example, presets for urls, registry keys, file paths, etc.
  • Hitting return in a text box should start the search

ArrayIndexOutOfBoundsException when forgetting ; in method descriptor

Hey its me again! :)
tried to do an invokespecial for java/lang/IllegalArgumentException with descriptor (Ljava/lang/String)V, my mistake, it should have been (Ljava/lang/String;)V. Got this exception:

[ERRR:5/29/18 8:57 PM] ArrayIndexOutOfBoundsException: 21
org.objectweb.asm.Type.getArgumentTypes(Type.java:282)
org.objectweb.asm.Type.getArgumentTypes(Type.java:545)
me.coley.recaf.ui.FormatFactory.addMethodType(FormatFactory.java:145)
me.coley.recaf.ui.FormatFactory.addOpcode(FormatFactory.java:208)
me.coley.recaf.ui.FormatFactory.opcode(FormatFactory.java:120)
me.coley.recaf.ui.component.InsnListEditor$OpcodeList.createFormat(InsnListEditor.java:540)
me.coley.recaf.ui.component.InsnListEditor$OpcodeList.lambda$10(InsnListEditor.java:513)
com.sun.javafx.application.PlatformImpl.lambda$null$117(PlatformImpl.java:295)
java.security.AccessController.doPrivileged(Native Method)
com.sun.javafx.application.PlatformImpl.lambda$runLater$118(PlatformImpl.java:294)
com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
com.sun.glass.ui.gtk.GtkApplication.lambda$null$450(GtkApplication.java:139)
java.lang.Thread.run(Thread.java:748)

PS: Sorry for not fixing that stuff myself, kind of low on time for quality work atm ;)

UI customization support

Example of values for list components:

  • Container:
    • Colors (By default its that gray)
    • Border type
  • What should be italic / bold
  • What should be given a specific color (Given as hex format)

Deleted methods do not save to JAR

Due to a bug in IntelliJ's GUI designer, a certain method is created multiple times in the target JAR. In order to get rid of the duplicates, which cause the whole application JAR to crash with a java.lang.ClassFormatError, I used Recaf.

After deleting the duplicate methods in Recaf, I verified the code after decompiling it again using Recaf as well and saved the new JAR since I only saw one copy of the method left. However, the JAR did not get updated analogously to the deleted methods. All duplicates are still there. Why is that? This literally defeats the purpose of a bytecode editor when it does not edit the JAR like you did in the GUI. I'm using the as of now latest release.

Can you please fix this? Thanks a lot. I appreciate this application but it would be nice if it can deliver what it promises.

Recaf hangs on saving JAR

I'm trying to edit the bytecode on an older program I have. The fix just requires a change to a String constant, so the simplest solution is to edit the bytecode rather than access the git for it and go through the trouble of bringing it up to the date with the other software it relies on. I'm able to successfully change the fields I'm looking for, but unfortunately when I try to save the jar, Recaf hangs indefinitely and ends up unresponsive. If you leave your contact information, I can send you the JAR in question. Otherwise, I'm impressed with this software! It's by far one of the best bytecode editors I've used.

Opcode-Blocks

Allow user to save and load blocks of opcodes, insert anywhere. Store in relative folder and populate menu bar entry with directory tree.

Saving jar changes classes which have not been edited?

Hi, i noticed that saving a jar will result in a lot of changes in *.class files which have not been touched.

I only changed a single ICONST_0 to ICONST_1 in one *.class file, and saved the jar. So i expected that this change is only reflected in the changed class. However most *.class files have been edited.

Would it be possible to add a separate Save to each single class when something has been changed? This would make it easier to compare / see what has been changed manually compared with the genuine jar

Only change in one class:
image

This class has not been touched manually:
image

Thanks.. Nice tool btw :)

not saved any changes

This my tester in last version
drag java file to recaf > select my class file > changes my code > save as new.jar
when i check my changes ..nothing happend and nothing changed

Items appear out of order on multiple menus

I really love it when a list goes:

A, B, C, E, F, D, G, I, H, ...

Examples are the opcode edit radio-buttons and dropdowns in the opcode insertion window. Ideally they should just be alphabetical.

Uncaught exception while opening an invalid Java program

IllegalArgumentException:
Message: null
Trace: 
org.objectweb.asm.ClassReader.<init>(ClassReader.java:185)
org.objectweb.asm.ClassReader.<init>(ClassReader.java:168)
org.objectweb.asm.ClassReader.<init>(ClassReader.java:443)
me.coley.recaf.asm.Asm.readClass(Asm.java:46)
me.coley.recaf.asm.JarData.<init>(JarData.java:58)
me.coley.recaf.Recaf.selectInput(Recaf.java:118)
me.coley.recaf.ui.SwingUI.lambda$setupMenu$0(SwingUI.java:102)
me.coley.recaf.ui.component.action.ActionMenuItem$1.actionPerformed(ActionMenuItem.java:21)
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)

Steps-to-reproduce:

  1. Click File -> Open.
  2. Change File Type to All Files (or something like that, I'm not sure about the specific wording).
  3. Open any file that isn't a Java program.

Maybe add some validation like this:
validation
or

fileChooser.setAcceptAllFileFilterUsed(false);

so users will only be able to select a class or jar?

Exception at com.apple.laf.AquaMenuPainter.paintMenuBarBackground(AquaMenuPainter.java:145)

I'm using recaf to edit target/recaf-0.9-jar-with-dependencies.jar itself, it sometimes raises exception like this ... although the application did not crash, but you might wanna look at it

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
	at com.apple.laf.AquaMenuPainter.paintMenuBarBackground(AquaMenuPainter.java:145)
	at com.apple.laf.AquaMenuBarUI.paint(AquaMenuBarUI.java:74)
	at javax.swing.plaf.ComponentUI.update(ComponentUI.java:161)
	at javax.swing.JComponent.paintComponent(JComponent.java:780)

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.