|
Ghidra 11.4.2
Ghidra internal decompiler documentation.
|
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. | |
| void | addParameter (const Address &addr, int4 sz) |
| Register a trial to be scored. | |
| 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 | ||
| ) |
| 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 |
References entry, finalscore, isinputscore, mismatch, and model.
| 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 |
References entry, isinputscore, mismatch, model, ghidra::ProtoModel::possibleInputParamWithSlot(), and ghidra::ProtoModel::possibleOutputParamWithSlot().
Referenced by ghidra::ProtoModelMerged::selectModel().