指令.NET反射程序的命名空间
在.NET Reflector的上一个版本中,我能够在函数中获取指令的名称空间,但现在我不能,并且文档不存在 红门的.NET Reflector 6.8.2.5最新免费版本 这行正在运行,但现在不行:指令.Value.declaringtype.namespace.ToString 如何获取指令的名称空间 Thx指令.NET反射程序的命名空间,.net,namespaces,assemblies,reflector,.net-reflector,.net,Namespaces,Assemblies,Reflector,.net Reflector,在.NET Reflector的上一个版本中,我能够在函数中获取指令的名称空间,但现在我不能,并且文档不存在 红门的.NET Reflector 6.8.2.5最新免费版本 这行正在运行,但现在不行:指令.Value.declaringtype.namespace.ToString 如何获取指令的名称空间 Thx 我是在克莱夫的帮助下完成的 什么意思,它不起作用了?它有什么作用?名称空间对指令意味着什么?指令可以是对位于其他DLL/名称空间内的函数的调用。名称空间有点像访问Reflector.C
我是在克莱夫的帮助下完成的
什么意思,它不起作用了?它有什么作用?名称空间对指令意味着什么?指令可以是对位于其他DLL/名称空间内的函数的调用。名称空间有点像访问Reflector.CodeModel这样的函数的路径,所以我需要函数的完整路径。
Private Sub DesassamblerDLL(ByVal strDLLFile As String)
Dim serviceProvider As New Reflector.ApplicationManager(Nothing)
Dim assemblyManager As Reflector.CodeModel.IAssemblyManager
Dim objAssembly As Reflector.CodeModel.IAssembly
Dim objMod As Reflector.CodeModel.IModule
Dim typeDeclaration As Reflector.CodeModel.ITypeDeclaration
Dim methodDeclaration As Reflector.CodeModel.IMethodDeclaration
assemblyManager = serviceProvider.GetService(GetType(Reflector.CodeModel.IAssemblyManager))
objAssembly = assemblyManager.LoadFile(strDLLFile)
For Each objMod In objAssembly.Modules
For Each typeDeclaration In objMod.Types
For Each methodDeclaration In typeDeclaration.Methods
Dim methodBody As Reflector.CodeModel.IMethodBody = methodDeclaration.Body
If Not methodBody Is Nothing Then
Dim instruction As Reflector.CodeModel.IInstruction
For Each instruction In methodBody.Instructions
str = instruction.Value.declaringtype.namespace.ToString
Next
End If
Next
Next
Next
End Sub
Imports system.Reflection.Emit
Select Case instruction.Code
Case OpCodes.Call.Value, OpCodes.Calli.Value, OpCodes.Callvirt.Value
Dim targetMethodReference As Reflector.CodeModel.IMethodReference = instruction.Value
Dim method As Reflector.CodeModel.IMethodDeclaration = targetMethodReference.Resolve
Dim typeReference As Reflector.CodeModel.ITypeReference = method.DeclaringType
...
End Select