美文网首页
ios逆向之theos安装和入门

ios逆向之theos安装和入门

作者: zhd______ | 来源:发表于2021-03-20 13:32 被阅读0次

准备:

苹果电脑
已越狱的苹果手机(我准备的是一台6s,咸鱼上买的)

开始

  1. 将mac更新10.9以上的系统
  2. 下载xcode
xcode-select --install
  1. 升级一下brew
brew update
  1. 安装theos
    https://github.com/theos/theos/wiki/Installation-macOS
    直接参加文档上的步骤
brew install ldid xz

设置环境变量(官方)

 echo "export THEOS=~/theos" >> ~/.zprofile

以下是我的mac设置命令(根据自己的mac系统版本选择)
如果您使用的是macOS 10.14或更早版本,请更改~/.zprofile 为~/.profile。

 echo "export THEOS=~/theos" >> ~/.profile

还需要将theos/bin目录加入到PATH中,方便执行nic.pl创建项目的命令

echo "export PATH=$THEOS/bin:$PATH" >> ~/.profile

运行以下命令或者重启Shell使环境变量生效

source  ~/.profile # 或者 source  ~/.zprofile

克隆到本地

 git clone --recursive https://github.com/theos/theos.git $THEOS

由于国内网络原因
这一步容易踩很多坑,我也是搞了两天才弄好
如果抛出以下错误:

fatal: unable to access 'https://github.com/theos/*.git/': OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443

这个时候我们可以将https替换成git

 git clone --recursive git://github.com/theos/theos.git $THEOS

由于克隆theos时它所需要的依赖也会下载下来,这一步也容易出现网络错误,而且无论怎么重试可能都下载不下来。这个时候我们可以进入theos/vendor目录手动clone下来

cd $THEOS/vendor 
git clone git://github.com/theos/dm.pl.git
git clone git://github.com/theos/headers.git/ include # 这一步需要将headers改成include,其他的依赖直接用默认名称就可以
git clone git://github.com/theos/lib.git
git clone git://github.com/theos/logos.git
git clone git://github.com/theos/nic.git
git clone git://github.com/theos/templates.git

sdk下载(比较大,需要等一会)

 curl -LO https://github.com/theos/sdks/archive/master.zip
 TMP=$(mktemp -d)
 unzip master.zip -d $TMP
 mv $TMP/sdks-master/*.sdk $THEOS/sdks
 rm -r master.zip $TMP

也可以手动下载下来解压将里面的内容拷贝到theos/sdks目录下

以上步骤基本就完成了theos安装,如果这一步有遇到问题可以在评论区留言

  1. 创建theos
    下面再来说一下创建,运行一下命令
nic.pl

输入15选择 iphone/tweak


image.png

创建完成之后


image.png

control 应用的一些信息Package包名、Name插件名等一些信息
demo04.plist 需要hook应用的BundleID,目前测试应该是可以填写多个BundleID
Makefile 一般修改这个文件比较多
Tweak.x 编写代码的文件,可以编写Logos语法http://iphonedevwiki.net/index.php/Logos

安装先使用爱思助手-工具箱-打开SSH通道
如果连接多台每次需要删除清空known_hosts
位置:/Users/${用户名}/.ssh/known_hosts

make  # 编译
make package  #打包
make install  #安装

相关文章

网友评论

      本文标题:ios逆向之theos安装和入门

      本文链接:https://www.haomeiwen.com/subject/tfsncltx.html