jasmin這個(gè)工具,用它寫了一個(gè)HelloWorld程序,因?yàn)槭褂谜5膉avac編譯得到的class文件確定是正確的,使用jasmin估計(jì)可以設(shè)計(jì)一些非法的class文件。
HelloWorld的代碼:
.class public HelloWorld
.super java/lang/Object
;specify the constuctor method for the Example class
.method public()V
;just call Object's constructor
aload_0
invokespecial java/lang/Object/()V
return
.end method
;specify the "main" method -this prints "Hello World"
.method public static main([Ljava/lang/String;)V
;set limmits used by this method
.limit stack 2
;push the output stream and the string "Hello World " onto the stack
;then invoke the println method
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc "Hello World!"
invokevirtual java/io/PrintStream/println(Ljava/lang/String;)V
return
.end method
這樣看太累了,希望不忙的時(shí)候能夠開發(fā)個(gè)相關(guān)的插件。
HelloWorld的代碼:
.class public HelloWorld
.super java/lang/Object
;specify the constuctor method for the Example class
.method public
;just call Object's constructor
aload_0
invokespecial java/lang/Object/
return
.end method
;specify the "main" method -this prints "Hello World"
.method public static main([Ljava/lang/String;)V
;set limmits used by this method
.limit stack 2
;push the output stream and the string "Hello World " onto the stack
;then invoke the println method
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc "Hello World!"
invokevirtual java/io/PrintStream/println(Ljava/lang/String;)V
return
.end method
這樣看太累了,希望不忙的時(shí)候能夠開發(fā)個(gè)相關(guān)的插件。

