Class AssignAction

java.lang.Object
ghidra.program.model.lang.protorules.AssignAction
Direct Known Subclasses:
ConsumeAs, ConsumeExtra, ConvertToPointer, GotoStack, HiddenReturnAssign, MultiMemberAssign, MultiSlotAssign, MultiSlotDualAssign

public abstract class AssignAction extends Object
An action that assigns an Address to a function prototype parameter A request for the address of either return storage or an input parameter is made through the assignAddress() method, which is given full information about the function prototype. Details about how the action performs is configured through the restoreXml() method.
  • Field Details

  • Constructor Details

  • Method Details

    • clone

      public abstract AssignAction clone(ParamListStandard newResource) throws InvalidInputException
      Make a copy of this action
      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 abstract boolean isEquivalent(AssignAction op)
      Test if the given action is configured and performs identically to this
      Parameters:
      op - is the given action
      Returns:
      true if the two actions are equivalent
    • assignAddress

      public abstract int assignAddress(DataType dt, PrototypePieces proto, int pos, DataTypeManager dtManager, int[] status, ParameterPieces res)
      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
      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 abstract void encode(Encoder encoder) throws IOException
      Save this action and its configuration to a stream
      Parameters:
      encoder - is the stream encoder
      Throws:
      IOException - for problems writing to the stream
    • restoreXml

      public abstract void restoreXml(XmlPullParser parser) throws XmlParseException
      Configure any details of how this action should behave from the stream
      Parameters:
      parser - is the given stream decoder
      Throws:
      XmlParseException - is there are problems decoding the stream
    • restoreActionXml

      public static AssignAction restoreActionXml(XmlPullParser parser, ParamListStandard res) throws XmlParseException
      Read the next action element from the stream and return the new configured AssignAction object. If the next element is not an action, throw an exception.
      Parameters:
      parser - is the stream parser
      res - is the resource set for the new action
      Returns:
      the new action
      Throws:
      XmlParseException - for problems parsing the stream
    • restoreSideeffectXml

      public static AssignAction restoreSideeffectXml(XmlPullParser parser, ParamListStandard res) throws XmlParseException
      Read the next sideeffect element from the stream and return the new configured AssignAction object. If the next element is not a sideeffect, throw an exception.
      Parameters:
      parser - is the stream parser
      res - is the resource set for the new sideeffect
      Returns:
      the new sideeffect
      Throws:
      XmlParseException - for problems parsing the stream