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.

  • Constructor Details

    • AuxPcodeEmulator

      public AuxPcodeEmulator(Language language)
      Create a new emulator
      Parameters:
      language - the language (processor model)
  • Method Details

    • getPartsFactory

      protected abstract AuxEmulatorPartsFactory<U> getPartsFactory()
      Get the factory that manufactures parts for this emulator
      Returns:
      the factory
    • createArithmetic

      protected PcodeArithmetic<org.apache.commons.lang3.tuple.Pair<byte[],U>> createArithmetic()
      Description copied from class: AbstractPcodeMachine
      A factory method to create the arithmetic used by this machine
      Specified by:
      createArithmetic in class AbstractPcodeMachine<org.apache.commons.lang3.tuple.Pair<byte[],U>>
      Returns:
      the arithmetic
    • createUseropLibrary

      protected PcodeUseropLibrary<org.apache.commons.lang3.tuple.Pair<byte[],U>> 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 class AbstractPcodeMachine<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 source

      Because 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 class AbstractPcodeMachine<org.apache.commons.lang3.tuple.Pair<byte[],U>>
      Returns:
      the stub library for all threads
    • createSharedState

      protected PcodeExecutorState<org.apache.commons.lang3.tuple.Pair<byte[],U>> createSharedState()
      Description copied from class: AbstractPcodeMachine
      A factory method to create the (memory) state shared by all threads in this machine
      Specified by:
      createSharedState in class AbstractPcodeMachine<org.apache.commons.lang3.tuple.Pair<byte[],U>>
      Returns:
      the shared state
    • 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 class AbstractPcodeMachine<org.apache.commons.lang3.tuple.Pair<byte[],U>>
      Parameters:
      thread - the thread
      Returns:
      the thread-local state
    • createThread

      protected PcodeThread<org.apache.commons.lang3.tuple.Pair<byte[],U>> createThread(String name)
      Description copied from class: AbstractPcodeMachine
      A factory method to create a new thread in this machine
      Overrides:
      createThread in class AbstractPcodeMachine<org.apache.commons.lang3.tuple.Pair<byte[],U>>
      Parameters:
      name - the name of the new thread
      Returns:
      the new thread
      See Also: