Class OverloadedSleighPcodeUseropDefinition<T>

java.lang.Object
ghidra.pcode.exec.AbstractSleighPcodeUseropDefinition<T>
ghidra.pcode.exec.OverloadedSleighPcodeUseropDefinition<T>
Type Parameters:
T - no type in particular, except to match any executor
All Implemented Interfaces:
PcodeUseropLibrary.PcodeUseropDefinition<T>, SleighPcodeUseropDefinition<T>

public class OverloadedSleighPcodeUseropDefinition<T> NEW extends AbstractSleighPcodeUseropDefinition<T>
A Sleigh userop definition with multiple signatures
  • Field Details

  • Constructor Details

  • Method Details

    • getInputCount

      public int getInputCount()
      Description copied from interface: PcodeUseropLibrary.PcodeUseropDefinition
      Get the number of input operands accepted by the userop.
      Returns:
      the count or -1 if the userop is variadic
    • getSignatureDef

      public SleighPcodeUseropDefinition.SignatureDef getSignatureDef(int argCount)
      Get the signature and definition for the given argument count
      Parameters:
      argCount - the argument (or parameter) count
      Returns:
      the definition, or null if not defined
    • getAllSignatures

      Get all the signatures and definitions for this userop
      Returns:
      the collection of definitions
    • getBody

      public String getBody(List<Varnode> args)
      Description copied from interface: SleighPcodeUseropDefinition
      Get the Sleigh source that defines this userop

      The body may or may not actually depend on the arguments. Ideally, it does not, but sometimes the body may vary depending on the sizes of the arguments. In cases where it is known the body is fixed, the args parameter may be null or an empty list. When the arguments are required, index 0 must be the output varnode. If the userop has no output, index 0 may be null.

      Parameters:
      args - the argument varnodes
      Returns:
      the body
    • programFor

      public PcodeProgram programFor(List<Varnode> args, PcodeUseropLibrary<?> library)
      Description copied from interface: SleighPcodeUseropDefinition
      Get the p-code program implementing this userop for the given arguments and library.

      This will compile and cache a program for each new combination of arguments seen.

      Parameters:
      args - the operands, output at index 0, and inputs following
      library - the complete userop library
      Returns:
      the p-code program to be fed to the same executor as invoked this userop, but in a new frame
    • getOutputType

      public Class<?> getOutputType()
      Description copied from interface: PcodeUseropLibrary.PcodeUseropDefinition
      If this userop is defined as a java callback, get the type of the output

      If the method has a @AnnotatedPcodeUseropLibrary.OpOutput annotation, this is the type of the output parameter. Otherwise, this is the method's return type.

      Returns:
      the output type