UtilDnLibGetMethods(ModuleDefMD, String) Method
Gets all the Methods defined in a existing Type inside a .NET assembly.
Namespace: DevCase.ThirdParty.DnLibAssembly: DevCase.net48.ThirdParty.DnLib (in DevCase.net48.ThirdParty.DnLib.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static ReadOnlyCollection<MethodDef> GetMethods(
ModuleDefMD assembly,
string typeName
)
Public Shared Function GetMethods (
assembly As ModuleDefMD,
typeName As String
) As ReadOnlyCollection(Of MethodDef)
Dim assembly As ModuleDefMD
Dim typeName As String
Dim returnValue As ReadOnlyCollection(Of MethodDef)
returnValue = UtilDnLib.GetMethods(assembly,
typeName)
public:
static ReadOnlyCollection<MethodDef^>^ GetMethods(
ModuleDefMD^ assembly,
String^ typeName
)
static member GetMethods :
assembly : ModuleDefMD *
typeName : string -> ReadOnlyCollection<MethodDef>
No code example is currently available or this language may not be supported.
- assembly ModuleDefMD
-
The assembly.
- typeName String
-
The name of the type to find.
ReadOnlyCollectionMethodDef
A
ReadOnlyCollectionT containing the
methods defined (including nested Types) inside a .NET assembly.
Note: Some functionalities of this assembly may require to install one or all of the listed NuGet packages:
dnlib by 0xd4d
This is a code example.
No code example is currently available or this language may not be supported.
Dim assembly As ModuleDefMD = LoadAssembly("C:\Application.exe")
Dim methods As ReadOnlyCollection(Of MethodDef) = GetMethods(assembly, "Main") ' Searchs a Class named "Main"
For Each method As MethodDef In methods
' If method contains instructions then...
If method.HasBody Then
Dim sb As New Global.System.Text.StringBuilder
With sb
.AppendLine(String.Format("Method Name: {0}", method.Name))
.AppendLine()
.AppendLine(String.Format("Method Signature: {0}", method.Signature.ToString()))
.AppendLine()
.AppendLine(String.Format("Method Instructions: {0}", Environment.NewLine &
String.Join(Environment.NewLine, method.Body.Instructions)))
End With
MessageBox.Show(sb.ToString())
End If ' method.HasBody
Next method
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.