using System.Diagnostics; using System.Linq; // Attach to a running process Process process = Process.GetProcessesByName("MyApp").FirstOrDefault(); TargetInfo targetInfo = new TargetInfo(process.Id); // Get the address of a specific method long methodAddress = targetInfo.GetAddress("MyNamespace.MyClass.MyMethod");In this example, we first obtain a reference to a running process and create a TargetInfo object using its process ID. We then call GetAddress with the fully qualified name of a method we are interested in. The methodAddress variable will contain the memory address of this method in the target process. Package library: The TargetInfo class is part of the Microsoft.Diagnostics.Runtime library, which is distributed as part of the .NET Core SDK and can also be installed as a NuGet package.