Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Custom agent with Java bridge

オープン
#265 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
java, javascript, python

調査の方向性

まず、frida-python の session.create_script と script.load の呼び出しを使い、frida_java_bridge.js と issue に示されている分離されたスクリプトソースを使用して、例を再現します。ソースを連結せずに bridge の読み込みで Java.perform の動作を維持できるか調査します。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. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

frida/frida-python のほかの issue

frida/frida-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。