Class EndInstructionValueSolver
- java.lang.Object
-
- ghidra.app.plugin.assembler.sleigh.expr.AbstractExpressionSolver<EndInstructionValue>
-
- ghidra.app.plugin.assembler.sleigh.expr.EndInstructionValueSolver
-
public class EndInstructionValueSolver extends AbstractExpressionSolver<EndInstructionValue>
"Solves" expressions ofinst_nextWorks like the constant solver, but takes the value ofinst_next, which is given by the assembly address and the resulting instruction length. NOTE: This solver requires backfill.
-
-
Field Summary
-
Fields inherited from class ghidra.app.plugin.assembler.sleigh.expr.AbstractExpressionSolver
dbg, solver
-
-
Constructor Summary
Constructors Constructor Description EndInstructionValueSolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetInstructionLength(EndInstructionValue iv, java.util.Map<java.lang.Integer,java.lang.Object> res)Determines the length of the subconstructor that would be returned had the expression not depended on an undefined symbol.MaskedLonggetValue(EndInstructionValue iv, java.util.Map<java.lang.String,java.lang.Long> vals, java.util.Map<java.lang.Integer,java.lang.Object> res, AssemblyResolvedConstructor cur)Attempt to get a constant value for the expressionAssemblyResolutionsolve(EndInstructionValue iv, MaskedLong goal, java.util.Map<java.lang.String,java.lang.Long> vals, java.util.Map<java.lang.Integer,java.lang.Object> res, AssemblyResolvedConstructor cur, java.util.Set<SolverHint> hints, java.lang.String description)Attempt to solve an expression for a given valueMaskedLongvalueForResolution(EndInstructionValue exp, AssemblyResolvedConstructor rc)Compute the value of the expression given the (possibly-intermediate) resolution-
Methods inherited from class ghidra.app.plugin.assembler.sleigh.expr.AbstractExpressionSolver
register
-
-
-
-
Method Detail
-
solve
public AssemblyResolution solve(EndInstructionValue iv, MaskedLong goal, java.util.Map<java.lang.String,java.lang.Long> vals, java.util.Map<java.lang.Integer,java.lang.Object> res, AssemblyResolvedConstructor cur, java.util.Set<SolverHint> hints, java.lang.String description)
Description copied from class:AbstractExpressionSolverAttempt to solve an expression for a given value- Specified by:
solvein classAbstractExpressionSolver<EndInstructionValue>- Parameters:
iv- the expression to solvegoal- the desired value of the expressionvals- values of defined symbolsres- the results of subconstructor resolutions (used for lengths)hints- describes techniques applied by calling solversdescription- the description to give to resolved solutions- Returns:
- the resolution
-
getValue
public MaskedLong getValue(EndInstructionValue iv, java.util.Map<java.lang.String,java.lang.Long> vals, java.util.Map<java.lang.Integer,java.lang.Object> res, AssemblyResolvedConstructor cur) throws NeedsBackfillException
Description copied from class:AbstractExpressionSolverAttempt to get a constant value for the expression- Specified by:
getValuein classAbstractExpressionSolver<EndInstructionValue>- Parameters:
iv- the expressionvals- values of defined symbolsres- the results of subconstructor resolutions (used for lengths)- Returns:
- the constant value, or null if it depends on a variable
- Throws:
NeedsBackfillException- if the expression refers to an undefined symbol
-
getInstructionLength
public int getInstructionLength(EndInstructionValue iv, java.util.Map<java.lang.Integer,java.lang.Object> res)
Description copied from class:AbstractExpressionSolverDetermines the length of the subconstructor that would be returned had the expression not depended on an undefined symbol. This is used by the backfilling process to ensure values are written to the correct offset- Specified by:
getInstructionLengthin classAbstractExpressionSolver<EndInstructionValue>- Parameters:
iv- the expressionres- the results of subconstructor resolutions (used for lengths)- Returns:
- the length of filled in token field(s).
-
valueForResolution
public MaskedLong valueForResolution(EndInstructionValue exp, AssemblyResolvedConstructor rc)
Description copied from class:AbstractExpressionSolverCompute the value of the expression given the (possibly-intermediate) resolution- Specified by:
valueForResolutionin classAbstractExpressionSolver<EndInstructionValue>- Parameters:
exp- the expression to evaluaterc- the resolution on which to evaluate it- Returns:
- the result
-
-