Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Custom agent with Java bridge

未关闭
#265 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞

调研方向

首先使用 frida-python 的 session.create_script 和 script.load 调用,结合 frida_java_bridge.js 以及 issue 中展示的独立脚本源,复现该示例。调查在不拼接源代码的情况下,加载 bridge 是否能够保留 Java.perform 的行为。完成标准是:自定义 agent 在 bridge 单独加载的情况下能够正常工作,并且用户脚本中的错误仍保留有用的行号。

由索引模型根据 Issue 内容生成。

描述

Hi,
So with Frida 17, runtime bridges, such as the Java runtime bridge, must be added manually to a custom agent script.

This works for me when concatenating the bridge code with whatever other Frida script I want to load, and then calling script.load from python.
The problem is that it's harder to debug bugs in a Frida script, when the error message points to line ~13'000, because the buggy Frida script was appended to the bridge script. Is there a way to load the bridge script separately?

The following script shows the problem:

import frida
import os
import time

process = "SOME APP"
device = frida.get_usb_device()

pid = device.get_process(process).pid

session = device.attach(pid)

with open('/home/user/frida_java_bridge.js', 'r') as bridgefile:
    bridge_source = bridgefile.read()

script1_source = """
console.log('hello form script1')
"""

script2_source = """
console.log('hello form script2a');
Java.perform(function() {console.log('inside Java runtime')});
console.log('hello form script2b');
"""

bridge= session.create_script(bridge_source)
script1 = session.create_script(script1_source)
script2 = session.create_script(script2_source)

print("one by one:")

bridge.load()
script1.load()
script2.load()

print("concatenated:")
script3 = session.create_script(bridge_source + script2_source)
script3.load()

output:

one by one:
hello form script1
hello form script2a

concatenated:
hello form script2a
inside Java runtime
hello form script2b
主要语言
Python
星标
873
派生
173
PR 合并指标
30 天内没有已合并 PR

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

frida/frida-python 的其他 Issue

查看 frida/frida-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。