mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 10:19:23 +02:00
GP-2024 Fix for formatting test
This commit is contained in:
parent
fafbaacd5f
commit
c88f59a5ed
5 changed files with 13 additions and 8 deletions
|
@ -1699,19 +1699,20 @@ Symbol *Scope::addDynamicSymbol(const string &nm,Datatype *ct,const Address &cad
|
||||||
return sym;
|
return sym;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// \brief Create a symbol that forces a constant display conversion
|
/// \brief Create a symbol that forces display conversion on a constant
|
||||||
///
|
///
|
||||||
/// \param format is the type of conversion (Symbol::force_hex, Symbol::force_dec, etc.)
|
/// \param nm is the equate name to display, which may be empty for an integer conversion
|
||||||
|
/// \param format is the type of integer conversion (Symbol::force_hex, Symbol::force_dec, etc.)
|
||||||
/// \param value is the constant value being converted
|
/// \param value is the constant value being converted
|
||||||
/// \param addr is the address of the p-code op reading the constant
|
/// \param addr is the address of the p-code op reading the constant
|
||||||
/// \param hash is the dynamic hash identifying the constant
|
/// \param hash is the dynamic hash identifying the constant
|
||||||
/// \return the new EquateSymbol
|
/// \return the new EquateSymbol
|
||||||
Symbol *Scope::addConvertSymbol(uint4 format,uintb value,Address &addr,uint8 hash)
|
Symbol *Scope::addEquateSymbol(const string &nm,uint4 format,uintb value,const Address &addr,uint8 hash)
|
||||||
|
|
||||||
{
|
{
|
||||||
Symbol *sym;
|
Symbol *sym;
|
||||||
|
|
||||||
sym = new EquateSymbol(owner,"",format,value);
|
sym = new EquateSymbol(owner,nm,format,value);
|
||||||
addSymbolInternal(sym);
|
addSymbolInternal(sym);
|
||||||
RangeList rnglist;
|
RangeList rnglist;
|
||||||
if (!addr.isInvalid())
|
if (!addr.isInvalid())
|
||||||
|
|
|
@ -727,7 +727,7 @@ public:
|
||||||
ExternRefSymbol *addExternalRef(const Address &addr,const Address &refaddr,const string &nm);
|
ExternRefSymbol *addExternalRef(const Address &addr,const Address &refaddr,const string &nm);
|
||||||
LabSymbol *addCodeLabel(const Address &addr,const string &nm);
|
LabSymbol *addCodeLabel(const Address &addr,const string &nm);
|
||||||
Symbol *addDynamicSymbol(const string &nm,Datatype *ct,const Address &caddr,uint8 hash);
|
Symbol *addDynamicSymbol(const string &nm,Datatype *ct,const Address &caddr,uint8 hash);
|
||||||
Symbol *addConvertSymbol(uint4 format,uintb value,Address &addr,uint8 hash);
|
Symbol *addEquateSymbol(const string &nm,uint4 format,uintb value,const Address &addr,uint8 hash);
|
||||||
string buildDefaultName(Symbol *sym,int4 &base,Varnode *vn) const; ///< Create a default name for the given Symbol
|
string buildDefaultName(Symbol *sym,int4 &base,Varnode *vn) const; ///< Create a default name for the given Symbol
|
||||||
bool isReadOnly(const Address &addr,int4 size,const Address &usepoint) const;
|
bool isReadOnly(const Address &addr,int4 size,const Address &usepoint) const;
|
||||||
void printBounds(ostream &s) const { rangetree.printBounds(s); } ///< Print a description of \b this Scope's \e owned memory ranges
|
void printBounds(ostream &s) const { rangetree.printBounds(s); } ///< Print a description of \b this Scope's \e owned memory ranges
|
||||||
|
|
|
@ -1198,7 +1198,11 @@ void Funcdata::buildDynamicSymbol(Varnode *vn)
|
||||||
if (dhash.getHash() == 0)
|
if (dhash.getHash() == 0)
|
||||||
throw RecovError("Unable to find unique hash for varnode");
|
throw RecovError("Unable to find unique hash for varnode");
|
||||||
|
|
||||||
Symbol *sym = localmap->addDynamicSymbol("",high->getType(),dhash.getAddress(),dhash.getHash());
|
Symbol *sym;
|
||||||
|
if (vn->isConstant())
|
||||||
|
sym = localmap->addEquateSymbol("",Symbol::force_hex, vn->getOffset(), dhash.getAddress(), dhash.getHash());
|
||||||
|
else
|
||||||
|
sym = localmap->addDynamicSymbol("",high->getType(),dhash.getAddress(),dhash.getHash());
|
||||||
vn->setSymbolEntry(sym->getFirstWholeMap());
|
vn->setSymbolEntry(sym->getFirstWholeMap());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -708,7 +708,7 @@ void IfcMapconvert::execute(istream &s)
|
||||||
|
|
||||||
s >> hex >> hash; // Parse the hash value
|
s >> hex >> hash; // Parse the hash value
|
||||||
|
|
||||||
dcp->fd->getScopeLocal()->addConvertSymbol(format, value, addr, hash);
|
dcp->fd->getScopeLocal()->addEquateSymbol("", format, value, addr, hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// \class IfcPrintdisasm
|
/// \class IfcPrintdisasm
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
<com>map addr r0x301020 octint4 globalbin</com>
|
<com>map addr r0x301020 octint4 globalbin</com>
|
||||||
<com>lo fu setglobals</com>
|
<com>lo fu setglobals</com>
|
||||||
<com>decompile</com>
|
<com>decompile</com>
|
||||||
<com>force varnode #0xaa(0x100625:0x12) bin</com>
|
<com>force varnode #0xaa(0x100619:7) bin</com>
|
||||||
<com>print C</com>
|
<com>print C</com>
|
||||||
<com>quit</com>
|
<com>quit</com>
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue