mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 10:49:34 +02:00
value set analysis
This commit is contained in:
parent
25894ff9ae
commit
e96f39a98f
10 changed files with 1853 additions and 460 deletions
|
@ -129,6 +129,7 @@ void IfaceDecompCapability::registerCommands(IfaceStatus *status)
|
|||
status->registerCom(new IfcVolatile(),"volatile");
|
||||
status->registerCom(new IfcPreferSplit(),"prefersplit");
|
||||
status->registerCom(new IfcStructureBlocks(),"structure","blocks");
|
||||
status->registerCom(new IfcAnalyzeRange(), "analyze","range");
|
||||
#ifdef CPUI_RULECOMPILE
|
||||
status->registerCom(new IfcParseRule(),"parse","rule");
|
||||
status->registerCom(new IfcExperimentalRules(),"experimental","rules");
|
||||
|
@ -2474,6 +2475,28 @@ void IfcCountPcode::execute(istream &s)
|
|||
*status->optr << "Count - pcode = " << dec << count << endl;
|
||||
}
|
||||
|
||||
void IfcAnalyzeRange::execute(istream &s)
|
||||
|
||||
{
|
||||
if (dcp->conf == (Architecture *)0)
|
||||
throw IfaceExecutionError("Image not loaded");
|
||||
if (dcp->fd == (Funcdata *)0)
|
||||
throw IfaceExecutionError("No function selected");
|
||||
|
||||
Varnode *vn = iface_read_varnode(dcp,s);
|
||||
vector<Varnode *> sinks;
|
||||
sinks.push_back(vn);
|
||||
Varnode *stackReg = dcp->fd->findSpacebaseInput(dcp->conf->getStackSpace());
|
||||
ValueSetSolver vsSolver;
|
||||
vsSolver.establishValueSets(sinks, stackReg);
|
||||
vsSolver.solve(10000);
|
||||
list<ValueSet>::const_iterator iter;
|
||||
for(iter=vsSolver.beginValueSets();iter!=vsSolver.endValueSets();++iter) {
|
||||
(*iter).printRaw(*status->optr);
|
||||
*status->optr << endl;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef OPACTION_DEBUG
|
||||
|
||||
void IfcDebugAction::execute(istream &s)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue