做为常用工具之一javap对于研究反编译以及破解的人来说是常用的工具之一,能通过该工具查看指令编码了解执行过程,之前看class文件格式的时候用到这个工具去查询class文件的一些信息。今天再巩固一下,做个笔记。
通过本文你可能会学到的知识为:
(1)javap的使用语法
(2)javap的参数含义
javap [ options ] class. . .
where options include:
-c Disassemble the code //解析代码,方法里的字节码转换成指令
-classpath <pathlist> Specify where to find user class files//指定去哪里找class的路径
-help Print this usage message//打印帮助信息
-J<flag> Pass <flag> directly to the runtime system //使用javap.exe执行java.exe相关命令
-l Print line number and local variable tables//打印出行数以及本地变量表
-public Show only public classes and members//只打印出公共方法和成员
-protected Show protected/public classes and members//打印公共和受保护的方法以及成员
-package Show package/protected/public classes and members (default)//打印出公共和受保护的方法以及成员(默认是这种模式)
-private Show all classes and members//展示所有的类和成员
-s Print internal type signatures//打印内部方法以及参数
-verbose Print stack size, number of locals and args for methods //输出栈的大小,本地变量个数以及方法参数