MmAllocateContigouslyMemory默认权限

发布于 2025-01-01 03:07:11 字数 59 浏览 1 评论 0原文

有谁知道此例程返回的页面上的默认权限是什么。是否有机会在此页面上放置一些代码部分。

谢谢

Does anyone know what are the default permissions on the page, returned by this routine. Is there any chance of putting some code section on this page.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

岁月染过的梦 2025-01-08 03:07:11

通过 MDL 分配内存,然后调用 MmProtectMdlSystemAddress() 更改页面保护。

找到此处

Allocate memory through an MDL and then call MmProtectMdlSystemAddress() to change the page protection.

Found here.

青朷 2025-01-08 03:07:11

简短的回答是否定的 - 没有安全的、有记录的方法来从内核模式操作页面保护位。这些位由内存管理器拥有。

也就是说,由于以这种方式分配的内存没有设置 NX 位,因此没有什么可以阻止您从通过此 API 分配的内存中执行代码。

编辑:我的观点是正确的 - 我不知道上面 Alex 的答案中提到的 API。你每天都会学到新东西!

Short answer is no - there is no safe, documented way of manipulating page protection bits from kernel mode. These bits are owned by the memory manager.

That said, since memory allocated in this fashion does not have the NX bit set, there is nothing to stop you from executing code from memory allocated via this API.

EDIT: I stand corrected - I was unaware of the API mentioned in Alex's answer above. You learn something new everyday!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文