defs

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const BEConstant = 0x78563412
View Source
const DexHeaderSize = 0x70
View Source
const LEConstant = 0x12345678
View Source
const Magic = 0x0000000A786564

Variables

This section is empty.

Functions

This section is empty.

Types

type AnnotationDef

type AnnotationDef struct {
	Dir    AnnotationsDirectory
	Tables AnnotationTables
}

func NewAnnotationDef

func NewAnnotationDef(p Parser) (AnnotationDef, error)

type AnnotationSet

type AnnotationSet struct {
	Size uint32
}

type AnnotationSetDef

type AnnotationSetDef struct {
	Set     AnnotationSet
	Offsets []uint32
}

func NewAnnotationSetDef

func NewAnnotationSetDef(p Parser) (AnnotationSetDef, error)

type AnnotationTable

type AnnotationTable struct {
	Index  uint32 // unused
	Offset uint32 // -> AnnotationSet
}

type AnnotationTables

type AnnotationTables struct {
	Fields     []AnnotationTable
	Methods    []AnnotationTable
	Parameters []AnnotationTable
}

type AnnotationsDirectory

type AnnotationsDirectory struct {
	ClassAnnotations uint32 // -> AnnotationSet
	FieldsSize       uint32
	MethodsSize      uint32
	ParametersSize   uint32
}

type ClassDef

type ClassDef struct {
	Index              uint32
	AccessFlags        uint32
	Super              uint32
	InterfacesOffset   uint32
	SourceFileIndex    uint32
	AnnotationsOffset  uint32
	ClassDataOffset    uint32
	StaticValuesOffset uint32

} // Size: 0x20

func NewClassDef

func NewClassDef(p Parser) (ClassDef, error)

type CodeItem

type CodeItem struct {
	Payload []byte
	// contains filtered or unexported fields
}

func NewCodeItem

func NewCodeItem(p Parser) (CodeItem, error)

type DexHeader

type DexHeader struct {
	Magic      uint64   // 0x0
	Checksum   uint32   // 0x8
	Signature  [20]byte // 0xc
	FileSize   uint32   // 0x20
	HeaderSize uint32   // 0x24
	EndianTag  uint32   // 0x28
	Links      Table    // 0x2c
	MapOff     uint32   // 0x34
	StringIDs  Table    // 0x38
	TypeIDs    Table    // 0x40
	ProtoIDs   Table    // 0x48
	FieldIDs   Table    // 0x50
	MethodIDs  Table    // 0x58
	ClassDefs  Table    // 0x60
	Data       Table    // 0x68

} // Size: 0x70

func NewDexHeader

func NewDexHeader(p Parser) (DexHeader, error)

type FieldDef

type FieldDef struct {
	Class uint16
	Type  uint16
	Name  uint32
}

func NewFieldDef

func NewFieldDef(p Parser) (FieldDef, error)

type MethodDef

type MethodDef FieldDef

func NewMethodDef

func NewMethodDef(p Parser) (MethodDef, error)

type MethodProtoDef

type MethodProtoDef struct {
	Shorty        uint32
	ReturnTypeIdx uint32
	Params        []uint16
	ParamsString  string
}

func NewMethodProtoDef

func NewMethodProtoDef(p Parser) (MethodProtoDef, error)

type Parser

type Parser interface {
	ReadULEB128() (uint64, error)
	ReadSLEB128() (int64, error)
	ReadBytes(n int64) ([]byte, error)
	ReadUint64() (uint64, error)
	ReadUint32() (uint32, error)
	ReadUint16() (uint16, error)
	ReadStruct(any) error
}

type ProtoDef

type ProtoDef struct {
	Shorty       uint32
	Return       uint32
	ParamsOffset uint32
}

func NewProtoDef

func NewProtoDef(p Parser) (ProtoDef, error)

type StringDef

type StringDef struct {
	Data []byte
}

func NewStringDef

func NewStringDef(p Parser) (StringDef, error)

type StringOffset

type StringOffset uint32

func NewStringOffset

func NewStringOffset(p Parser) (StringOffset, error)

type Table

type Table struct {
	Size   uint32
	Offset uint32

} // Size: 0x8

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL