mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 02:39:44 +02:00
Merge remote-tracking branch 'origin/GP-2006_DynamicHashCompare'
This commit is contained in:
commit
357ff97cb3
3 changed files with 15 additions and 9 deletions
|
@ -393,7 +393,7 @@ void DynamicHash::uniqueHash(const Varnode *root,Funcdata *fd)
|
|||
Varnode *tmpvn = vnlist[i];
|
||||
clear();
|
||||
calcHash(tmpvn,method);
|
||||
if (hash == tmphash) { // Hash collision
|
||||
if (getComparable(hash) == getComparable(tmphash)) { // Hash collision
|
||||
vnlist2.push_back(tmpvn);
|
||||
if (vnlist2.size()>maxduplicates) break;
|
||||
}
|
||||
|
@ -449,7 +449,7 @@ void DynamicHash::uniqueHash(const PcodeOp *op,int4 slot,Funcdata *fd)
|
|||
if (slot >= tmpop->numInput()) continue;
|
||||
clear();
|
||||
calcHash(tmpop,slot,method);
|
||||
if (hash == tmphash) { // Hash collision
|
||||
if (getComparable(hash) == getComparable(tmphash)) { // Hash collision
|
||||
oplist2.push_back(tmpop);
|
||||
if (oplist2.size()>maxduplicates)
|
||||
break;
|
||||
|
@ -508,7 +508,7 @@ Varnode *DynamicHash::findVarnode(const Funcdata *fd,const Address &addr,uint8 h
|
|||
Varnode *tmpvn = vnlist[i];
|
||||
clear();
|
||||
calcHash(tmpvn,method);
|
||||
if (hash == h)
|
||||
if (getComparable(hash) == getComparable(h))
|
||||
vnlist2.push_back(tmpvn);
|
||||
}
|
||||
if (total != vnlist2.size()) return (Varnode *)0;
|
||||
|
@ -542,7 +542,7 @@ PcodeOp *DynamicHash::findOp(const Funcdata *fd,const Address &addr,uint8 h)
|
|||
if (slot >= tmpop->numInput()) continue;
|
||||
clear();
|
||||
calcHash(tmpop,slot,method);
|
||||
if (hash == h)
|
||||
if (getComparable(hash) == getComparable(h))
|
||||
oplist2.push_back(tmpop);
|
||||
}
|
||||
if (total != oplist2.size())
|
||||
|
|
|
@ -96,6 +96,7 @@ public:
|
|||
static uint4 getTotalFromHash(uint8 h); ///< Retrieve the encoded collision total from a hash
|
||||
static bool getIsNotAttached(uint8 h); ///< Retrieve the attachment boolean from a hash
|
||||
static void clearTotalPosition(uint8 &h); ///< Clear the collision total and position fields within a hash
|
||||
static uint4 getComparable(uint8 h) { return (uint4)h; } ///< Get only the formal hash for comparing
|
||||
static uint4 transtable[]; ///< Translation of op-codes to hash values
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue