java字节码编辑器?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2395574/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 06:58:38  来源:igfitidea点击:

java bytecode editor?

javabytecode

提问by AlfaTeK

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

什么是好的免费字节码编辑器?我想要一个编辑器,带有 GUI 的东西...

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

我尝试了 jbe-0.1b,但没有成功(无法保存字节码更改)。

采纳答案by Jevgeni Kabanov

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.

没有什么像样的 UI,但是您可以使用 Eclipse Bytecode Outline 插件将任何 Java 类转换为 ASM 代码,对其进行编辑,并生成更改后的类。这可能是目前最无痛的方式。

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

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

回答by pajton

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.

只是要确定。您是否尝试过反编译类文件?我不知道你到底想做什么,但你可以先反编译这些类,编辑源代码并再次重新编译。

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

JAD是一个非常好的反编译器,它可以处理非常丑陋的字节码并从中生成可读的源代码。

回答by Tom Hawtin - tackline

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

我知道 jasmin 和 jasper 是用于在字节码和汇编语言表示之间进行转换的常用对。

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

IIRC,Apache BCEL 附带了一个工具,可以将类文件反汇编为代码,从而使用 BCEL 创建类文件。

I've used vi. :)

我用过vi。:)

回答by stacker

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

要创建 Java 字节码,您可以使用ASM,它也提供 Eclipse 插件。

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.

ASM 是一个通用的 Java 字节码操作和分析框架。它可用于直接以二进制形式修改现有类或动态生成类。