Java bytecode edit tool set

There are 2 tool set combinations for java bytecode editing.

 1. ASM + JASMIN      
 First use ASM to disassemble the bytecode class file to assemble file.(see command line under ASM folder)     
 Then use JASMIN language specification to rewrite this class file and then compile this class file.(see command line under Jasmin folder)     
  Specification:     http://jasmin.sourceforge.net/instructions.html
 Advantage:      
    These 2 tools are very update-to-date, less risk for class file format compatibility.  
 Disadvantage:     
    We'll have a lot of work to do for using these 2 tools.  

2. Java ByteEdit for our manipulation: (JBE Editor)      
 Just run jbe.bat in JBE folder and use the GUI to do that.     
   jbe.bat   
 Advantage:     
    Easy to use, quick for test.  
 Disadvantage:     
    Not very update-to-date, we may have a risk for class file format compatibility issue.

----------------------------------------------------------------------------------------------------------------

Tool download URL and their documenation URL:

 ASM:     http://asm.ow2.org

 JASMIN: http://jasmin.sourceforge.net/

 JBE:      http://jbe.sourceforge.net/

 

----------------------------------------------------------------------------------------------------------------

Simple introduction for each tool listed as above:

 ASM:

-------------------

1. Feature description:(From Java class file to bytecode assembly language)
   java -classpath "asm.jar;asm-util.jar;yourjar.jar" org.objectweb.asm.util.TraceClassVisitor org.domain.package.YourClass
   or
   java -classpath "asm.jar;asm-util.jar" org.objectweb.asm.util.TraceClassVisitor org/domain/package/YourClass.class

TOTAL EXAMPLE:
   SET CP="E:/Resource/ASM/asm3.3lib/asm-3.3.jar;E:/Resource/ASM/asm3.3lib/asm-util-3.3.jar"
 SET CP=%CP%;"E:/Resource/Test"
 java -classpath %CP% org.objectweb.asm.util.TraceClassVisitor HelloWorld > HelloWorld.asm

2. You could get more on this project by looking into the following URL:
   http://asm.ow2.org/doc/tutorial-asm-2.0.html

-----------------------------------------------------------------------------------------------------------------

JASMIN:

1.Usage: (From disasessmbly language to java bytecode)
Include the jar files under the lib directory and then run the following command line:
    java -jar jasmin.jar examples/HelloWorld.j         [Windows]
or
    java -jar jasmin.jar examples/HelloWorld.j         [Unix/MacOsX]

2. You could get more on this project by looking into the following URL:
 http://en.wikipedia.org/wiki/Jasmin_(Java_assembler)#Invoking
 http://jasmin.sourceforge.net/

-----------------------------------------------------------------------------------------------------------------

JBE:
1. Usage: (Change java bytecode in disassemble mode directly)
   Just run jbe.bat in JBE folder and use the GUI to do that.

2. If you want to know more about JBE, please take a look of the following site:
   http://jbe.sourceforge.net/

------------------------------------------------------------------------------------------------------------------

 

Actually we can use ASM to manipulate the java assemble code directly with some self-coding, here based on our experience, I would like to say, JBE is the best tool for us to use.

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: Java bytecode editor,又称Java字节码编辑器,是一种可以修改和编辑Java字节码文件的工具。Java字节码文件是Java代码编译生成的二进制文件,可以在Java虚拟机(JVM)中运行。使用Java字节码编辑器可以直接编辑字节码文件,使得我们可以对Java代码进行更深层次的修改和优化,比如修改类的结构、增加或删除方法、更改变量类型等。 在Java开发中,Java字节码编辑器很常用。它可以帮助我们解决一些Java代码在编译时无法实现的需求,比如动态修改类的行为、扫描字节码中的敏感信息等。除此之外,Java字节码编辑器还可以帮助我们对Java的反编译进行优化,避免反编译工具针对Java应用程序进行恶意反编译。 Java bytecode editor的下载方式也很简单,只需要在网上搜索相关的字节码编辑器软件,比如Eclipse JDT Core Bytecode Editor、ASM Bytecode Editor、Bytecode Viewer等等,都可以从官方网站或者开发者站点上下载到相应的软件。 总之,Java bytecode editor是Java程序员非常实用的工具,它可以帮助我们对机器二进制代码进行调试和更改,从而优化Java代码的质量和性能。 ### 回答2: Java bytecode editor是Java编程语言中一个非常实用的工具,在Java开发过程中大有用处。该编辑器可以帮助Java开发者对Java字节码文件进行编辑,而且该编辑器允许开发者在进行编辑的同时进行调试和测试,便于开发者对代码进行修正和优化。通过使用Java bytecode editor,开发者可以在不改变原始代码的情况下,修改虚拟机所使用的字节码。这意味着开发人员可以更加自由地操作Java应用程序,在创建和维护Java应用程序时,这个工具非常有用。 Java bytecode editor具有明显的优点,其中最重要的是可以帮助开发人员快速地调试Java代码。Java代码会被编译为字节码,而Java末端用户看不到这些字节码,但开发者可以通过使用Java bytecode editor来查看和修改字节码。在Java开发中,如果存在错误,Java bytecode editor可以使错误修复更容易且更快捷。此外,Java bytecode editor提供了一些高级功能,例如代码反编译,使开发者能够将来自不同来源的代码相互转换。 因此,如果您在开发Java程序中遇到了字节码问题,那么Java bytecode editor将是一个很棒的工具。目前在网络上可以找到很多Java bytecode editor的下载资源,不妨下载安装一个,看看它是否能满足您的需求吧!

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值