Package soot.asm

Class AsmUtil


  • public class AsmUtil
    extends Object
    Author:
    eric
    • Method Detail

      • isDWord

        public static boolean isDWord​(Type type)
        Determines if a type is a dword type.
        Parameters:
        type - the type to check.
        Returns:
        true if its a dword type.
      • toBaseType

        public static Type toBaseType​(String internal,
                                      com.google.common.base.Optional<String> moduleName)
        Converts an internal class name to a Type.
        Parameters:
        internal - internal name.
        Returns:
        type
      • toQualifiedName

        public static String toQualifiedName​(String internal)
        Converts an internal class name to a fully qualified name.
        Parameters:
        internal - internal name.
        Returns:
        fully qualified name.
      • toInternalName

        public static String toInternalName​(String qual)
        Converts a fully qualified class name to an internal name.
        Parameters:
        qual - fully qualified class name.
        Returns:
        internal name.
      • toInternalName

        public static String toInternalName​(SootClass cls)
        Determines and returns the internal name of a class.
        Parameters:
        cls - the class.
        Returns:
        corresponding internal name.
      • toJimpleRefType

        public static Type toJimpleRefType​(String desc,
                                           com.google.common.base.Optional<String> moduleName)
        Converts a type descriptor to a Jimple reference type.
        Parameters:
        desc - the descriptor.
        Returns:
        the reference type.
      • toJimpleType

        public static Type toJimpleType​(String desc,
                                        com.google.common.base.Optional<String> moduleName)
        Converts a type descriptor to a Jimple type.
        Parameters:
        desc - the descriptor.
        Returns:
        equivalent Jimple type.
      • toJimpleDesc

        public static List<Type> toJimpleDesc​(String desc,
                                              com.google.common.base.Optional<String> moduleName)
        Converts a method signature to a list of types, with the last entry in the returned list denoting the return type.
        Parameters:
        desc - method signature.
        Returns:
        list of types.
      • baseTypeName

        public static String baseTypeName​(String s)
        strips suffix for indicating an array type
      • byteCodeToJavaVersion

        public static int byteCodeToJavaVersion​(int bytecodeVersion)
      • javaToBytecodeVersion

        public static int javaToBytecodeVersion​(int javaVersion)
      • jimpleTypesOfFieldOrMethodDescriptor

        public static Type[] jimpleTypesOfFieldOrMethodDescriptor​(String descriptor)
      • toUtf8

        public static byte[] toUtf8​(String s)
        Utility method; converts the given String into a utf8 encoded array of bytes.
        Parameters:
        s - String to encode.
        Returns:
        array of bytes, utf8 encoded version of s.