mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 02:09:44 +02:00
New flag for dynamic STORE test
This commit is contained in:
parent
b6b9b27128
commit
cb39d39a23
11 changed files with 67 additions and 88 deletions
|
@ -62,7 +62,7 @@ class PcodeOp {
|
|||
friend class VarnodeBank; // Only uses setInput
|
||||
public:
|
||||
/// Boolean attributes (flags) that can be placed on a PcodeOp. Even though this enum is public, these are
|
||||
/// all set and read internally, although many are read publically via \e get or \e is methods.
|
||||
/// all set and read internally, although many are read publicly via \e get or \e is methods.
|
||||
enum {
|
||||
startbasic = 1, ///< This instruction starts a basic block
|
||||
branch = 2, ///< This instruction is a branch
|
||||
|
@ -73,38 +73,39 @@ public:
|
|||
marker = 0x40, ///< special placeholder op (multiequal or indirect)
|
||||
///< or CPUI_COPY between different copies
|
||||
///< of same variable
|
||||
booloutput = 0x80, ///< Boolean operation
|
||||
boolean_flip = 0x100, ///< Set if condition must be false to take branch
|
||||
fallthru_true = 0x200, ///< Set if fallthru happens on true condition
|
||||
indirect_source = 0x400, ///< Op is source of (one or more) CPUI_INDIRECTs
|
||||
coderef = 0x800, ///< The first parameter to this op is a coderef
|
||||
startmark = 0x1000, ///< This op is the first in its instruction
|
||||
mark = 0x2000, ///< Used by many algorithms that need to detect loops or avoid repeats
|
||||
commutative = 0x4000, ///< Order of input parameters does not matter
|
||||
unary = 0x8000, ///< Evaluate as unary expression
|
||||
binary = 0x10000, ///< Evaluate as binary expression
|
||||
special = 0x20000, ///< Cannot be evaluated (without special processing)
|
||||
floatingpoint = 0x40000, ///< A floating point operation
|
||||
splittingbranch = 0x80000, ///< Dead edge cannot be removed as it splits
|
||||
nonprinting = 0x100000, ///< Op should not be directly printed as source
|
||||
halt = 0x200000, ///< instruction causes processor or process to halt
|
||||
badinstruction = 0x400000, ///< placeholder for bad instruction data
|
||||
unimplemented = 0x800000, ///< placeholder for unimplemented instruction
|
||||
noreturn = 0x1000000, ///< placeholder for previous call that doesn't exit
|
||||
missing = 0x2000000, ///< ops at this address were not generated
|
||||
warning = 0x4000000, ///< Warning has been generated for this op
|
||||
booloutput = 0x80, ///< Boolean operation
|
||||
boolean_flip = 0x100, ///< Set if condition must be false to take branch
|
||||
fallthru_true = 0x200, ///< Set if fallthru happens on true condition
|
||||
indirect_source = 0x400, ///< Op is source of (one or more) CPUI_INDIRECTs
|
||||
coderef = 0x800, ///< The first parameter to this op is a coderef
|
||||
startmark = 0x1000, ///< This op is the first in its instruction
|
||||
mark = 0x2000, ///< Used by many algorithms that need to detect loops or avoid repeats
|
||||
commutative = 0x4000, ///< Order of input parameters does not matter
|
||||
unary = 0x8000, ///< Evaluate as unary expression
|
||||
binary = 0x10000, ///< Evaluate as binary expression
|
||||
special = 0x20000, ///< Cannot be evaluated (without special processing)
|
||||
floatingpoint = 0x40000, ///< A floating point operation
|
||||
splittingbranch = 0x80000, ///< Dead edge cannot be removed as it splits
|
||||
nonprinting = 0x100000, ///< Op should not be directly printed as source
|
||||
halt = 0x200000, ///< instruction causes processor or process to halt
|
||||
badinstruction = 0x400000, ///< placeholder for bad instruction data
|
||||
unimplemented = 0x800000, ///< placeholder for unimplemented instruction
|
||||
noreturn = 0x1000000, ///< placeholder for previous call that doesn't exit
|
||||
missing = 0x2000000, ///< ops at this address were not generated
|
||||
spacebase_ptr = 0x4000000, ///< Loads or stores from a dynamic pointer into a spacebase
|
||||
indirect_creation = 0x8000000, ///< Output varnode is created by indirect effect
|
||||
calculated_bool = 0x10000000, ///< Output has been determined to be a 1-bit boolean value
|
||||
is_cpool_transformed = 0x20000000, ///< Have we checked for cpool transforms
|
||||
ptrflow = 0x40000000, ///< Op consumes or produces a ptr
|
||||
special_print = 0x80000000 ///< Op is marked for special printing
|
||||
ptrflow = 0x40000000 ///< Op consumes or produces a ptr
|
||||
};
|
||||
enum {
|
||||
has_thisptr = 0x1, ///< First parameter ( getIn(1) ) is a this pointer
|
||||
is_constructor = 0x2, ///< Op is call to a constructor
|
||||
is_destructor = 0x4, ///< Op is call to a destructor
|
||||
special_prop = 0x8, ///< Does some special form of datatype propagation
|
||||
modified = 0x10 ///< This op has been modified by the current action
|
||||
special_print = 0x10, ///< Op is marked for special printing
|
||||
modified = 0x20, ///< This op has been modified by the current action
|
||||
warning = 0x40 ///< Warning has been generated for this op
|
||||
};
|
||||
private:
|
||||
TypeOp *opcode; ///< Pointer to class providing behavioral details of the operation
|
||||
|
@ -119,6 +120,7 @@ private:
|
|||
vector<Varnode *> inrefs; ///< The ordered list of input Varnodes for this op
|
||||
|
||||
// Only used by Funcdata
|
||||
void setOpcode(TypeOp *t_op); ///< Set the opcode for this PcodeOp
|
||||
void setOutput(Varnode *vn) { output = vn; } ///< Set the output Varnode of this op
|
||||
void clearInput(int4 slot) { inrefs[slot] = (Varnode *)0; } ///< Clear a specific input Varnode to \e null
|
||||
void setInput(Varnode *vn,int4 slot) { inrefs[slot] = vn; } ///< Set a specific input Varnode
|
||||
|
@ -180,7 +182,7 @@ public:
|
|||
bool isModified(void) const { return ((addlflags&PcodeOp::modified)!=0); } ///< Return \b true if this is modified by the current action
|
||||
bool isMark(void) const { return ((flags&PcodeOp::mark)!=0); } ///< Return \b true if this op has been marked
|
||||
void setMark(void) const { flags |= PcodeOp::mark; } ///< Set the mark on this op
|
||||
bool isWarning(void) const { return ((flags&PcodeOp::warning)!=0); } ///< Return \b true if a warning has been generated for this op
|
||||
bool isWarning(void) const { return ((addlflags&PcodeOp::warning)!=0); } ///< Return \b true if a warning has been generated for this op
|
||||
void clearMark(void) const { flags &= ~PcodeOp::mark; } ///< Clear any mark on this op
|
||||
bool isIndirectSource(void) const { return ((flags&PcodeOp::indirect_source)!=0); } ///< Return \b true if this causes an INDIRECT
|
||||
void setIndirectSource(void) { flags |= PcodeOp::indirect_source; } ///< Mark this op as source of INDIRECT
|
||||
|
@ -189,7 +191,7 @@ public:
|
|||
void setPtrFlow(void) { flags |= PcodeOp::ptrflow; } ///< Mark this op as consuming/producing ptrs
|
||||
bool isSplitting(void) const { return ((flags&PcodeOp::splittingbranch)!=0); } ///< Return \b true if this branch splits
|
||||
bool doesSpecialPropagation(void) const { return ((addlflags&PcodeOp::special_prop)!=0); } ///< Return \b true if this does datatype propagation
|
||||
bool doesSpecialPrinting(void) const { return ((flags&PcodeOp::special_print)!=0); } ///< Return \b true if this needs to special printing
|
||||
bool doesSpecialPrinting(void) const { return ((addlflags&PcodeOp::special_print)!=0); } ///< Return \b true if this needs to special printing
|
||||
bool hasThisPointer(void) const { return ((addlflags&PcodeOp::has_thisptr)!=0); } ///< Return \b true if this is a call taking 'this' parameter
|
||||
bool isConstructor(void) const { return ((addlflags&PcodeOp::is_constructor)!=0); } ///< Return \b true if this is call to a constructor
|
||||
bool isDestructor(void) const { return ((addlflags&PcodeOp::is_destructor)!=0); } ///< Return \b true if this is call to a destructor
|
||||
|
@ -198,9 +200,10 @@ public:
|
|||
/// \brief Return \b true if we have already examined this cpool
|
||||
bool isCpoolTransformed(void) const { return ((flags&PcodeOp::is_cpool_transformed)!=0); }
|
||||
bool isCollapsible(void) const; ///< Return \b true if this can be collapsed to a COPY of a constant
|
||||
/// \brief Return \b true if this LOADs or STOREs from a dynamic \e spacebase pointer
|
||||
bool usesSpacebasePtr(void) const { return ((flags&PcodeOp::spacebase_ptr)!=0); }
|
||||
uintm getCseHash(void) const; ///< Return hash indicating possibility of common subexpression elimination
|
||||
bool isCseMatch(const PcodeOp *op) const; ///< Return \b true if this and \e op represent common subexpressions
|
||||
void setOpcode(TypeOp *t_op); ///< Set the opcode for this PcodeOp
|
||||
TypeOp *getOpcode(void) const { return opcode; } ///< Get the opcode for this op
|
||||
OpCode code(void) const { return opcode->getOpcode(); } ///< Get the opcode id (enum) for this op
|
||||
bool isCommutative(void) const { return ((flags & PcodeOp::commutative)!=0); } ///< Return \b true if inputs commute
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue