putCallout中传递有名的独立函数会导致崩溃

  • 问题概述

    • 给putCallout传递函数:
      • 传递有名的独立的函数:会导致崩溃
      • 传递匿名的函数:就可以正常运行
  • 详解

Frida的Stalker的transform中去写putCallout代码

如果把putCallout写成是传入一个独立的js函数

transform: function (iterator) {
...
    if (curOffsetInt == 8516) {
        iterator.putCallout(needDebug);
    }
}

...
      function needDebug (context) {
          console.log("into needDebug: context=" + context);
          ...
      }

->就会导致此处出现崩溃:

。。。
Process terminated

Thank you for using Frida!
Fatal Python error: _enter_buffered_busy: could not acquire lock for <_io.BufferedReader name='<stdin>'> at interpreter shutdown, possibly due to daemon threads
Python runtime state: finalizing (tstate=0x000000010308e0c8)

Current thread 0x00000001f4ab4140 (most recent call first):
  <no Python frame>

而如果改为:js匿名名函数

transform: function (iterator) {
...
    if (curOffsetInt == 8516) {
        // iterator.putCallout(needDebug);
        iterator.putCallout((context) => {
            console.log("into needDebug: context=" + context);
        });
    }
}

就不会崩溃

很是诡异。暂时不清楚具体原因。

  • 心得:Frida中对于js的支持,还是不够完善
    • 容易遇到一些诡异的bug

results matching ""

    No results matching ""