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

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 3643|回复: 2
上一主题 下一主题
收起左侧

[Android 求助] 使用frida进行hook安卓的appliation,无法实现请指教

[复制链接]
跳转到指定楼层
楼主
01jiangwei01 发表于 2021-7-20 20:29 回帖奖励


问题:




   使用frIDA进行hook安卓的appliation,无法实现请指教

准备材料:




   1:迅雷安装包
   2:frida
  3 : 雷电模拟器启动

执行步骤:




   1:启动frida_server
   2: pc的cmd窗口执行名利>frida -U -f com.xunlei.downloadprovider
   3 :   启动脚本.脚本见下文。
   4:   第二步的窗口上输入>%resume

报错




   [Android Emulator 5554::com.xunlei.downloadprovider]-> Process crashed: Bad access due to invalid address

***
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'google/android_x86/x86:7.1.2/N2G47H/N975FXXU1ASGO:/release-keys'
Revision: '0'
ABI: 'x86'
pid: 3500, tid: 3500, name: re-initialized>  >>> <pre-initialized> <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x10
    eax 00000000  ebx 00000dac  ecx 00000dac  edx 0000000b
    esi cfff9bcc  edi cfff9960
    xcs 00000073  xds 0000007b  xes 0000007b  xfs 0000003b  xss 0000007b
    eip c7f29c10  ebp cfff99e0  esp cfff98f8  flags 00000296

backtrace:
    #00 pc 00000c10  [vdso:c7f29000] (__kernel_vsyscall+16)
    #01 pc 0007fc08  /system/bin/linker (__dl_syscall+40)
    #02 pc 000046d1  /system/bin/linker (__dl__ZL24debuggerd_signal_handleriP7siginfoPv+1201)
    #03 pc 0000b7fd  /system/bin/app_process32_xposed (InvokeUserSignalHandler+317)
    #04 pc 000ff441  /system/lib/libart.so (offset 0x10a000)
***
解决方案:




      暂无,求指教

本地调试脚本




      
[Python] 纯文本查看 复制代码
# -*- coding: utf-8 -*-import os
import sys
import frida

def connect_device(timeout=15):
    try:
        device = frida.get_usb_device(timeout=timeout)
    except:
        device = frida.get_remote_device()
    return device

def forward_frida():
    os.system("adb forward tcp:27042 tcp:27042")
    os.system("adb forward tcp:27043 tcp:27043")

jscodev2 = """
if (Java.available) {
        console.log("1111");
        console.log("hello-log");
        console.warn("hello-warn");
        console.error("hello-error");

     Java.perform(function(){
            var application = Java.use('com.xunlei.downloadprovider.MyWrapperProxyApplication');
            application.initProxyApplication.implementation = function(context){
            
                console.log("开始执行initProxyApplication方法");
                
                console.log("调用方法 context.getApplicationInfo().sourceDir");
                //var instance = application.$new();
                 var sourceDir=  context.getApplicationInfo().sourceDir
                 console.log("调用方法 sourceDir="+sourceDir);
                 this.initProxyApplication(context);
                
                console.log("执行initProxyApplication方法结束");
        }
           var cName =  WrapperProxyApplication.className;
           send("cName="+cName)
           console.log("cName="+cName); 


      });

}else{
    console.log("Java 不可用");    
}

"""

if __name__ == "__main__":
    try:
        device = connect_device()
        if not device:
            raise Exception("Unable to connect.")
    except:
        forward_frida()
        device = connect_device()
    if not device:
        print("[Except] - Unable to connect to device.", bg='red')
        exit()
    session = device.attach('com.xunlei.downloadprovider')

    script = session.create_script(jscodev2)
    script.load()
    print('[*]附着成功')
    # 等待人工输入
    sys.stdin.read()

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

沙发
csgowdnmd 发表于 2021-9-28 16:15
请问解决了吗?
3#
Blue_L 发表于 2021-10-9 02:32
您需要登录后才可以回帖 登录 | 注册[Register]

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

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

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

GMT+8, 2024-6-7 12:46

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

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