Package ghidra.program.model.lang
Class ParamEntry
java.lang.Object
ghidra.program.model.lang.ParamEntry
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
containedBy
(Address addr, int sz) Is this ParamEntry, as a memory range, contained by the given memory range.boolean
contains
(ParamEntry otherEntry) Does this ParamEntry contain another entry (as a subpiece)void
int
getAddrBySlot
(int slotnum, int sz, VarnodeData res) Return the storage address assigned when allocating something of size -sz- assuming -slotnum- slots have already been assigned.long
int
getAlign()
int[]
int
getGroup()
Varnode[]
getJoinPieces
(int sz) Collect pieces from the join list, in endian order, until the given size is covered.static int
getMetatype
(DataType tp) int
int
getSize()
int
Assuming the address is contained in this entry and we -skip- to a certain byte return the slot associated with that bytegetSpace()
int
getType()
boolean
intersects
(Address addr, int sz) Does this ParamEntry intersect the given range in some wayboolean
boolean
isEquivalent
(ParamEntry obj) Determine if this ParamEntry is equivalent to another instanceboolean
boolean
boolean
boolean
boolean
int
justifiedContain
(Address addr, int sz) static int
justifiedContainAddress
(AddressSpace spc1, long offset1, int sz1, AddressSpace spc2, long offset2, int sz2, boolean forceleft, boolean isBigEndian) Return -1 if (op2,sz2) is not properly contained in (op1,sz1) If it is contained, return the endian aware offset of (op2,sz2) I.e.static void
orderWithinGroup
(ParamEntry entry1, ParamEntry entry2) ParamEntry within a group must be distinguishable by size or by typevoid
restoreXml
(XmlPullParser parser, CompilerSpec cspec, List<ParamEntry> curList, boolean grouped)
-
Field Details
-
TYPE_UNKNOWN
public static final int TYPE_UNKNOWN- See Also:
-
TYPE_PTR
public static final int TYPE_PTR- See Also:
-
TYPE_FLOAT
public static final int TYPE_FLOAT- See Also:
-
-
Constructor Details
-
ParamEntry
public ParamEntry(int grp)
-
-
Method Details
-
getGroup
public int getGroup() -
getAllGroups
public int[] getAllGroups() -
getSize
public int getSize() -
getMinSize
public int getMinSize() -
getAlign
public int getAlign() -
getAddressBase
public long getAddressBase() -
getType
public int getType() -
isExclusion
public boolean isExclusion() -
isReverseStack
public boolean isReverseStack() -
isGrouped
public boolean isGrouped() -
isOverlap
public boolean isOverlap() -
isBigEndian
public boolean isBigEndian() -
isFloatExtended
public boolean isFloatExtended() -
getSpace
-
getJoinPieces
Collect pieces from the join list, in endian order, until the given size is covered. The last piece is trimmed to match the size exactly. If the size is too big to be covered by this ParamEntry, null is returned.- Parameters:
sz
- is the given size- Returns:
- the collected array of Varnodes or null
-
containedBy
Is this ParamEntry, as a memory range, contained by the given memory range.- Parameters:
addr
- is the starting address of the given memory rangesz
- is the number of bytes in the given memory range- Returns:
- true if this is contained
-
intersects
Does this ParamEntry intersect the given range in some way- Parameters:
addr
- is the starting address of the given rangesz
- is the number of bytes in the given range- Returns:
- true if there is an intersection
-
justifiedContain
-
contains
Does this ParamEntry contain another entry (as a subpiece)- Parameters:
otherEntry
- is the other entry- Returns:
- true if this contains the other entry
-
getSlot
Assuming the address is contained in this entry and we -skip- to a certain byte return the slot associated with that byte- Parameters:
addr
- is the address to check (which MUST be contained)skip
- is the number of bytes to skip- Returns:
- the slot index
-
getAddrBySlot
Return the storage address assigned when allocating something of size -sz- assuming -slotnum- slots have already been assigned. Set res.space to null if the -sz- is too small or if there are not enough slots left- Parameters:
slotnum
- number of slots already assignedsz
- number of bytes to being assignedres
- the final storage address- Returns:
- slotnum plus the number of slots used
-
encode
- Throws:
IOException
-
restoreXml
public void restoreXml(XmlPullParser parser, CompilerSpec cspec, List<ParamEntry> curList, boolean grouped) throws XmlParseException - Throws:
XmlParseException
-
isEquivalent
Determine if this ParamEntry is equivalent to another instance- Parameters:
obj
- is the other instance- Returns:
- true if they are equivalent
-
justifiedContainAddress
public static int justifiedContainAddress(AddressSpace spc1, long offset1, int sz1, AddressSpace spc2, long offset2, int sz2, boolean forceleft, boolean isBigEndian) Return -1 if (op2,sz2) is not properly contained in (op1,sz1) If it is contained, return the endian aware offset of (op2,sz2) I.e. if the least significant byte of the op2 range falls on the least significant byte of the op1 range, return 0. If it intersects the second least significant, return 1, etc.- Parameters:
spc1
- the first address spaceoffset1
- the first offsetsz1
- size of first spacespc2
- the second address spaceoffset2
- is the second offsetsz2
- size of second spaceforceleft
- is true if containment is forced to be on the left even for big endianisBigEndian
- true if big endian- Returns:
- the endian aware offset or -1
-
getMetatype
-
orderWithinGroup
ParamEntry within a group must be distinguishable by size or by type- Parameters:
entry1
- is the first being comparedentry2
- is the second being compared- Throws:
XmlParseException
- if the pair is not distinguishable
-