读取内存保护 [英] Reading memory protection

查看:83
本文介绍了读取内存保护的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道Linux是否有一种检索内存保护的方法.就像,我想恢复使用mprotect更改后的保护.

I would like to know if there is for linux a way of retrieving the protection of the memory. Like, I want to restore the protection that existed after changing it with mprotect.

推荐答案

根据davidg的回答,以下是函数unsigned int read_mprotection(void* addr): re_mprot.c github上的reDroid项目(该代码可在Android上运行,应可移植到其他Linux系统上.)

Based on the answer by davidg, here's the function unsigned int read_mprotection(void* addr): re_mprot.c, re_mprot.h from the reDroid project at github (the code works on Android, it should be portable to other linuxes).

这篇关于读取内存保护的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆