[转]PT_DENY_ATTACH
PT_DENY_ATTACH[1] 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[2]:
break ptrace
commands 1
return
continue
end
Nevertheless, since the ptrace is built inside the kernel, which the userspace interface only performs syscall 26[3], as long as your assembly code resembles
mov r0, #31
mov r1, #0
mov r2, #0
mov r3, #0
mov ip, #26
svc #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.
[转]PT_DENY_ATTACH的更多相关文章
- iOS程序 防止动态调试和代码注入
http://ruixiazun.blog.163.com/blog/static/9068791820141173588694/ iPhone真实的运行环境是没有sys/ptrace.h抛出.ptr ...
- ios 阻止GDB依附
GDB,IDE是大多数hackers的首选,阻止GDB依附到应用的常规办法是: . #import <sys/ptrace.h> . . int main(int argc, charch ...
- [转]iOS Anti-Debugging Protections
source-1: http://www.coredump.gr/articles/ios-anti-debugging-protections-part-1/ source-2: http://ww ...
- iOS安全攻防之阻止GDB依附
GDB是大多数hackers的首选,阻止GDB依附到应用的常规办法是: #import <dlfcn.h> #import <sys/types.h> typedef int ...
- 2.SDL规范文档
01.安全设计Checklist 输入验证 校验跨信任边界传递的不可信数据(策略检查数据合法性,含白名单机制等)格式化字符串时,依然要检验用户输入的合法性,避免可造成系统信息泄露或者拒绝服务 禁止向J ...
- Xcode 断点无用,也不打印输出
原来是在main.m里使用了ptrace进行反调试. ptrace是系统用来对运行中的进程进行调试和跟踪的工具,通过ptrace,可以对另一个进程实现调试跟踪.但是里面提供了一个非常有用的参数,就是P ...
- iOS 反调试
反调试主要分为两种,第一种阻止调试器附加,第二种是检测是否有调试器存在 1.ptrace是系统用来对运行中的进程进行调试和跟踪的工具,通过ptrace,可以对另一个进程实现调试跟踪.但是里面提供了一个 ...
- Hook ptrace 调试加入了ptrace函数的程序
Hook ptrace 调试加入了ptrace函数的程序 #import <substrate.h> #if !defined(PT_DENY_ATTACH)#define PT_DENY ...
- iOS - app 进行安全加固
研究了大半年逆向工程了,没在博客做记录,最近看到篇,跟自己的想法不谋而合,摘要下: 运行在越狱设备上的 iOS app,非常容易遭到破解分析,这里我列举一些可以加大破解难度的方法,希望有所帮助. 一些 ...
随机推荐
- SQL字符串转换为数组
/*一.按指定符号分割字符串,返回分割后的元素个数,方法很简单,就是看字符串中存在多少个分隔符号,然后再加一,就是要求的结果. -----rtrim(@str)去掉 @str右边的字符 ltrim(@ ...
- json 解析解乱码
1. 该法的字符编码: 串店txt文档文档都有自己的编码,例如utf-8,ansi等待,但当 存款txt文件.其编码将和txt编码文件本身一致. 例如,之前的字符编码ansi.txt该文件的编码是u ...
- google code 上源码的下载方法
SVN全称是Subversion,是Apache的一个子项目 ,具体能够到SVN中文站(http://www.subversion.org.cn/)去了解下.Google Code是Google的一个 ...
- ExtJs--15--Ext.is*各种类型推断的方法,简单看源代码就能够明确了
/** * Returns true if the passed value is empty, false otherwise. The value is deemed to be empty if ...
- IOS中 类扩展 xib
一.类扩展(class extension,匿名分类) .格式 @interface 类名 () { // 成员变量... } // 方法声明... @end .作用 > 写在.m文件中 > ...
- 学习的例子gcc+gdb+make
1 小侃GCC 在正式使用gcc之前,我们先来侃侃gcc是啥玩意儿? 历史 如今的GCC是GNU Compiler Collection的简称.既然是Collection,就是指一些工具链的集合. 最 ...
- 快速构建Windows 8风格应用1-开发工具安装及模拟器使用
原文:快速构建Windows 8风格应用1-开发工具安装及模拟器使用 本篇博文主要介绍的是开发Windows 8风格应用中常用的两个开发工具:Visual Studio 2012和Expression ...
- 关于ligerform中select与text的赋值与取值
如有下ligerform表单: var formData = [ { display: "区域", name: "QYYJ", newline: true, l ...
- Java 类的成员初始化顺序
做个简单笔录,就当是重温下基础知识. 1.先看代码: package com.test; public class Test { public static void main(String[] ar ...
- 一个极简的守护进程Bash脚本
由于最近写的Node.js程序因为一些Bug,会出现一些自动退出的问题,所以需要在它退出的时候及时发现,并重新启动 于是查阅了些资料,写了一个Bash的程序,功能十分简单,就是每隔3s判断一次处在60 ...