Class ContextFieldSolver
- java.lang.Object
- 
- ghidra.app.plugin.assembler.sleigh.expr.AbstractExpressionSolver<ContextField>
- 
- ghidra.app.plugin.assembler.sleigh.expr.ContextFieldSolver
 
 
- 
 public class ContextFieldSolver extends AbstractExpressionSolver<ContextField> Solves expressions of a context register field Essentially, this just encodes the goal into the field, if it can be represented in the given space and format. Otherwise, there is no solution.
- 
- 
Field Summary- 
Fields inherited from class ghidra.app.plugin.assembler.sleigh.expr.AbstractExpressionSolverdbg, solver
 
- 
 - 
Constructor SummaryConstructors Constructor Description ContextFieldSolver()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetInstructionLength(ContextField cf, 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(ContextField cf, 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(ContextField cf, 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(ContextField cf, AssemblyResolvedConstructor rc)Compute the value of the expression given the (possibly-intermediate) resolution- 
Methods inherited from class ghidra.app.plugin.assembler.sleigh.expr.AbstractExpressionSolverregister
 
- 
 
- 
- 
- 
Method Detail- 
solvepublic AssemblyResolution solve(ContextField cf, 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 class- AbstractExpressionSolver<ContextField>
- Parameters:
- cf- the expression to solve
- goal- the desired value of the expression
- vals- values of defined symbols
- res- the results of subconstructor resolutions (used for lengths)
- hints- describes techniques applied by calling solvers
- description- the description to give to resolved solutions
- Returns:
- the resolution
 
 - 
getValuepublic MaskedLong getValue(ContextField cf, java.util.Map<java.lang.String,java.lang.Long> vals, java.util.Map<java.lang.Integer,java.lang.Object> res, AssemblyResolvedConstructor cur) Description copied from class:AbstractExpressionSolverAttempt to get a constant value for the expression- Specified by:
- getValuein class- AbstractExpressionSolver<ContextField>
- Parameters:
- cf- the expression
- vals- values of defined symbols
- res- the results of subconstructor resolutions (used for lengths)
- Returns:
- the constant value, or null if it depends on a variable
 
 - 
getInstructionLengthpublic int getInstructionLength(ContextField cf, 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 class- AbstractExpressionSolver<ContextField>
- Parameters:
- cf- the expression
- res- the results of subconstructor resolutions (used for lengths)
- Returns:
- the length of filled in token field(s).
 
 - 
valueForResolutionpublic MaskedLong valueForResolution(ContextField cf, AssemblyResolvedConstructor rc) Description copied from class:AbstractExpressionSolverCompute the value of the expression given the (possibly-intermediate) resolution- Specified by:
- valueForResolutionin class- AbstractExpressionSolver<ContextField>
- Parameters:
- cf- the expression to evaluate
- rc- the resolution on which to evaluate it
- Returns:
- the result
 
 
- 
 
-