Class EndInstructionValueSolver
java.lang.Object
ghidra.app.plugin.assembler.sleigh.expr.AbstractExpressionSolver<EndInstructionValue>
ghidra.app.plugin.assembler.sleigh.expr.EndInstructionValueSolver
"Solves" expressions of
inst_next
Works like the constant solver, but takes the value of inst_next
, which is given by the
assembly address and the resulting instruction length.
NOTE: This solver requires backfill, since the value of inst_next
is not known
until possible prefixes have been considered.
-
Field Summary
Fields inherited from class ghidra.app.plugin.assembler.sleigh.expr.AbstractExpressionSolver
dbg, solver
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Determines the length of the subconstructor that would be returned had the expression not depended on an undefined symbol.getValue
(EndInstructionValue iv, Map<String, Long> vals, AssemblyResolvedPatterns cur) Attempt to get a constant value for the expressionsolve
(AbstractAssemblyResolutionFactory<?, ?> factory, EndInstructionValue exp, MaskedLong goal, Map<String, Long> vals, AssemblyResolvedPatterns cur, Set<SolverHint> hints, String description) Attempt to solve an expression for a given valuevalueForResolution
(EndInstructionValue exp, Map<String, Long> vals, AssemblyResolvedPatterns rc) Compute the value of the expression given the (possibly-intermediate) resolutionMethods inherited from class ghidra.app.plugin.assembler.sleigh.expr.AbstractExpressionSolver
register
-
Constructor Details
-
EndInstructionValueSolver
public EndInstructionValueSolver()
-
-
Method Details
-
solve
public AssemblyResolution solve(AbstractAssemblyResolutionFactory<?, ?> factory, EndInstructionValue exp, MaskedLong goal, Map<String, throws NeedsBackfillExceptionLong> vals, AssemblyResolvedPatterns cur, Set<SolverHint> hints, String description) Description copied from class:AbstractExpressionSolver
Attempt to solve an expression for a given value- Specified by:
solve
in classAbstractExpressionSolver<EndInstructionValue>
- Parameters:
exp
- the expression to solvegoal
- the desired value of the expressionvals
- values of defined symbolshints
- describes techniques applied by calling solversdescription
- the description to give to resolved solutions- Returns:
- the resolution
- Throws:
NeedsBackfillException
- if the expression refers to an undefined symbol
-
getValue
public MaskedLong getValue(EndInstructionValue iv, Map<String, Long> vals, AssemblyResolvedPatterns cur) throws NeedsBackfillExceptionDescription copied from class:AbstractExpressionSolver
Attempt to get a constant value for the expression- Specified by:
getValue
in classAbstractExpressionSolver<EndInstructionValue>
- Parameters:
iv
- the expressionvals
- values of defined symbols- Returns:
- the constant value, or null if it depends on a variable
- Throws:
NeedsBackfillException
- if the expression refers to an undefined symbol
-
getInstructionLength
Description copied from class:AbstractExpressionSolver
Determines 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:
getInstructionLength
in classAbstractExpressionSolver<EndInstructionValue>
- Parameters:
iv
- the expression- Returns:
- the length of filled in token field(s).
-
valueForResolution
public MaskedLong valueForResolution(EndInstructionValue exp, Map<String, Long> vals, AssemblyResolvedPatterns rc) Description copied from class:AbstractExpressionSolver
Compute the value of the expression given the (possibly-intermediate) resolution- Specified by:
valueForResolution
in classAbstractExpressionSolver<EndInstructionValue>
- Parameters:
exp
- the expression to evaluatevals
- values of defined symbolsrc
- the resolution on which to evaluate it- Returns:
- the result
-