Class HiddenReturnAssign

java.lang.Object
ghidra.program.model.lang.protorules.AssignAction
ghidra.program.model.lang.protorules.HiddenReturnAssign

public class HiddenReturnAssign extends AssignAction
Allocate the return value as an input parameter A pointer to where the return value is to be stored is passed in as an input parameter. This action signals this by returning one of - HIDDENRET_PTRPARAM - indicating the pointer is allocated as a normal input parameter - HIDDENRET_SPECIALREG - indicating the pointer is passed in a dedicated register - HIDDENRET_SPECIALREG_VOID Usually, if a hidden return input is present, the normal register used for return will also hold the pointer at the point(s) where the function returns. A signal of HIDDENRET_SPECIALREG_VOID indicates the normal return register is not used to pass back the pointer.
  • Field Details

  • Constructor Details

  • Method Details

    • clone

      public AssignAction clone(ParamListStandard newResource) throws InvalidInputException
      Description copied from class: AssignAction
      Make a copy of this action
      Specified by:
      clone in class AssignAction
      Parameters:
      newResource - is the new resource object that will own the clone
      Returns:
      the newly allocated copy
      Throws:
      InvalidInputException - if required configuration is not present in new resource object
    • isEquivalent

      public boolean isEquivalent(AssignAction op)
      Description copied from class: AssignAction
      Test if the given action is configured and performs identically to this
      Specified by:
      isEquivalent in class AssignAction
      Parameters:
      op - is the given action
      Returns:
      true if the two actions are equivalent
    • assignAddress

      public int assignAddress(DataType dt, PrototypePieces proto, int pos, DataTypeManager dtManager, int[] status, ParameterPieces res)
      Description copied from class: AssignAction
      Assign an address and other meta-data for a specific parameter or for return storage in context The Address is assigned based on the data-type of the parameter, available register resources, and other details of the function prototype. Consumed resources are marked. This method returns a response code: - SUCCESS - indicating the Address was successfully assigned - FAIL - if the Address could not be assigned - HIDDENRET_PTRPARAM - if an additional hidden return parameter is required
      Specified by:
      assignAddress in class AssignAction
      Parameters:
      dt - is the data-type of the parameter or return value
      proto - is the high-level description of the function prototype
      pos - is the position of the parameter (pos>=0) or return storage (pos=-1)
      dtManager - is a data-type manager for (possibly) transforming the data-type
      status - is the resource consumption array
      res - will hold the resulting description of the parameter
      Returns:
      the response code
    • encode

      public void encode(Encoder encoder) throws IOException
      Description copied from class: AssignAction
      Save this action and its configuration to a stream
      Specified by:
      encode in class AssignAction
      Parameters:
      encoder - is the stream encoder
      Throws:
      IOException - for problems writing to the stream
    • restoreXml

      public void restoreXml(XmlPullParser parser) throws XmlParseException
      Description copied from class: AssignAction
      Configure any details of how this action should behave from the stream
      Specified by:
      restoreXml in class AssignAction
      Parameters:
      parser - is the given stream decoder
      Throws:
      XmlParseException - is there are problems decoding the stream