Package ghidra.pcode.exec

# Class AnnotatedPcodeUseropLibrary<T>

java.lang.Object
ghidra.pcode.exec.AnnotatedPcodeUseropLibrary<T>

Type Parameters:
  `T` - the type of data processed by the library

All Implemented Interfaces:
  `PcodeUseropLibrary<T>`

Direct Known Subclasses:
  `AdaptedEmulator.AdaptedPcodeUseropLibrary`, `AnnotatedEmuSyscallUseropLibrary`, `DecoderUseropLibrary`, `DefaultPcodeThread.PcodeEmulationLibrary`, `PcodeExpression.ValueCapturingPcodeUseropLibrary`, `TaintPcodeUseropLibrary`

public abstract class AnnotatedPcodeUseropLibrary<T> extends Object implements PcodeUseropLibrary<T>
A userop library wherein Java methods are exported via a special annotation

See `StandAloneEmuExampleScript` for an example of implementing a userop library.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `protected static class`
  `AnnotatedPcodeUseropLibrary.AnnotatedPcodeUseropDefinition<T>`
  A wrapped, annotated Java method, exported as a userop definition
  `protected static class`
  `AnnotatedPcodeUseropLibrary.FixedArgsAnnotatedPcodeUseropDefinition<T>`
  An annotated userop with a fixed number of arguments
  `static @interface`
  `AnnotatedPcodeUseropLibrary.OpExecutor`
  An annotation to receive the executor itself into a parameter
  `static @interface`
  `AnnotatedPcodeUseropLibrary.OpLibrary`
  An annotation to receive the complete library into a parameter
  `static @interface`
  `AnnotatedPcodeUseropLibrary.OpOutput`
  An annotation to receive the output varnode into a parameter
  `static @interface`
  `AnnotatedPcodeUseropLibrary.OpState`
  An annotation to receive the executor's state into a parameter
  `static @interface`
  `AnnotatedPcodeUseropLibrary.PcodeUserop`
  An annotation to export a Java method as a userop in the library.
  `protected static class`
  `AnnotatedPcodeUseropLibrary.VariadicAnnotatedPcodeUseropDefinition<T>`
  An annotated userop with a variable number of arguments

  ## Nested classes/interfaces inherited from interface ghidra.pcode.exec.PcodeUseropLibrary

  `PcodeUseropLibrary.EmptyPcodeUseropLibrary, PcodeUseropLibrary.PcodeUseropDefinition<T>`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected Map<String,PcodeUseropLibrary.PcodeUseropDefinition<T>>`
  `ops`

  ### Fields inherited from interface ghidra.pcode.exec.PcodeUseropLibrary

  `NIL`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AnnotatedPcodeUseropLibrary()`
  Default constructor, usually invoked implicitly

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected MethodHandles.Lookup`
  `getMethodLookup()`
  An override to provide method access, if any non-public method is exported as a userop.
  `protected Type`
  `getOperandType()`
  Determine the operand type by examining the type substituted for `T`
  `Map<String,PcodeUseropLibrary.PcodeUseropDefinition<T>>`
  `getUserops()`
  Get all the userops defined in this library, keyed by (symbol) name.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface ghidra.pcode.exec.PcodeUseropLibrary

  `compose, getSymbols`

- ## Field Details

  - ### ops

    protected Map<String,PcodeUseropLibrary.PcodeUseropDefinition<T>> ops

- ## Constructor Details

  - ### AnnotatedPcodeUseropLibrary

    public AnnotatedPcodeUseropLibrary()
    Default constructor, usually invoked implicitly

- ## Method Details

  - ### getOperandType

    protected Type getOperandType()
    Determine the operand type by examining the type substituted for `T`
    Returns:
      the type of data processed by the userop

  - ### getMethodLookup

    protected MethodHandles.Lookup getMethodLookup()
    An override to provide method access, if any non-public method is exported as a userop.
    Returns:
      a lookup that can access all `AnnotatedPcodeUseropLibrary.PcodeUserop`-annotated methods.

  - ### getUserops

    public Map<String,PcodeUseropLibrary.PcodeUseropDefinition<T>> getUserops()
    Description copied from interface: `PcodeUseropLibrary`
    Get all the userops defined in this library, keyed by (symbol) name.
    Specified by:
      `getUserops` in interface `PcodeUseropLibrary<T>`
    Returns:
      the map of names to defined userops