Package ghidra.pcode.emu.auxiliary
Class AuxPcodeEmulator<U>
java.lang.Object
ghidra.pcode.emu.AbstractPcodeMachine<org.apache.commons.lang3.tuple.Pair<byte[],U>>
ghidra.pcode.emu.auxiliary.AuxPcodeEmulator<U>
- Type Parameters:
U
- the type of auxiliary values
- All Implemented Interfaces:
PcodeMachine<org.apache.commons.lang3.tuple.Pair<byte[],
U>>
public abstract class AuxPcodeEmulator<U>
extends AbstractPcodeMachine<org.apache.commons.lang3.tuple.Pair<byte[],U>>
A stand-alone emulator whose parts are manufactured by a
AuxEmulatorPartsFactory
See the parts factory interface: AuxEmulatorPartsFactory
. Also see the Taint Analyzer for
a complete solution based on this class.
-
Nested Class Summary
Nested classes/interfaces inherited from interface ghidra.pcode.emu.PcodeMachine
PcodeMachine.AccessKind, PcodeMachine.SwiMode
-
Field Summary
Fields inherited from class ghidra.pcode.emu.AbstractPcodeMachine
accessBreakpoints, arithmetic, injects, language, library, stubLibrary, suspended, swiMode, threads, threadsView
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected PcodeArithmetic
<org.apache.commons.lang3.tuple.Pair<byte[], U>> A factory method to create the arithmetic used by this machineprotected PcodeExecutorState
<org.apache.commons.lang3.tuple.Pair<byte[], U>> createLocalState
(PcodeThread<org.apache.commons.lang3.tuple.Pair<byte[], U>> thread) A factory method to create the (register) state local to the given threadprotected PcodeExecutorState
<org.apache.commons.lang3.tuple.Pair<byte[], U>> A factory method to create the (memory) state shared by all threads in this machineprotected PcodeThread
<org.apache.commons.lang3.tuple.Pair<byte[], U>> createThread
(String name) A factory method to create a new thread in this machineprotected PcodeUseropLibrary
<org.apache.commons.lang3.tuple.Pair<byte[], U>> A factory method to create a stub library for compiling thread-local Sleigh sourceprotected PcodeUseropLibrary
<org.apache.commons.lang3.tuple.Pair<byte[], U>> A factory method to create the userop library shared by all threads in this machineprotected abstract AuxEmulatorPartsFactory
<U> Get the factory that manufactures parts for this emulatorMethods inherited from class ghidra.pcode.emu.AbstractPcodeMachine
addAccessBreakpoint, addBreakpoint, assertSleigh, checkLoad, checkStore, clearAccessBreakpoints, clearAllInjects, clearInject, compileSleigh, doPluggableInitialization, getAllThreads, getArithmetic, getInject, getLanguage, getPluggableInitializer, getSharedState, getSoftwareInterruptMode, getStubUseropLibrary, getThread, getUseropLibrary, inject, isSuspended, newThread, newThread, setSoftwareInterruptMode, setSuspended, stepped, swi
-
Constructor Details
-
AuxPcodeEmulator
Create a new emulator- Parameters:
language
- the language (processor model)
-
-
Method Details
-
getPartsFactory
Get the factory that manufactures parts for this emulator- Returns:
- the factory
-
createArithmetic
Description copied from class:AbstractPcodeMachine
A factory method to create the arithmetic used by this machine- Specified by:
createArithmetic
in classAbstractPcodeMachine<org.apache.commons.lang3.tuple.Pair<byte[],
U>> - Returns:
- the arithmetic
-
createUseropLibrary
Description copied from class:AbstractPcodeMachine
A factory method to create the userop library shared by all threads in this machine- Specified by:
createUseropLibrary
in classAbstractPcodeMachine<org.apache.commons.lang3.tuple.Pair<byte[],
U>> - Returns:
- the library
-
createThreadStubLibrary
protected PcodeUseropLibrary<org.apache.commons.lang3.tuple.Pair<byte[],U>> createThreadStubLibrary()Description copied from class:AbstractPcodeMachine
A factory method to create a stub library for compiling thread-local Sleigh sourceBecause threads may introduce p-code userops using libraries unique to that thread, it becomes necessary to at least export stub symbols, so that p-code programs can be compiled from Sleigh source before the thread has necessarily been created. A side effect of this strategy is that all threads, though they may have independent libraries, must export identically-named symbols.
- Overrides:
createThreadStubLibrary
in classAbstractPcodeMachine<org.apache.commons.lang3.tuple.Pair<byte[],
U>> - Returns:
- the stub library for all threads
-
createLocalState
protected PcodeExecutorState<org.apache.commons.lang3.tuple.Pair<byte[],U>> createLocalState(PcodeThread<org.apache.commons.lang3.tuple.Pair<byte[], U>> thread) Description copied from class:AbstractPcodeMachine
A factory method to create the (register) state local to the given thread- Specified by:
createLocalState
in classAbstractPcodeMachine<org.apache.commons.lang3.tuple.Pair<byte[],
U>> - Parameters:
thread
- the thread- Returns:
- the thread-local state
-
createThread
Description copied from class:AbstractPcodeMachine
A factory method to create a new thread in this machine- Overrides:
createThread
in classAbstractPcodeMachine<org.apache.commons.lang3.tuple.Pair<byte[],
U>> - Parameters:
name
- the name of the new thread- Returns:
- the new thread
- See Also:
-