mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 02:09:44 +02:00
Initial commit of new StringManager
This commit is contained in:
parent
6a15520aa5
commit
0eb48e441f
19 changed files with 740 additions and 236 deletions
|
@ -6409,14 +6409,8 @@ int4 RulePtrsubCharConstant::applyOp(PcodeOp *op,Funcdata &data)
|
|||
if (!scope->isReadOnly(symaddr,1,op->getAddr()))
|
||||
return 0;
|
||||
// Check if data at the address looks like a string
|
||||
uint1 buffer[128];
|
||||
try {
|
||||
data.getArch()->loader->loadFill(buffer,128,symaddr);
|
||||
} catch(DataUnavailError &err) {
|
||||
if (!data.getArch()->stringManager->isString(symaddr, basetype))
|
||||
return 0;
|
||||
}
|
||||
bool isstring = data.getArch()->print->isCharacterConstant(buffer,128,basetype->getSize());
|
||||
if (!isstring) return 0;
|
||||
|
||||
// If we reach here, the PTRSUB should be converted to a (COPY of a) pointer constant.
|
||||
bool removeCopy = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue