public class MemoryHelp
{
[DllImportAttribute("kernel32.dll", EntryPoint = "ReadProcessMemory")]
public static extern bool ReadProcessMemory
(
IntPtr lpProcess,
IntPtr lpBaseAddress,
IntPtr lpBuffer,
int nSize,
IntPtr BytesRead
);
//打开进程
//kernel32.dll系统动态链接库
[DllImportAttribute("kernel32.dll", EntryPoint = "OpenProcess")]
public static extern IntPtr OpenProcess
(
int iAccess,
bool Handle,
int ProcessID
);
//关闭句柄
[DllImport("kernel32.dll", EntryPoint = "CloseHandle")]
private static extern void CloseHandle
(
IntPtr hObject
);
//写内存
[DllImportAttribute("kernel32.dll", EntryPoint = "WriteProcessMemory")]
public stat
C#读写内存操作方式
最新推荐文章于 2023-05-30 23:53:42 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)