相关疑难解决方法(0)

是否有java类文件/字节码编辑器来编辑指令?

是否有用于编辑java类文件的实用程序(或eclipse插件)?我想操纵java类文件的字节码而不重新编译它,也没有完整的构建路径.

例如,重命名方法,添加/删除指令,更改常量等.

我找到的唯一工具是:

  • 类编辑 ,但它在功能上非常有限的(如物联网和操作说明改名是不可能的).

  • jbe不保存更改(可能因为类验证失败 - 在我进行任何更改之前,尽管类运行完美)

    (jbe最初有一个类路径问题,将jbe.bat文件的类路径添加到了帮助中)

java bytecode bytecode-manipulation decompiler .class-file

30
推荐指数
3
解决办法
2万
查看次数

Can I modify the byte code of a Java method in the runtime?

I am writing a plugin of another large java program .

I want to modify some byte code of some java method of the java program during runtime, so that I can intercept the method calls (namely, inject some hooking code into the method).

Any way can achieve this?

PS:

I've checked the following approaches:

1.change the classloader of the java program. (we CANNOT change it)
2.use java proxy. (We CANNOT use java proxy, because java proxy would create a …

java proxy hook bytecode javassist

4
推荐指数
2
解决办法
6355
查看次数