0

我正在尝试使用Frida开发测试工具。最近我尝试使用文档中的代码片段来记录回溯:

Interceptor.attach(Module.findExportByName(null, 'open'), {
onEnter: function (args) {
    var path = Memory.readUtf8String(args[0]);
    console.log("open" + path + ")\n\t" + Thread.backtrace(this.context, Backtracer.ACCURATE).map(DebugSymbol.fromAddress).join("\n") + "\n");
}

});

但是我们尝试使用我的应用程序(MyApp)运行脚本,我得到了这些:

open/var/mobile/Containers/Data/Application/E459A8E1-12D5-4E20-8F99-40CA90967C0B/Library/Caches/XXXX/XXXX.plist)
0x1ce3140f Foundation!_NSReadBytesFromFileWithExtendedAttributes
0x1ce356c7 Foundation!-[NSData(NSData) initWithContentsOfFile:options:error:]
0x1cecf0c1 Foundation!+[NSKeyedUnarchiver unarchiveObjectWithFile:]
0x534293 MyApp!0x4f0293
0x5341f5 MyApp!0x4f01f5
0x53450d MyApp!0x4f050d
0x53360f MyApp!0x4ef60f
0x5346b9 MyApp!0x4f06b9
0x8b4473 MyApp!0x870473
0xb81ecb MyApp!0xb3decb
0xb82225 MyApp!0xb3e225
0xb823bf MyApp!0xb3e3bf
0xb3974d MyApp!0xaf574d
0xb00533 MyApp!0xabc533
0x48039 MyApp!0x4039
0x218595c5 UIKit!-[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:]

你可以看到

DebugSymbol.fromAddress

可以表示 的地址Foundation,但MyApp它失败了。

视频 19:33可以看出,DebugSymbol.fromAddress 可以符号化目标应用的地址。

我正在使用Frida 11.0.12设备是 iPhone 5,iOS10.3.3 使用 h3lix-RC5 破解

有人也遇到这个问题吗?

4

1 回答 1

0

要重现您的问题,我将需要 IPA,或者至少nm -DC在 MyApp mach0 文件上输出。

此外,您粘贴的脚本存在问题,path是 中的第一个元素args,它是一个地址,它是对字符串的引用,args 是一个包含(非有限)参数的数组。

$ frida -U Telegram
     ____
    / _  |   Frida 11.0.11 - A world-class dynamic instrumentation toolkit
   | (_| |
    > _  |   Commands:
   /_/ |_|       help      -> Displays the help system
   . . . .       object?   -> Display information about 'object'
   . . . .       exit/quit -> Exit
   . . . .
   . . . .   More info at http://www.frida.re/docs/home/

[iOS Device::Telegram]->     Interceptor.attach(Module.findExportByName(null, "open"), {
                                 onEnter: function (args) {
                                     console.log("open " + Memory.readUtf8String(args[0]));
                                     console.log(Thread.backtrace(this.context, Backtracer.ACCURATE).map(DebugSymbol.fromAddress).join
("\n"));
                                 }
                             });
{}
[iOS Device::Telegram]-> open /private/var/mobile/Containers/Shared/AppGroup/1E33CAF6-1422-.../Documents/network-usage
0x10109a8ec Telegram!0x102a8ec
0x1822bd4bc libdispatch.dylib!_dispatch_call_block_and_release
0x1822bd47c libdispatch.dylib!_dispatch_client_callout
0x1822c94c0 libdispatch.dylib!_dispatch_queue_drain
0x1822c0f80 libdispatch.dylib!_dispatch_queue_invoke
0x1822cb390 libdispatch.dylib!_dispatch_root_queue_drain
0x1822cb0b0 libdispatch.dylib!_dispatch_worker_thread3
0x1824d5470 libsystem_pthread.dylib!_pthread_wqthread
open /private/var/mobile/Containers/Data/Application/3ED4C762-597B-.../Library/Cookies/Cookies.binarycookies
0x182777dec CoreFoundation!fileOpen
0x182767eb8 CoreFoundation!_CFStreamOpen
0x182777d14 CoreFoundation!CFReadStreamOpen
0x182e578d0 CFNetwork!DiskCookieStorage::readFileToCookies(MemoryCookies*)
于 2018-06-24T08:22:42.943 回答