java

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DoubleOperandOpcodes = make([]bool, 0xff)
View Source
var NoOperandOpcodes = make([]bool, 0xff)
View Source
var OpcodesInitialised = false
View Source
var OtherOpcodes = []uint8{0xc4, 0xab, 0xaa, 0xfe, 0xff, 0xca}

OtherOpcodes that are either reserved or take a variable number of operands

View Source
var QuadOperandOpcodes = make([]bool, 0xff)
View Source
var SingleOperandOpcodes = make([]bool, 0xff)
View Source
var TripleOperandOpcodes = []uint8{0xc5}

Functions

func HashClassInstructions

func HashClassInstructions(classBytes []byte) (string, error)

HashClassInstructions produces a hash of the opcodes that define the methods of the specified class. This is intended to not change if the package name or other details are changed with the resulting changes to the non-opcode parts of the class format.

Types

type ClassHash

type ClassHash struct {
	ClassSize               int64
	CompleteHash            string
	BytecodeInstructionHash string
}

func HashClass

func HashClass(jarFile string, className string) (ClassHash, error)

type Opcodes

type Opcodes struct {
	NoOperandOpcodeLookupTable     []bool
	SingleOperandOpcodeLookupTable []bool
	DoubleOperandOpcodeLookupTable []bool
	QuadOperandOpcodeLookupTable   []bool
	TripleOperandOpcodes           []uint8
	OtherOpcodes                   []uint8
}

Opcodes are used when hashing bytecode to separate out the parts that are relatively static when shading or obfuscating classfiles while skipping the operands that change with those modifications.

These tables are intended to use memory (1mb per number of operands) in order to speed up lookups. Total memory use remains reasonable as these are shared between all uses.

func OpcodeLookupTables

func OpcodeLookupTables() Opcodes

Jump to

Keyboard shortcuts

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