我可以修改另一个进程的UID吗?
我的本机进程在 Android 设备上以 root 身份运行。是否可以修改另一个进程的 UID 以获得 root 权限?
原因是允许访问一些非 root 进程无法访问的 Android“功能”。
My native process runs under root on Android device. Is it possible to modify UID of another process in order to give it the root?
The reason is to give an access to some Android "features" that inaccessible for non-root processes.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您有 root 权限的手机,则可以使用(通常)
/system/xbin/su
显式运行进程。不过,您无法更改已在运行的程序的 uid。 (理论上,您可以查看内核内存并更改所有各种存储的 uid,但这是一个非常糟糕的主意,因为您无法锁定正在修改的内容,如果它们更改或移动,您可能会导致内核恐慌。)If you have a rooted phone, you can run processes explicitly using (usually)
/system/xbin/su
. You can't change the uid of a program that's already running, though. (In theory you could poke at kernel memory and change all the various stored uids, but this is a really bad idea because you can't lock the things you're modifying and if they change or move you could cause a kernel panic.)不可以。如果另一个应用程序需要 root 访问权限,则它需要自行获取权限。
No. If another app needs root access it needs to gain permissions itself.
您需要使
exec bin(A)
以 root 身份运行并执行以下操作:以上都可以通过ptrace来完成。
更多信息可以在这里找到:
http://www.linuxjournal.com/node/6210/print
http://www.phrack.org/issues.html ?issue=59&id=12&mode=txt
You need make a
exec bin(A)
run as root and do:All above can be done by ptrace.
More info can be found here:
http://www.linuxjournal.com/node/6210/print
http://www.phrack.org/issues.html?issue=59&id=12&mode=txt