jumpengine

package
v0.0.0-...-9e3ea01 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package jumpengine provides jump engine detection and processing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JumpEngine

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

func New

func New(ar arch.Architecture) *JumpEngine

func (*JumpEngine) AddJumpEngine

func (j *JumpEngine) AddJumpEngine(address uint16)

AddJumpEngine adds a jump engine function address to the list of jump engines.

func (*JumpEngine) GetContextDataReferences

func (j *JumpEngine) GetContextDataReferences(dis arch.Disasm, offsets []*arch.Offset,
	addresses []uint16) ([]uint16, error)

GetContextDataReferences parse all instructions of the function context until the jump and returns data references that could point to the function table.

func (*JumpEngine) GetFunctionTableReference

func (j *JumpEngine) GetFunctionTableReference(context uint16, dataReferences []uint16)

GetFunctionTableReference detects a jump engine function context and its function table. TODO use jump address as key to be able to handle large function contexts containing multiple jump engines

func (*JumpEngine) HandleJumpEngineCallers

func (j *JumpEngine) HandleJumpEngineCallers(dis arch.Disasm, context uint16) error

HandleJumpEngineCallers processes all callers of a newly detected jump engine function.

func (*JumpEngine) HandleJumpEngineDestination

func (j *JumpEngine) HandleJumpEngineDestination(dis arch.Disasm, caller, destination uint16) error

HandleJumpEngineDestination processes a newly detected jump engine destination.

func (*JumpEngine) JumpContextInfo

func (j *JumpEngine) JumpContextInfo(dis arch.Disasm, jumpAddress uint16, offsetInfo *arch.Offset) ([]*arch.Offset, []uint16)

JumpContextInfo builds the list of instructions of the current function context. in some ROMs the jump engine can be part of a label inside a larger function, the jump engine detection will use the last instructions before the jmp.

func (*JumpEngine) ScanForNewJumpEngineEntry

func (j *JumpEngine) ScanForNewJumpEngineEntry(dis arch.Disasm) (bool, error)

ScanForNewJumpEngineEntry scans all jump engine calls for an unprocessed entry in the function address table that follows the call. It returns whether a new address to parse was added.

Jump to

Keyboard shortcuts

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