一些使用javap反编译出来的结果分析

简介: 一些使用javap反编译出来的结果分析

Compiled from “stringTest.java”


public class stringTest.stringTest {undefined

public stringTest.stringTest();

Code:

0: aload_0

1: invokespecial #8 // Method java/lang/Object.""?)V

4: return


public static void main(java.lang.String[]);

Code:

//Jerry: ldc 把常量池中的项压入栈

0: ldc #16 // String Jerry

//Jerry: astore_1 将引用类型或returnAddress类型值存入局部变量1

2: astore_1

3: ldc #18 // String JS

5: astore_2

6: ldc #20 // String Developer

8: astore_3

//Jerry: 创建一个新对象

9: new #22 // class java/lang/StringBuilder

12: dup

//Jerry: 从局部变量1中装载引用类型值

13: aload_1

14: invokestatic #24 // Method java/lang/String.valueOf:(Ljava/lang/Object;)Ljava/lang/String;

  //Jerry:根据编译时类型来调用实例方法 
  17: invokespecial #30                 // Method java/lang/StringBuilder."<init>":(Ljava/lang/String;)V
  20: aload_2       
  21: invokevirtual #33                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
  24: aload_3       
  25: invokevirtual #33                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
  28: invokevirtual #37                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
  31: astore        4
  33: getstatic     #41                 // Field java/lang/System.out:Ljava/io/PrintStream;
  36: aload         4
  38: invokevirtual #47                 // Method java/io/PrintStream.println:(Ljava/lang/String;)V
  41: return        

}


Compiled from “stringTestLoop.java”

public class stringTest.stringTestLoop {undefined

public stringTest.stringTestLoop();

Code:

0: aload_0

1: invokespecial #8 // Method java/lang/Object.""?)V

4: return


public static void main(java.lang.String[]);

Code:

0: ldc #16 // String

2: astore_1

3: iconst_3

4: anewarray #18 // class java/lang/String

7: dup

8: iconst_0

9: ldc #20 // String 1

11: aastore

12: dup

13: iconst_1

14: ldc #22 // String 2

16: aastore

17: dup

18: iconst_2

19: ldc #24 // String 3

21: aastore

22: astore_2

23: iconst_0

24: istore_3

25: goto 52

28: new #26 // class java/lang/StringBuilder

31: dup

32: aload_1

33: invokestatic #28 // Method java/lang/String.valueOf:(Ljava/lang/Object;)Ljava/lang/String;

36: invokespecial #32 // Method java/lang/StringBuilder."":(Ljava/lang/String;)V

39: aload_2

40: iload_3

41: aaload

42: invokevirtual #35 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;

45: invokevirtual #39 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;

48: astore_1

49: iinc 3, 1

52: iload_3

53: aload_2

54: arraylength

55: if_icmplt 28

58: getstatic #43 // Field java/lang/System.out:Ljava/io/PrintStream;

61: aload_1

62: invokevirtual #49 // Method java/io/PrintStream.println:(Ljava/lang/String;)V

65: return

}


相关文章
|
5月前
javap反编译字节码文件
javap反编译字节码文件
|
Java 计算机视觉
JDK自带javap命令反编译class文件和Jad反编译class文件(推荐使用jad)
JDK自带javap命令反编译class文件和Jad反编译class文件(推荐使用jad)
311 0
JDK自带javap命令反编译class文件和Jad反编译class文件(推荐使用jad)
objdump反编译代码
objdump是显示object文件的详细信息的工具
253 0
|
JSON JavaScript Java
AndroidAPK混淆打包以及反编译技巧
AndroidAPK混淆打包以及反编译技巧
478 0
AndroidAPK混淆打包以及反编译技巧
反汇编与反编译
反汇编得到的是汇编代码 反编译的到的是语言的源代码
604 0
|
XML 数据安全/隐私保护 数据格式
反编译代码遇到的问题
1、所有变量前都强制转成Object,这样导致有些int形的值变成了string,特别是枚举值Enum; 2\ 枚举值使用的时候,如果是int,需要强制转换 (int)query.SaleStatus。
1061 0