是否有java类文件/字节码编辑器来编辑指令? [英] Is there a java classfile / bytecode editor to edit instructions?
问题描述
编辑java类文件是否有实用程序(或eclipse插件)?
我想操作java类文件的字节码而不重新编译它也没有完整的构建路径。
Is there a utility (or eclipse plugin) for editing java class files? I'd like to manipulate the bytecode of a java class file without recompiling it nor having a complete buildpath.
例如。重命名方法,添加/删除指令,更改常量等。
我找到的唯一实用工具是:
The only utilities I found are:
-
classeditor
但它非常功能有限(例如重命名事物和操纵指令是不可能的)。
jbe 不保存更改(可能因为类验证失败 - 在我进行任何更改之前,尽管类运行完美)
jbe doesn't save changes (maybe because class verifying fails - before I made any changes, although the class runs perfectly)
(jbe最初有一个类路径问题,帮助添加了jbe.bat文件的类路径)
(jbe initially had a classpath issue, adding the class path to the jbe.bat file helped)
推荐答案
我还没有看到任何字节码 - >字节码前端,但有很多后端。
I have not seen any byte code -> byte code frontends, but plenty backends.
我建议您查看许多字节代码操作库,例如 javassist
允许加载字节代码,操作它并将其保存回磁盘,然后编写一个完全正确的小主体那个。
I would suggest that you have a look at the many byte code manipulation libraries like javassist
which allow loading byte code, manipulate it, and save it back to disk, and then write a small main that does exactly that.
这篇关于是否有java类文件/字节码编辑器来编辑指令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!