MmAllocateContigouslyMemory默认权限
有谁知道此例程返回的页面上的默认权限是什么。是否有机会在此页面上放置一些代码部分。
谢谢
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
通过 MDL 分配内存,然后调用 MmProtectMdlSystemAddress() 更改页面保护。
找到此处。
Allocate memory through an MDL and then call MmProtectMdlSystemAddress() to change the page protection.
Found here.
简短的回答是否定的 - 没有安全的、有记录的方法来从内核模式操作页面保护位。这些位由内存管理器拥有。
也就是说,由于以这种方式分配的内存没有设置 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!