通过在 Xcode 里的 Other Linker Flags 设置参数,可以防止App被注入dylib(仅限于iOS 10 以下系统)  比如,某艺,XX音乐等

dylib无法注入,也就意味着没办法用cycript动态调试App,只能干瞪眼

Other Linker Flags 参数

-Wl,-sectcreate,__RESTRICT,__restrict,/dev/null

通过阅读dyld源代码,我们可以得知其大概原理

static ImageLoader* loadPhase3(const char* path, const char* orgPath, const LoadContext& context, std::vector<const char*>* exceptions)
{
ImageLoader* image = NULL;
if ( strncmp(path, "@executable_path/", ) == ) {
// executable_path cannot be in used in any binary in a setuid process rdar://problem/4589305
if ( sProcessIsRestricted )
throwf("unsafe use of @executable_path in %s with restricted binary", context.origin);
}
else if ( (strncmp(path, "@loader_path/", ) == ) && (context.origin != NULL) ) {
// @loader_path cannot be used from the main executable of a setuid process rdar://problem/4589305
if ( sProcessIsRestricted && (strcmp(context.origin, sExecPath) == ) )
throwf("unsafe use of @loader_path in %s with restricted binary", context.origin);
}
else if (sProcessIsRestricted && (path[] != '/' )) {
throwf("unsafe use of relative rpath %s in %s with restricted binary", path, context.origin);
} return loadPhase4(path, orgPath, context, exceptions);
}

当dylib加载路径是以 @executable_path、@loader_path 或者不是以 '/'开头,则会抛出异常使进程结束。

针对以上情况,分享一个修改__RESTRICT命令的工具,原理是将Mach-O文件中的 RESTRICT命令改为 SESTRICT,使该命令因为无法识别而失效。

github源码地址

使用

./AAntiCrack --replace-restrict  <应用可执行文件mach-o>

此工具还有注入dylib功能,将dylib与mach-o放在同一目录下,然后执行

./AAntiCrack --replace-restrict -i dylib路径 <应用可执行文件mach-o>

即可实现动态库注入,与反反注入

相关链接:

  http://bbs.iosre.com/t/tweak-app-app-tweak/438

iOS 反反注入 修改__RESTRICT,__restrict工具的更多相关文章

  1. 将JAR包反编译,修改后重新打包(转)

     将JAR包反编译,修改后重新打包(转)   在学习和开发JAVA项目中,我们经常会用到第三方提供的一些jar.使用这些第三方工具包,可以提高我们开发的效率,缩短开发的时间.有的第三方工具,提供具体的 ...

  2. Atitit.项目修改补丁打包工具 使用说明

    Atitit.项目修改补丁打包工具 使用说明 1.1. 打包工具已经在群里面.打包工具.bat1 1.2. 使用方法:放在项目主目录下,执行即可1 1.3. 打包工具的原理以及要打包的项目列表1 1. ...

  3. Referer反反盗链

    0x00 前言 最近用Python非常多,确实感受到了Python的强大与便利.但同时我并没有相见恨晚的感觉,相反我很庆幸自己没有太早接触到Python,而是基本按着C→C++→Java→Python ...

  4. 反反爬虫 IP代理

    0x01 前言 一般而言,抓取稍微正规一点的网站,都会有反爬虫的制约.反爬虫主要有以下几种方式: 通过UA判断.这是最低级的判断,一般反爬虫不会用这个做唯一判断,因为反反爬虫非常容易,直接随机UA即可 ...

  5. 爬虫(Spider),反爬虫(Anti-Spider),反反爬虫(Anti-Anti-Spider)

    爬虫(Spider),反爬虫(Anti-Spider),反反爬虫(Anti-Anti-Spider),这之间的斗争恢宏壮阔... Day 1小莫想要某站上所有的电影,写了标准的爬虫(基于HttpCli ...

  6. selenium + chrome 被检测,反反爬小记

    selenium + chrome 很多难以采集的网站都使用selenium爬取,但是后来发现selenium有特征值,会被检测出来,今天来小结一下反反爬方案 测试网站 全绿好像代表没被检测出 中间人 ...

  7. python爬虫---详解爬虫分类,HTTP和HTTPS的区别,证书加密,反爬机制和反反爬策略,requests模块的使用,常见的问题

    python爬虫---详解爬虫分类,HTTP和HTTPS的区别,证书加密,反爬机制和反反爬策略,requests模块的使用,常见的问题 一丶爬虫概述       通过编写程序'模拟浏览器'上网,然后通 ...

  8. scrapy反反爬虫

    反反爬虫相关机制 Some websites implement certain measures to prevent bots from crawling them, with varying d ...

  9. scrapy反反爬虫策略和settings配置解析

    反反爬虫相关机制 Some websites implement certain measures to prevent bots from crawling them, with varying d ...

随机推荐

  1. docker安装总结 linux红帽系列

    由于Docker限制分为两个版本CE和EE,所以之前yum里面的docker是老版本,需要先进行卸载,现在的包名叫做docker-ce yum remove docker docker-common ...

  2. docker之构建redis-cluster集群

    下载和编译redis安装包 参考:https://www.cnblogs.com/cwp-bg/p/8094914.html # 从官方网站下载安装包,注意,当前在哪个目录下执行命令,下载的包将在哪个 ...

  3. caffe Python API 之上卷积层(Deconvolution)

    对于convolution: output = (input + 2 * p  - k)  / s + 1; 对于deconvolution: output = (input - 1) * s + k ...

  4. 安装sudo apt-get install ros-kinetic-desktop-full,报错mv: 无法获取'/var/lib/ni/licenses.xml.dpkg-old' 的文件状态(stat): 没有。。。。

    安装sudo apt-get install ros-kinetic-desktop-full,报了一堆错误 mv: 无法获取'/var/lib/ni/licenses.xml.dpkg-old' 的 ...

  5. LightOJ 1410 Consistent Verdicts(找规律)

    题目链接:https://vjudge.net/contest/28079#problem/Q 题目大意:题目描述很长很吓人,大概的意思就是有n个坐标代表n个人的位置,每个人听力都是一样的,每人发出一 ...

  6. Android项目包命名规则是怎样的?

    com.example.app.activity | Activity 类com.example.app.widget | 自定义的小UIcom.example.app.db | 数据库相关操作com ...

  7. WPF 获取计算机字体

    //加载计算机上可用的字体 public void LoadFonts(object ietfLanguageTag) { try { var sysFonts = Fonts.SystemFontF ...

  8. Lr中脚本的迭代次数和场景运行时间的关系

    Loadrunner中脚本的迭代次数和场景运行时间的关系 LR 的Vugen和controller中迭代是这样的: 当场景的持续时间为“运行至结束”时,以Vugen中设置的迭代次数为准 当场景的持续时 ...

  9. 查看loadrunner代码行号

    运行前报错,如Syntax error on line 133 near ";"那么如何查看代码的行号呢?解决方法:看代码行号时,直接将鼠标在代码的某处单击,在窗体的最下方右侧能看 ...

  10. Check whether a + b = c or not after removing all zeroes from a,b and c

    Check whether a + b = c or not after removing all zeroes from a,b and c Given two integers a and b, ...