Package soot.dotnet
Class AssemblyFile
- java.lang.Object
-
- java.io.File
-
- soot.dotnet.AssemblyFile
-
- All Implemented Interfaces:
Serializable,Comparable<File>
public class AssemblyFile extends File
Represents an Assembly File- Author:
- Thomas Schmeiduch
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.io.File
pathSeparator, pathSeparatorChar, separator, separatorChar
-
-
Constructor Summary
Constructors Constructor Description AssemblyFile(String fullyQualifiedAssemblyPathFilename)Constructs a new AssemblyFile with the path to the file
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<String>getAllReferencedModuleTypes()Get all module type names which are references from this assemblyCollection<String>getAllTypeNames()Get all types of given assembly as a list of stringsProtoAssemblyAllTypes.AssemblyAllTypesgetAllTypes()Get all Types of this assemblyStringgetAssemblyFileName()StringgetFullPath()ProtoIlInstructions.IlFunctionMsggetMethodBody(String className, String method, int peToken)Get Method Body with IL InstructionsProtoIlInstructions.IlFunctionMsggetMethodBodyOfEvent(String className, String eventName, DotnetEvent.EventDirective eventDirective)Get Method Body of event methodsProtoIlInstructions.IlFunctionMsggetMethodBodyOfProperty(String className, String propertyName, boolean isSetter)Get Method Body of property methodsProtoAssemblyAllTypes.TypeDefinitiongetTypeDefinition(String className)Get Type definition as Proto MessagebooleanisAssembly()Check if given file is an assembly filebyte[]nativeGetManifestResourceStream(String pathToNativeHost, String absolutePathAssembly, String name)Returns a manifest resource stream-
Methods inherited from class java.io.File
canExecute, canRead, canWrite, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getFreeSpace, getName, getParent, getParentFile, getPath, getTotalSpace, getUsableSpace, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setExecutable, setExecutable, setLastModified, setReadable, setReadable, setReadOnly, setWritable, setWritable, toPath, toString, toURI, toURL
-
-
-
-
Constructor Detail
-
AssemblyFile
public AssemblyFile(String fullyQualifiedAssemblyPathFilename)
Constructs a new AssemblyFile with the path to the file- Parameters:
fullyQualifiedAssemblyPathFilename- e.g. /home/user/cs/myassembly.dll
-
-
Method Detail
-
getAllTypes
public ProtoAssemblyAllTypes.AssemblyAllTypes getAllTypes()
Get all Types of this assembly- Returns:
- proto message with all types of this assembly
-
getMethodBody
public ProtoIlInstructions.IlFunctionMsg getMethodBody(String className, String method, int peToken)
Get Method Body with IL Instructions- Parameters:
className- given classmethod- given method name- Returns:
- list/tree of il instructions otherwise null
-
getMethodBodyOfProperty
public ProtoIlInstructions.IlFunctionMsg getMethodBodyOfProperty(String className, String propertyName, boolean isSetter)
Get Method Body of property methods- Parameters:
className- declaring classpropertyName- name of propertyisSetter- request setter or getter- Returns:
- proto message with method body
-
getMethodBodyOfEvent
public ProtoIlInstructions.IlFunctionMsg getMethodBodyOfEvent(String className, String eventName, DotnetEvent.EventDirective eventDirective)
Get Method Body of event methods- Parameters:
className- declaring classeventName- name of eventeventDirective- method request- Returns:
- proto message with method body
-
isAssembly
public boolean isAssembly()
Check if given file is an assembly file- Returns:
- true if this object referenced to a file is an assembly
-
getTypeDefinition
public ProtoAssemblyAllTypes.TypeDefinition getTypeDefinition(String className)
Get Type definition as Proto Message- Parameters:
className- requested type- Returns:
- proto message with the given type definition
-
getAllTypeNames
public Collection<String> getAllTypeNames()
Get all types of given assembly as a list of strings- Returns:
- list of strings with all types
-
getAllReferencedModuleTypes
public List<String> getAllReferencedModuleTypes()
Get all module type names which are references from this assembly- Returns:
- list of strings with all possible referenced module type names
-
getFullPath
public String getFullPath()
-
getAssemblyFileName
public String getAssemblyFileName()
-
nativeGetManifestResourceStream
public byte[] nativeGetManifestResourceStream(String pathToNativeHost, String absolutePathAssembly, String name)
Returns a manifest resource stream- Parameters:
pathToNativeHost- Path where the library file of the native host is located, e.g. /Users/user/soot-dotnet/src/Soot.Dotnet.NativeHost/bin/Debug/libNativeHost.dylibabsolutePathAssembly- e.g. /home/user/cs/myassembly.dllname- the name of the resource- Returns:
- the content of the resource or null if not found
-
-