Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Attribute_Info ¶
type Attribute_Info struct {
Attribute_name_index int //指向常量库utf8
Attribute_length int //长度
Info []byte //属性信息
}
属性信息
type ClassFile ¶
type ClassFile struct {
Magic []byte //魔数
Minor_version int //次要版本
Major_version int //主要版本
Constant_pool_count int //常量
Constant_pool []Cp_Info //常量池,通过索引导向常量
Access_flags int //访问权限
This_class int //class文件自身索引
Supe_class int //父类索引
Interfaces_count int //实现的接口个数 ps:java一个类可以实现多个接口
Interfaces []int //每个接口的索引
Fields_count int //字段个数
Fields []Field_Info //字段信息
Methods_count int //方法数
Methods []Method_Info //方法信息
Attributes_count int //类属性数
Attributes []Attribute_Info //类属性信息
}
class文件结构,首字母大小写来控制访问权
func ReadFromJar ¶
读取jar("*.jar","com/jieshao/demo/main.class")
type ConstantInfo ¶
加载常量
type Field_Info ¶
type Field_Info struct {
Access_flags int //访问权限
Name_index int //名字索引,指向常量池UTF8类型
Descriptor_index int //描述符索引
Attributes_count int //字段属性的个数
Attributes []Attribute_Info //字段属性详细
}
字段
type Method_Info ¶
type Method_Info struct {
Access_flags int //权限
Name_index int //方法名常量池UTF8索引
Descriptor_index int //描述符索引
Attributes_count int //方法属性的个数
Attributes []Attribute_Info //方法属性详细
}
方法
Click to show internal directories.
Click to hide internal directories.