mirror of
https://github.com/roflmuffin/CounterStrikeSharp.git
synced 2025-12-09 01:16:36 -08:00
31 lines
836 B
C#
31 lines
836 B
C#
using System;
|
|
using CounterStrikeSharp.API.Core;
|
|
|
|
namespace CounterStrikeSharp.API.Modules.Memory.DynamicFunctions;
|
|
|
|
public class DynamicHook : NativeObject
|
|
{
|
|
public DynamicHook(IntPtr pointer) : base(pointer)
|
|
{
|
|
}
|
|
|
|
public T GetParam<T>(int index)
|
|
{
|
|
return NativeAPI.DynamicHookGetParam<T>(Handle, (int)typeof(T).ToValidDataType(), index);
|
|
}
|
|
|
|
public T GetReturn<T>()
|
|
{
|
|
return NativeAPI.DynamicHookGetReturn<T>(Handle, (int)typeof(T).ToValidDataType());
|
|
}
|
|
|
|
public void SetParam<T>(int index, T value)
|
|
{
|
|
NativeAPI.DynamicHookSetParam(Handle, (int)typeof(T).ToValidDataType(), index, value);
|
|
}
|
|
|
|
public void SetReturn<T>(T value)
|
|
{
|
|
NativeAPI.DynamicHookSetReturn(Handle, (int)typeof(T).ToValidDataType(), value);
|
|
}
|
|
} |