decompiler  1.0.0
Classes | Public Member Functions | Private Attributes | List of all members
ghidra::ScoreProtoModel Class Reference

Class for calculating "goodness of fit" of parameter trials against a prototype model. More...

#include <fspec.hh>

Classes

class  PEntry
 A record mapping trials to parameter entries in the prototype model. More...
 

Public Member Functions

 ScoreProtoModel (bool isinput, const ProtoModel *mod, int4 numparam)
 Constructor. More...
 
void addParameter (const Address &addr, int4 sz)
 Register a trial to be scored. More...
 
void doScore (void)
 Compute the fitness score.
 
int4 getScore (void) const
 Get the fitness score.
 
int4 getNumMismatch (void) const
 Get the number of mismatched trials.
 

Private Attributes

bool isinputscore
 True if scoring against input parameters, false for outputs.
 
vector< PEntryentry
 Map of parameter entries corresponding to trials.
 
const ProtoModelmodel
 Prototype model to score against.
 
int4 finalscore
 The final fitness score.
 
int4 mismatch
 Number of trials that don't fit the prototype model at all.
 

Detailed Description

Class for calculating "goodness of fit" of parameter trials against a prototype model.

The class is instantiated with a prototype model (ProtoModel). A set of Varnode parameter trials are registered by calling addParameter() for each trial. Then calling doScore() computes a score that evaluates how well the set of registered trials fit the prototype model. A lower score indicates a better fit.

Constructor & Destructor Documentation

◆ ScoreProtoModel()

ghidra::ScoreProtoModel::ScoreProtoModel ( bool  isinput,
const ProtoModel mod,
int4  numparam 
)

Constructor.

Parameters
isinputis set to true to compute scores against the input part of the model
modis the prototype model to score against
numparamis the presumed number of trials that will constitute the score

Member Function Documentation

◆ addParameter()

void ghidra::ScoreProtoModel::addParameter ( const Address addr,
int4  sz 
)

Register a trial to be scored.

Parameters
addris the starting address of the trial
szis the number of bytes in the trial

Referenced by ghidra::ProtoModelMerged::selectModel().


The documentation for this class was generated from the following files: