forked from DaxxTrias/Process.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRemoteFunction.cs
More file actions
36 lines (32 loc) · 1007 Bytes
/
RemoteFunction.cs
File metadata and controls
36 lines (32 loc) · 1007 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.Runtime.InteropServices;
using ProcessNET.Memory;
namespace ProcessNET.Modules
{
/// <summary>
/// Class representing a function in the remote process.
/// </summary>
public class RemoteFunction : MemoryPointer, IProcessFunction
{
public RemoteFunction(IProcess processPlus, IntPtr address, string functionName) : base(processPlus, address)
{
// Save the parameter
Name = functionName;
}
/// <summary>
/// The name of the function.
/// </summary>
public string Name { get; }
public T GetDelegate<T>()
{
return Marshal.GetDelegateForFunctionPointer<T>(BaseAddress);
}
/// <summary>
/// Returns a string that represents the current object.
/// </summary>
public override string ToString()
{
return $"BaseAddress = 0x{BaseAddress.ToInt64():X} Name = {Name}";
}
}
}