如何使用 C# 在 Windows 中获取另一个进程库地址
How can I get another process base adress in Windows using C#?
当我发现华硕的一个旧驱动程序容易受到物理内存读/写的攻击时,我正在浏览exploitdb。有一个完全有效的 PoC 显示如何从 RAM 读取。问题是我有一个偏移量(假设0x31E4(,指示我在程序内存中需要的值的相对位置,但驱动程序返回绝对窗口地址的信息。如何在物理内存中获取基本进程地址(最好在 C# 中(?甚至可能吗?
伪代码示例:
DWORD offset = 0x31E4; // Offset
int size = sizeof(float); // Size of float
float output = Read(ProgramBase + offset, size); // Read function that read absolute value from RAM, for that I need ProgramBase
如果你想找到内存的起始块和结束块,这段代码应该这样做:
Process p = Process.GetCurrentProcess();
IntPtr startMemory= p.MainModule.BaseAddress;
IntPtr endMemory= IntPtr.Add(startMemory,p.MainModule.ModuleMemorySize);
当然,您可以获得任何其他进程,而不是当前进程,例如:
Process.GetProcessById(processId)
相关文章:
- 如何在C++中将函数发送到另一个进程
- 如何从另一个进程解开全局钩子?
- 如何使用带有矢量的 winapi 读取进程内存从另一个进程读取缓冲区?
- 如何在MPI中将矩阵从一个进程转移到另一个进程
- 将vector<vector<double>>从x86平台中创建的一个进程发送到x64中构建的另一个进程的最快方法是什么
- 通过 c++ 中的 udp 套接字将派生类对象从一个进程发送到另一个进程
- 如何:监视Windows中另一个进程的文件访问?
- 是否可以注入一个进程并获取给定的句柄,然后使用它们注入另一个进程
- 尝试启动另一个进程并通过 MPI 加入它,但获得访问冲突
- 将窗口句柄从一个进程使用到另一个进程(插件 vst 音频)
- 启动另一个进程的最佳方式C++?
- Win32/Gdigrab - 如何将另一个进程窗口设置为无边框
- 为什么我不能用这个函数在Qt框架中打开另一个进程?
- 如何使用 C# 在 Windows 中获取另一个进程库地址
- 如何在没有窗口类的情况下编写QT系统托盘应用程序,并将其与另一个进程集成
- GetWindowText 返回另一个进程的空字符串
- 如何获取另一个进程的基址?(美国法律评论)
- 如何在C++中将字节数组发送到另一个进程
- 从另一个进程设置 HWND 的 lpfnWndProc
- 如何将记忆映射的文件与另一个进程写入文件同步