V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
senlinmuvs
V2EX  ›  问与答

frida rcp 调用 android app 中的函数无正常返回

  •  
  •   senlinmuvs · 9 天前 · 156 次点击

    java code by jadx:

    public void getUnifiedSign(...) {
    ...
       try {
    ...
          //这个接口的实现类在 jadx 中找不到,应该是在.so 中了
          HashMap<String, String> securityFactors = this.mUnifiedSign.getSecurityFactors(hashMap3);
          if (securityFactors != null && !securityFactors.isEmpty()) {
             return securityFactors;
          }
          TBSdkLog.e(...);
          return null;
    ...
       } catch (Throwable th) {
          TBSdkLog.e("mtopsdk.InnerSignImpl", getInstanceId() + " [getUnifiedSign]get sign failed exception ,appKeyIndex=" + this.mtopConfig.appKeyIndex + ",authCode=" + this.mtopConfig.authCode, th);
          return null;
       }
    }
    

    hook.js

    rpc.exports = {
        sign:function() {
            Java.perform(function() {
                reSign0();
                sign0();
            })
        }
    };
    function reSign0() {
       //这里重写了 getUnifiedSign 是能把入参和出参打印出来的
    }
    function sign0() {
    ...
        let resp = isi.getUnifiedSign(p1, p2, p3, p4, p5, p6);
        //the resp is null
    ...
    }
    }
    

    Frida RCP 调用 getUnifiedSign 总是返回 null ,确认代码已经到达了这个 getSecurityFactors ,但可能直接报错导致返回 null 。但是如果是报错,应该会走到下面的 catch ,并且会输出日志,但是没有日志。日志 hook 已经验证过没有问题,当传一些不正常参数时 hook 的日志能打出来。 敢问如何排查这个问题?和这个鬼杠上了,参考过其它帖子的旧版本弄过但也没成功,还是弄这个最新版的。

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2554 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 13:59 · PVG 21:59 · LAX 06:59 · JFK 09:59
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.