Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/331.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 有人可以发送ReadInt32来写入进程内存吗?_C#_.net_Memory_Offset_Cheat Engine - Fatal编程技术网

C# 有人可以发送ReadInt32来写入进程内存吗?

C# 有人可以发送ReadInt32来写入进程内存吗?,c#,.net,memory,offset,cheat-engine,C#,.net,Memory,Offset,Cheat Engine,我试图写处理内存,所以我复制了视频中的代码。 但是这个视频没有显示函数“ReadInt32”,有人能让我最终运行这个应用程序吗 ReadInt32(进程,(IntPtr)地址) 代码中突出显示的错误: 指针:(类型为float) public static long GetRealAddress(IntPtr process, IntPtr baseAddress, int[] offsets) { var address = baseAddress.ToInt64(

我试图写处理内存,所以我复制了视频中的代码。 但是这个视频没有显示函数“ReadInt32”,有人能让我最终运行这个应用程序吗

ReadInt32(进程,(IntPtr)地址)

代码中突出显示的错误:

指针:(类型为float)

public static long GetRealAddress(IntPtr process, IntPtr baseAddress, int[] offsets)
    {
        var address = baseAddress.ToInt64();
        foreach (var offset in offsets)
        {
            address = ReadInt32(process, (IntPtr)address) + offset;

        }
        return address;
    }
[DllImport("kernel32.dll", SetLastError = true)]
static extern bool ReadProcessMemory(IntPtr handle, IntPtr baseAddress,
    byte[] buffer, int size, out IntPtr lpNumberOfBytesRead);


public static int ReadInt32(IntPtr processHandle, IntPtr address)
{
    byte[] buffer = new byte[4];

    ReadProcessMemory(processHandle, address,
       buffer, buffer.Length, out IntPtr bytesRead);

    // if this gives the wrong value:
    // Array.Reverse(buffer);
    var myInt = BitConverter.ToInt32(buffer, 0);
    return myInt;
}