博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[转]PT_DENY_ATTACH
阅读量:5058 次
发布时间:2019-06-12

本文共 982 字,大约阅读时间需要 3 分钟。

PT_DENY_ATTACH is an Apple-specific constant that can prevent debuggers (gdb, DTrace, etc.) from debugging your binary in kernel-level. Calling

ptrace(PT_DENY_ATTACH, 0, 0, 0);

will send a SEGFAULT to its tracing parent. Nevertheless, since ptrace has a well-defined address, a simple GDB macro is enough to break this:

break ptracecommands 1   return   continueend

Nevertheless, since the ptrace is built inside the kernel, which the userspace interface only performs syscall 26, as long as your assembly code resembles

mov r0, #31mov r1, #0mov r2, #0mov r3, #0mov ip, #26svc #0x80

the PT_DENY_ATTACH will be installed and there is no way GDB can workaround it. The cracker can still use patching techniques to nop out the svn #0x80 instructions, but checksumming would help in these cases. Also make sure you don't compile your binary in thumb, cause the compiler will fail due to limited availability of registers in thumb mode.

转载于:https://www.cnblogs.com/Proteas/p/3159123.html

你可能感兴趣的文章
IE11浏览器中的My97日历控件刷新后无法打开问题解决办法
查看>>
会话保持:粘滞会话
查看>>
Git免密码提交
查看>>
Android手机外置SD卡(TF卡)的获取方法
查看>>
LeetCode 132. 分割回文串 II(Palindrome Partitioning II)
查看>>
关于PHP的引用赋值
查看>>
软件工程第三次作业
查看>>
默慈金数
查看>>
24、java操作xml方法
查看>>
hdu 1879 继续畅通project
查看>>
java 使用LinkedList模拟一个堆栈或者队列数据结构
查看>>
调整GDI显示方向
查看>>
node 单个表加条件查询
查看>>
单例模式
查看>>
Sublime Text 3 绝对神器
查看>>
enableEventValidation
查看>>
[GO]ticker的使用
查看>>
Linux限制端口
查看>>
C++变量初始化
查看>>
node学习心得
查看>>