Class AnnotatedPcodeUseropLibrary.FixedArgsAnnotatedPcodeUseropDefinition<T>
- Type Parameters:
T- the type of data processed by the userop
- All Implemented Interfaces:
PcodeUseropLibrary.PcodeUseropDefinition<T>
- Enclosing class:
AnnotatedPcodeUseropLibrary<T>
-
Field Summary
Fields inherited from class AnnotatedPcodeUseropLibrary.AnnotatedPcodeUseropDefinition
method -
Constructor Summary
ConstructorsConstructorDescriptionFixedArgsAnnotatedPcodeUseropDefinition(AnnotatedPcodeUseropLibrary<T> library, Type opType, MethodHandles.Lookup lookup, Method method, AnnotatedPcodeUseropLibrary.PcodeUserop annot) -
Method Summary
Modifier and TypeMethodDescriptionintGet the number of input operands accepted by the userop.protected voidbooleanisInSigned(int index) Indicates whether a given input 0-up should be sign or zero extended to match a Java primitive parameter size.protected voidplaceInputs(PcodeExecutor<T> executor, List<Object> args, List<Varnode> inVars) protected voidprocessNonAnnotatedParameter(Type declClsOpType, Type opType, int i, Parameter p) protected voidvalidateInputs(List<Varnode> inVars) Methods inherited from class AnnotatedPcodeUseropLibrary.AnnotatedPcodeUseropDefinition
canInlinePcode, canInterrupt, create, execute, fromPrimitive, getDefiningLibrary, getJavaMethod, getName, getOutputType, hasSideEffects, initFinished, isFunctional, isOutSigned, isPrimitive, modifiesContextMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PcodeUseropLibrary.PcodeUseropDefinition
execute
-
Constructor Details
-
FixedArgsAnnotatedPcodeUseropDefinition
public FixedArgsAnnotatedPcodeUseropDefinition(AnnotatedPcodeUseropLibrary<T> library, Type opType, MethodHandles.Lookup lookup, Method method, AnnotatedPcodeUseropLibrary.PcodeUserop annot)
-
-
Method Details
-
initStarting
protected void initStarting()- Overrides:
initStartingin classAnnotatedPcodeUseropLibrary.AnnotatedPcodeUseropDefinition<T>
-
processNonAnnotatedParameter
- Specified by:
processNonAnnotatedParameterin classAnnotatedPcodeUseropLibrary.AnnotatedPcodeUseropDefinition<T>
-
validateInputs
- Overrides:
validateInputsin classAnnotatedPcodeUseropLibrary.AnnotatedPcodeUseropDefinition<T>- Throws:
PcodeExecutionException
-
placeInputs
- Specified by:
placeInputsin classAnnotatedPcodeUseropLibrary.AnnotatedPcodeUseropDefinition<T>
-
getInputCount
public int getInputCount()Description copied from interface:PcodeUseropLibrary.PcodeUseropDefinitionGet the number of input operands accepted by the userop.- Returns:
- the count or -1 if the userop is variadic
-
isInSigned
public boolean isInSigned(int index) Description copied from interface:PcodeUseropLibrary.PcodeUseropDefinitionIndicates whether a given input 0-up should be sign or zero extended to match a Java primitive parameter size.This only applies when the userop is implemented as a Java function and this input is taken as a primitive type. Otherwise, the userop should examine the input varnode and behave accordingly, or just inline use of that input varnode. When accepting, e.g., a
long, it could happen the input varnode is size 2. Because it's smaller, we need to know whether or not that input is meant to be signed. Contrary to Java conventions, but inline with Sleigh conventions, we default to false.WARNING: Constant varnodes can behave weirdly when interpreted as signed. A userop declaring a signed input must be prepared to deal with this case. Consider the constant 0x80. Sleigh will encode this as the varnode
(const, 0x80, 1), i.e., the constant with value 0x80 having size 1. If you mark anintinput as signed, and it receives this constant, Java will see it as -128.- Parameters:
index- the position of the input argument, 0 is leftmost.- Returns:
- true for signed extension
-