17

What's a good free bytecode editor? I want an editor, something with a GUI...

I tried jbe-0.1b with no luck (can't save the bytecode changes).

AlfaTeK
  • 7,487
  • 14
  • 49
  • 90
  • I just downloaded and tested jbe-0.1b and it worked fine for me. After pressing the `Save method` the class was modified (on disk). – user85421 Mar 07 '10 at 22:12
  • Yes, it should work but when saving I get a console error and it doesn't save anything... maybe something related to the method having many lines... What I really want is just an alternative – AlfaTeK Mar 08 '10 at 11:42
  • jbe breaks on methods containing the invokeinterface instruction. It tries to parse the interface method name as Integers with predictable results. It does include the source, so in theory it could be fixed. – yatima2975 Sep 29 '10 at 11:07
  • See similar question http://stackoverflow.com/questions/3308351/is-there-a-java-classfile-bytecode-editor-to-edit-instructions with altenative answers. – Vadzim Feb 10 '16 at 19:12

4 Answers4

9

Nothing decent with a UI, but you can use the Eclipse Bytecode Outline plugin to turn any Java class into ASM code, edit it, and produce the changed class. It's probably the most painless way at the moment.

http://asm.ow2.org/eclipse/index.html

Jevgeni Kabanov
  • 2,632
  • 24
  • 23
3

I understand jasmin and jasper are the usual pair used to translate between bytecode and an assemly language representation.

IIRC, Apache BCEL comes with a tool to disassemble class files to code which creates the class file with BCEL.

I've used vi. :)

Tom Hawtin - tackline
  • 145,806
  • 30
  • 211
  • 305
0

Just to be sure. Have you tried to decompile the class files? I don't know what are you trying to do exactly, but you could first decompile the classes, edit the sources and recompile again.

JAD is a very good decompiler which can handle pretty ugly bytecode and produce readable sources from it.

pajton
  • 15,828
  • 8
  • 54
  • 65
  • 2
    because of dependencies missing and complicated stuff I can't recompile the sources. So I just need to bytecode some stupid strings :) – AlfaTeK Mar 07 '10 at 08:18
  • If you just need to change the strings, any editor should be fine:-). Seriously, I believe they are stored just as strings there. – pajton Mar 07 '10 at 08:23
0

To create java bytecode you could use ASM which offers also eclipse plugins.

ASM is an all purpose Java bytecode manipulation and analysis framework. It can be used to modify existing classes or dynamically generate classes, directly in binary form.

stacker
  • 68,052
  • 28
  • 140
  • 210