吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 2593|回复: 17
收起左侧

[Android 原创] 第十三课、frida速成:参数调用返回值

  [复制链接]
胡凯莉 发表于 2023-3-12 11:15
第十三课、frIDA速成:参数调用返回值objection定位
  • frida-ps -U |grep -i jun
  • cd .objection
  • mv objection.log  objection0221.log
  • objection -g com.example.junior  explore
  • android hooking list activities   
  • android intent launch_activity com.example.junior.ClickActivity
  • android hooking list class_methods com.example.junior.util.Utils         查看类中的方法
  • android hooking watch class_method com.example.junior.util.Utils.dip2px --dump-args --dump-backtrace --dump-return
  • objection就分析到这里 然后frida启动修改参数返回值
frida代码分析修改参数返回值function main(){
    Java.perform(function(){//java code write here
        console.log("hooking==>");
        Java.use("com.example.junior.util.Utils").dip2px.implementation = function(context,float){
            var result = this.dip2px(context,float);
            console.log("context,float==>",context,float);
            return result;
​
        }
    })
}
​
​
setImmediate(main)
  • frida -UF -l 230221.js
  • 修改代码后 Ctrl + S 立即生效
  • 加上智姐姐写的调用栈
    • console.log(Java.use("android.util.Log").getStackTraceString(Java.use("java.lang.Throwable").$new()));
    • function main(){
          Java.perform(function(){//java code write here
              console.log("hooking==>");
              Java.use("com.example.junior.util.Utils").dip2px.implementation = function(context,float){
      ​
                  return null;
      ​
              }
          })
      }
      ​
      ​
      setImmediate(main)
    • 不执行 直接返回null
  • 修改参数

  • hook的两个原则
    • 离数据越近越好
    • 离动作越近越好

  • android.widget.TextView; 是这个类中的函数
修改参数function Screen(){
    Java.perform(function(){
        Java.use("android.widget.TextView").setText.overload('java.lang.CharSequence').implementation = function(txt){
​
            var javaString = Java.use("java.lang.String")
            var newstring = javaString.$new("demoli")
​
​
            var res = this.setText(newstring)
            console.log("res======>",res)
            console.log("txt======>",txt)
            console.log(Java.use("android.util.Log").getStackTraceString(Java.use("java.lang.Throwable").$new()));
            return res;
        }
    })
}

免费评分

参与人数 11吾爱币 +19 热心值 +10 收起 理由
junjia215 + 1 + 1 用心讨论,共获提升!
qtfreet00 + 7 + 1 欢迎分析讨论交流,吾爱破解论坛有你更精彩!
chinawolf2000 + 1 + 1 热心回复!
superworker2022 + 1 + 1 热心回复!
局外人K + 1 + 1 我很赞同!
luckone + 1 + 1 谢谢@Thanks!
burpliu + 1 + 1 我很赞同!
yitiaolengshuiy + 1 我很赞同!
billsmiless + 3 + 1 如何结合完整demo讲解,更有助于我等菜鸟理解!总之谢谢
rjlly + 1 + 1 谢谢@Thanks!
walykyy + 1 + 1 感谢发布原创作品,吾爱破解论坛因你更精彩!

查看全部评分

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

78zhanghao87 发表于 2023-3-12 14:37
大佬啊,连发好几篇,佩服佩服
walykyy 发表于 2023-3-12 14:57
快乐大笨 发表于 2023-3-12 22:17
xueshanshi2 发表于 2023-3-13 09:24
hook so层的会么?
shuahtbcfff 发表于 2023-3-13 11:34
学习了,谢谢楼主
amwquhwqas128 发表于 2023-3-13 14:36
感谢分享的大佬
superworker2022 发表于 2023-3-13 19:34
系列课程的必须好好收藏~
RichChen 发表于 2023-3-14 08:59
学习了学习了,谢谢楼主
Looco 发表于 2023-3-14 10:56
涨姿势!!!!
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则 警告:本版块禁止灌水或回复与主题无关内容,违者重罚!

快速回复 收藏帖子 返回列表 搜索

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-5-2 23:01

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表