Getting the pointer of a function...
So, i have a class:
So, this is in a Dll project, which got injected into a game....
But every time, i run the function, the Thread stop for a few second, and then the game just exit...
What is the problem with it ?
I need the Pointer to that function (in IntPtr) because:
-A command will be overwritten (byte patch) inside the game, to call that function...
-I don't know, if the parameter list will work or not, maybe someone can help me with that...
Code:
class ByPass
{
public delegate uint GetPointer(int Index);
public static unsafe void CreateBypass(uint CShell)
{
Console.WriteLine("Bypass Experimenting");
Type BypassType = Type.GetType("ByPass");
MethodInfo ReturnPointer = BypassType.GetMethod("Bypass");
//Console.WriteLine("Function Pointer: " + Storage.DecToHex(ReturnPointer.MethodHandle.GetFunctionPointer().ToInt32()));
//var func = (GetPointer)Marshal.GetDelegateForFunctionPointer((IntPtr)Bypass, typeof(GetPointer));
Console.WriteLine("Done");
}
public static uint Bypass(int GunIndex)
{
return 0;
}
}
But every time, i run the function, the Thread stop for a few second, and then the game just exit...
What is the problem with it ?
I need the Pointer to that function (in IntPtr) because:
-A command will be overwritten (byte patch) inside the game, to call that function...
-I don't know, if the parameter list will work or not, maybe someone can help me with that...
