bytecode

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClassFile

type ClassFile struct {
	ClassName    string
	SuperClass   string
	Interfaces   []string
	Methods      []*MethodInfo
	ConstantPool []interface{}
}

ClassFile represents a parsed Java class file

type JARAnalyzer

type JARAnalyzer struct {
	// contains filtered or unexported fields
}

JARAnalyzer analyzes JAR files and extracts bytecode information

func NewJARAnalyzer

func NewJARAnalyzer(jarPath string) *JARAnalyzer

NewJARAnalyzer creates a new JAR analyzer

func (*JARAnalyzer) AnalyzeJAR

func (ja *JARAnalyzer) AnalyzeJAR() ([]*ClassFile, error)

AnalyzeJAR extracts all classes and methods from a JAR file

func (*JARAnalyzer) BuildCallGraphFromJAR

func (ja *JARAnalyzer) BuildCallGraphFromJAR() (*models.CallGraph, error)

BuildCallGraphFromJAR builds a call graph from a JAR file

type MethodCall

type MethodCall struct {
	ClassName  string
	MethodName string
	Descriptor string
	Opcode     byte // The bytecode opcode (0xB6-0xBA)
}

MethodCall represents a method invocation

type MethodInfo

type MethodInfo struct {
	Name       string
	Descriptor string
	Code       []byte
	Calls      []MethodCall
}

MethodInfo represents a method in a class

type ReflectionAnalyzer added in v0.2.0

type ReflectionAnalyzer struct{}

ReflectionAnalyzer detects reflection usage patterns

func NewReflectionAnalyzer added in v0.2.0

func NewReflectionAnalyzer() *ReflectionAnalyzer

NewReflectionAnalyzer creates a new reflection analyzer

func (*ReflectionAnalyzer) AnalyzePatterns added in v0.2.0

func (ra *ReflectionAnalyzer) AnalyzePatterns(calls []MethodCall) []ReflectionPattern

AnalyzePatterns identifies reflection usage in method calls

func (*ReflectionAnalyzer) IsReflective added in v0.2.0

func (ra *ReflectionAnalyzer) IsReflective(calls []MethodCall) bool

IsReflective checks if a method uses reflection based on its calls

type ReflectionPattern added in v0.2.0

type ReflectionPattern struct {
	Type       string     // "ClassLoading", "MethodInvocation", "FieldAccess", "ConstructorCall"
	Method     MethodCall // The reflective call
	Target     string     // Inferred target class/method if analyzable
	Confidence string     // "high", "medium", "low" - how confident we are in the target
}

ReflectionPattern represents a detected reflection usage

Jump to

Keyboard shortcuts

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