Documentation
¶
Overview ¶
Package jumpengine provides jump engine detection and processing.
Index ¶
- type JumpEngine
- func (j *JumpEngine) AddJumpEngine(address uint16)
- func (j *JumpEngine) GetContextDataReferences(dis arch.Disasm, offsets []*arch.Offset, addresses []uint16) ([]uint16, error)
- func (j *JumpEngine) GetFunctionTableReference(context uint16, dataReferences []uint16)
- func (j *JumpEngine) HandleJumpEngineCallers(dis arch.Disasm, context uint16) error
- func (j *JumpEngine) HandleJumpEngineDestination(dis arch.Disasm, caller, destination uint16) error
- func (j *JumpEngine) JumpContextInfo(dis arch.Disasm, jumpAddress uint16, offsetInfo *arch.Offset) ([]*arch.Offset, []uint16)
- func (j *JumpEngine) ScanForNewJumpEngineEntry(dis arch.Disasm) (bool, error)
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.