theos-tweak 简单认知

2022-07-26  本文已影响0人  wesk痕

一步一步学逆向
theos-tweak 应该是我们动态分析中,最为常用的工具了。 先做个简单介绍。

准备: 越狱的iPhone手机

theos的安装

从github下载theos,将theos-master文件名改为theos放在 /opt/文件下,如下:

image-20220726212035860.png

theos 使用命令:

创建工程:nic.pl

➜  ios /opt/theos/bin/nic.pl
NIC 2.0 - New Instance Creator
------------------------------
  [1.] iphone/activator_event
  [2.] iphone/activator_listener
  [3.] iphone/application_modern
  [4.] iphone/application_swift
  [5.] iphone/control_center_module-11up
  [6.] iphone/cydget
  [7.] iphone/flipswitch_switch
  [8.] iphone/framework
  [9.] iphone/library
  [10.] iphone/notification_center_widget
  [11.] iphone/notification_center_widget-7up
  [12.] iphone/preference_bundle
  [13.] iphone/preference_bundle_swift
  [14.] iphone/theme
  [15.] iphone/tool
  [16.] iphone/tool_swift
  [17.] iphone/tweak
  [18.] iphone/tweak_with_simple_preferences
  [19.] iphone/xpc_service
  [20.] iphone/xpc_service_modern
Choose a Template (required): 18
Project Name (required): bwlTest
Package Name [com.yourcompany.bwltest]: com.wesk.bwltest
Author/Maintainer Name [wujian]: weskhen
[iphone/tweak_with_simple_preferences] MobileSubstrate Bundle filter [com.apple.springboard]: com.apple.mobilenotes
[iphone/tweak_with_simple_preferences] List of applications to terminate upon installation (space-separated, '-' for none) [SpringBoard]: 
Instantiating iphone/tweak_with_simple_preferences in bwltest/...
Done.

结构对应解释:

创建的目录:

TARGET := iphone:clang:latest:7.0
# 指手机系统中的进程
INSTALL_TARGET_PROCESSES = SpringBoard

# 局域网内的手机ip地址, 默认通过USB端口
THEOS_DEVICE_IP = 10.15.48.140
#  监听端口,默认就是22
THEOS_DEVICE_PORT = 22
# 支持的架构
ARCHS = armv7 arm64

# Tweak.x文件需要的 famework 库
iOSRE_FRAMEWORKS=UIKit Foundation

include $(THEOS)/makefiles/common.mk

# 工程名
TWEAK_NAME = tphook

tphook_FILES = Tweak.x
tphook_CFLAGS = -fobjc-arc
include $(THEOS_MAKE_PATH)/tweak.mk

上面的通道,如果开发中,可以直接使用usb的,利用爱思助手等工具,一键“打开ssh通道”。

常见命令

修改Tweak.x文件之后,即可使用相关命令:

常见异常

  1. 报错:Nothing to be done for `internal-library-compile'..
    原因:之前已经编译过,有缓存导致的,需要clean一下,命令 make clean

  2. 报错:ERROR: package name has characters that aren't lowercase alphanums or '-+.'.
    原因:Package Name : 需要小写, com.wesk.appleBWL 不符合规范,需要改成小写,😁

上一篇 下一篇

猜你喜欢

热点阅读