Batch tracking method call records of objc

2014/09/01 14:18
Reading number 394

Ios objc method call record plug-in: itrace v1.2

If you want to reverse the calling process of some apps or the private framework class api calling process of some functions of the system app, you can try this tool

You only need to configure the class name and app name to be hooked, and you can track the calling process of related functions in real time. Support batch hook n multiple class names

characteristic:

  • Batch tracking all calling processes of the specified class object under ios
  • Supports ios for armv6, armv7, arm64 and mac for x86, x64
  • Automatically detect parameter types and print details of all parameters

Updated content:

  • The support for arm64 is added, and the stability of just tuning needs to be tested. The arm64 process injection has no time to do, so we temporarily use the hook process of the substrate. So you need to install the version of libsubstrate.dylib armv7 that is completely independent of the substrate.

  • The arm64 version has slightly enhanced the printing of parameter information.

Note: This item is no longer maintained and is only for reference.

  1. Configure the classes to be attached

    Modify the itrace.xml configuration file and add the name of the class to hook:

    <? xml version="1.0" encoding="utf-8"?>

    <itrace> <class> <SSDevice/> <SSDownload/> <SSDownloadManager/> <SSDownloadQueue/> <CPDistributedMessagingCenter/> <CPDistributedNotificationCenter/> <NSString args="0"/> </class> </itrace>

    Note: Try not to hook classes that are frequently called, such as UIView NSString. Otherwise, they will be stuck and the operation will be inconvenient. Note: If a class is attached and the print parameter information is hung halfway, you can add the args="0" attribute after the corresponding class name to prohibit the print of parameter information, which will stabilize. If you want all classes not to print parameter information, you can directly set:<class args="0">

  2. install files

    Upload all files in the entire itracer directory to the/tmp directory on the ios system using the mobile assistant tool:/tmp/tracer/tmp/trace.dylib/tmp/trace.xml

  3. Trace

    Enter the directory where itrace is located: cd/tmp

    Modify execution permission: chmod 777/ itracer

    Run program:

    ./tracer springboard (springboard is the name of the process to be hooked, and supports simple fuzzy matching)

  4. View the trace log. Note: the actual output of the log is in the Xcode Windows menu Organizer Console:

    Jan 21 11:12:58 unknown SpringBoard[5706] <Warning>: [itrace]: [3edc9d98]: [SSDownloadQueue downloads] Jan 21 11:12:58 unknown SpringBoard[5706] <Warning>: [itrace]: [3edc9d98]: [SSDownloadManager downloads] Jan 21 11:12:58 unknown SpringBoard[5706] <Warning>: [itrace]: [3edc9d98]: [SSDownloadManager _copyDownloads] Jan 21 11:12:58 unknown SpringBoard[5706] <Warning>: [itrace]: [3edc9d98]: [SSDownloadQueue _sendDownloadStatusChangedAtIndex:]: 0 Jan 21 11:12:58 unknown SpringBoard[5706] <Warning>: [itrace]: [3edc9d98]: [SSDownloadQueue _messageObserversWithFunction:context:]: 0x334c5d51: 0x2fe89de0 Jan 21 11:12:58 unknown SpringBoard[5706] <Warning>: [itrace] : [3edc9d98]: [SSDownloadQueue downloads] Jan 21 11:12:58 unknown SpringBoard[5706] <Warning>: [itrace]: [3edc9d98]: [SSDownloadManager downloads] Jan 21 11:12:58 unknown SpringBoard[5706] <Warning>: [itrace]: [3edc9d98]: [SSDownloadManager _copyDownloads] Jan 21 11:12:58 unknown SpringBoard[5706] <Warning>: [itrace]: [3edc9d98] : [SSDownload cachedApplicationIdentifier] Jan 21 11:12:58 unknown SpringBoard[5706] <Warning>: [itrace]: [3edc9d98]: [SSDownload status] Jan 21 11:12:58 unknown SpringBoard[5706] <Warning>: [itrace]: [3edc9d98]: [SSDownload cachedApplicationIdentifier] Jan 21 11:12:58 unknown SpringBoard[5706] <Warning>: [itrace]: [3edc9d98] : [CPDistributedNotificationCenter postNotificationName:userInfo:]: SBApplicationNotificationStateChanged: { SBApplicationStateDisplayIDKey = "com.apple.AppStore"; SBApplicationStateKey = 2; SBApplicationStateProcessIDKey = 5868; SBMostElevatedStateForProcessID = 2; } Jan 21 11:12:58 unknown SpringBoard[5706] <Warning>: [itrace]: [3edc9d98]: [CPDistributedNotificationCenter postNotificationName:userInfo:toBundleIdentifier:] : SBApplicationNotificationStateChanged: { SBApplicationStateDisplayIDKey = "com.apple.AppStore"; SBApplicationStateKey = 2; SBApplicationStateProcessIDKey = 5868; SBMostElevatedStateForProcessID = 2; }: null Jan 21 11:12:59 unknown SpringBoard[5706] <Warning>: [itrace]: [105d7000]: [SSDownloadManager _handleMessage:fromServerConnection:]: 0xe6920b0: 0xe007040 Jan 21 11:12:59 unknown SpringBoard[5706] <Warning>: [itrace]: [105d7000] : [SSDownloadManager _handleDownloadStatesChanged:]: 0xe6920b0 Jan 21 11:12:59 unknown SpringBoard[5706] <Warning>: [itrace]: [105d7000]: [SSDownloadManager _copyDownloads] Jan 21 11:12:59 unknown SpringBoard[5706] <Warning>: [itrace]: [105d7000]: [SSDownload persistentIdentifier] Jan 21 11:12:59 unknown SpringBoard[5706] <Warning>: [itrace] : [105d7000]: [SSDownload _addCachedPropertyValues:]: { I = SSDownloadPhaseDownloading; } Jan 21 11:12:59 unknown SpringBoard[5706] <Warning>: [itrace]: [105d7000]: [SSDownload _applyPhase:toStatus:]: SSDownloadPhaseDownloading: <SSDownloadStatus: 0xe6b8e80> Jan 21 11:12:59 unknown SpringBoard[5706] <Warning>: [itrace]: [105d7000] : [SSDownloadQueue downloadManager:downloadStatesDidChange:]: <SSDownloadManager: 0x41ea60>: ( "<SSDownload: 0xe6bd970>: -4085275246093726486" )

Source code: https://github.com/waruqi/itrace

Expand to read the full text
Loading
Click to lead the topic 📣 Post and join the discussion 🔥
Reward
zero comment
zero Collection
zero fabulous
 Back to top
Top