简体   繁体   English

Frida生成过程在Android上失败

[英]Frida spawn process failed on Android

After ran the command "frida-trace -U -i open -f com.example.hellojni" , the application HelloJni would be set up normally. 运行命令“ frida-trace -U -i open -f com.example.hellojni”后,将正常设置应用程序HelloJni。 But after I executed the fellowing python script, i got a crash. 但是,当我执行了python脚本时,我崩溃了。

device = frida.get_device_manager().enumerate_devices()[-1]
session = device.attach(device.spawn(["com.example.hellojni"]))   
ss = '''
       console.log("hello")
'''    
script = session.create_script(ss)
script.load()
session.detach()

The log "hello" showed in the console. 日志“ hello”显示在控制台中。 But the app just crashed, even the UI didn't show up. 但是该应用只是崩溃了,甚至UI也没有出现。 And the logcat printed something like these: 而logcat则打印出如下内容:

04-17 06:14:58.279: E/WindowManager(570): Starting window AppWindowToken{41e429c0 token=Token{41f753c8 ActivityRecord{41ea5dc0 u0 com.example.hellojni/.view.MainActivity t39}}} timed out
04-17 06:14:58.279: W/ActivityManager(570): Process ProcessRecord{41dffd18 16943:com.example.hellojni/u0a203} failed to attach
04-17 06:14:58.289: I/ActivityManager(570): Killing 16943:com.example.hellojni/u0a203 (adj -100): start timeout

Was my script wrong? 我的脚本错了吗? I'm using android4.4.4(dalvik mode), windows7, frida7.0.11.. Any help would be appreciated. 我正在使用android4.4.4(dalvik模式),windows7,frida7.0.11 ..任何帮助,我们将不胜感激。

Well the tool is remarkable but man they seriously need to update their docs. 不错,这个工具非常出色,但是他们确实需要更新文档。 Took me almost a week to dig into the source code trying to solve the same problem, only to find out that there's no problem at all. 我花了将近一个星期的时间来研究试图解决相同问题的源代码,却发现根本没有问题。 Just that we need to call device.resume() after everything is set. 只是在所有设置完成之后我们需要调用device.resume()。 In your case: 在您的情况下:

device = frida.get_device_manager().enumerate_devices()[-1]
pid = device.spawn(["com.example.hellojni"])
session = device.attach(pid)
ss = '''
       console.log("hello")
'''    
script = session.create_script(ss)
script.load()
device.resume(pid)
session.detach()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM