mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-06 03:50:02 +02:00
GP-3067: Changes in anticipation of GP-2038.
This commit is contained in:
parent
9014d10edf
commit
b8e1808cb8
7 changed files with 44 additions and 36 deletions
|
@ -187,12 +187,12 @@ public abstract class AbstractVarnodeEvaluator<T> implements VarnodeEvaluator<T>
|
|||
/**
|
||||
* Evaluate variable storage, providing an "identity" value
|
||||
*
|
||||
* @param program the program containing the variable storage
|
||||
* @param storage the storage to evaluate
|
||||
* @param identity the value if storage had no varnodes
|
||||
* @return the value of the storage
|
||||
*/
|
||||
protected T evaluateStorage(VariableStorage storage, T identity) {
|
||||
Program program = storage.getProgram();
|
||||
protected T evaluateStorage(Program program, VariableStorage storage, T identity) {
|
||||
int total = storage.size();
|
||||
T value = identity;
|
||||
for (Varnode vn : storage.getVarnodes()) {
|
||||
|
|
|
@ -17,7 +17,7 @@ package ghidra.pcode.eval;
|
|||
|
||||
import java.util.Map;
|
||||
|
||||
import ghidra.pcode.exec.*;
|
||||
import ghidra.pcode.exec.PcodeArithmetic;
|
||||
import ghidra.pcode.exec.PcodeArithmetic.Purpose;
|
||||
import ghidra.pcode.opbehavior.BinaryOpBehavior;
|
||||
import ghidra.pcode.opbehavior.UnaryOpBehavior;
|
||||
|
@ -75,8 +75,8 @@ public abstract class ArithmeticVarnodeEvaluator<T> extends AbstractVarnodeEvalu
|
|||
}
|
||||
|
||||
@Override
|
||||
public T evaluateStorage(VariableStorage storage) {
|
||||
return evaluateStorage(storage, arithmetic.fromConst(0, storage.size()));
|
||||
public T evaluateStorage(Program program, VariableStorage storage) {
|
||||
return evaluateStorage(program, storage, arithmetic.fromConst(0, storage.size()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -50,10 +50,11 @@ public interface VarnodeEvaluator<T> {
|
|||
* concatenated. The lower-indexed varnodes in storage are the more significant pieces, similar
|
||||
* to big endian.
|
||||
*
|
||||
* @param program the program containing the variable storage
|
||||
* @param storage the storage
|
||||
* @return the value of the storage
|
||||
*/
|
||||
T evaluateStorage(VariableStorage storage);
|
||||
T evaluateStorage(Program program, VariableStorage storage);
|
||||
|
||||
/**
|
||||
* Evaluate a high p-code op
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue