decompiler
1.0.0
|
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< PEntry > | entry |
Map of parameter entries corresponding to trials. | |
const ProtoModel * | model |
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. | |
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.
ghidra::ScoreProtoModel::ScoreProtoModel | ( | bool | isinput, |
const ProtoModel * | mod, | ||
int4 | numparam | ||
) |
Constructor.
isinput | is set to true to compute scores against the input part of the model |
mod | is the prototype model to score against |
numparam | is the presumed number of trials that will constitute the score |
void ghidra::ScoreProtoModel::addParameter | ( | const Address & | addr, |
int4 | sz | ||
) |
Register a trial to be scored.
addr | is the starting address of the trial |
sz | is the number of bytes in the trial |
Referenced by ghidra::ProtoModelMerged::selectModel().