Class MethodInvocationInstruction

    • Constructor Detail

      • MethodInvocationInstruction

        public MethodInvocationInstruction​(org.jf.dexlib2.iface.instruction.Instruction instruction,
                                           int codeAddress)
    • Method Detail

      • isUsedAsFloatingPoint

        protected boolean isUsedAsFloatingPoint​(DexBody body,
                                                int register,
                                                boolean isStatic)
        Determine if register is used as floating point. Abstraction for static and non-static methods. Non-static methods need to ignore the first parameter (this)
        Parameters:
        isStatic - if this method is static
      • isUsedAsObject

        protected boolean isUsedAsObject​(DexBody body,
                                         int register,
                                         boolean isStatic)
        Determine if register is used as object. Abstraction for static and non-static methods. Non-static methods need to ignore the first parameter (this)
        Parameters:
        isStatic - if this method is static
      • getVirtualSootMethodRef

        protected SootMethodRef getVirtualSootMethodRef()
        Return the virtual SootMethodRef for the invoked method.
      • getStaticSootMethodRef

        protected SootMethodRef getStaticSootMethodRef()
        Return the static SootMethodRef for the invoked method.
      • getInterfaceSootMethodRef

        protected SootMethodRef getInterfaceSootMethodRef()
        Return the static SootMethodRef for the invoked method.
      • getNormalSootMethodRef

        protected SootMethodRef getNormalSootMethodRef​(MethodHandle.Kind kind)
        Return the SootMethodRef for the invoked method.
        Parameters:
        kind - The type of the invocation in terms of MethodHandle.Kind
      • getSootMethodRef

        protected SootMethodRef getSootMethodRef​(org.jf.dexlib2.iface.reference.MethodReference mItem,
                                                 MethodHandle.Kind kind)
        Return a SootMethodRef for the given MethodReference dependent on the InvocationType passed in.
        Parameters:
        mItem - The MethodReference included in the invoke instruction
        kind - The type of the invocation in terms of MethodHandle.Kind
        Returns:
        A SootMethodRef
      • getSootMethodRef

        protected SootMethodRef getSootMethodRef​(SootClass sc,
                                                 String name,
                                                 String returnType,
                                                 List<? extends CharSequence> paramTypes,
                                                 MethodHandle.Kind kind)
        Return a SootMethodRef for the given data.
        Parameters:
        sc - The SootClass that the method is declared in
        name - The name of the method being invoked
        returnType - The return type of the method being invoked
        paramTypes - The parameter types of the method being invoked
        kind - The type of the invocation in terms of MethodHandle.Kind
        Returns:
        A SootMethodRef
      • getSootFieldRef

        protected SootFieldRef getSootFieldRef​(org.jf.dexlib2.iface.reference.FieldReference mItem,
                                               MethodHandle.Kind kind)
        Return a SootFieldRef for the given data.
        Parameters:
        mItem - The FieldReference included in the invoke instruction
        kind - The type of the field access in terms of MethodHandle.Kind
        Returns:
        A SootFieldRef
      • getSootFieldRef

        protected SootFieldRef getSootFieldRef​(SootClass sc,
                                               String name,
                                               String type,
                                               MethodHandle.Kind kind)
        Return a SootFieldRef for the given data.
        Parameters:
        sc - The SootClass that the field is declared in
        name - The name of the field
        type - The type of the field
        kind - The type of the field access in terms of MethodHandle.Kind
        Returns:
        A SootFieldRef
      • convertParameterTypes

        protected List<Type> convertParameterTypes​(List<? extends CharSequence> paramTypes)
        Converts a list of dex string parameter types to soot types.
        Parameters:
        paramTypes - The dex parameter types
        Returns:
        The soot parameter types
      • convertClassName

        protected SootClass convertClassName​(String name,
                                             MethodHandle.Kind kind)
        Converts a given string class name into a SootClass.
        Parameters:
        name - The dex string representation of the class
        kind - The MethodHandle.Kind of the MethodHandle this class is coming from
        Returns:
      • buildParameters

        protected List<Local> buildParameters​(DexBody body,
                                              List<? extends CharSequence> paramTypes,
                                              boolean isStatic)
        Build the local parameters of the invocation. If a method is not static then its first register value is the invoking object and will be skipped when constructing the local parameters.
        Parameters:
        body - the body to build for and into
        paramTypes - the parameter types as strings
        isStatic - if the method is static
        Returns:
        the converted parameters
      • getUsedRegistersNums

        protected List<Integer> getUsedRegistersNums()
        Return the indices used in this instruction.
        Returns:
        a list of register indices
      • jimplifyVirtual

        protected void jimplifyVirtual​(DexBody body)
        Executes the "jimplify" operation for a virtual invocation
      • jimplifyInterface

        protected void jimplifyInterface​(DexBody body)
        Executes the "jimplify" operation for an interface invocation
      • jimplifySpecial

        protected void jimplifySpecial​(DexBody body)
        Executes the "jimplify" operation for a special invocation
      • jimplifyStatic

        protected void jimplifyStatic​(DexBody body)
        Executes the "jimplify" operation for a static invocation