Method with argument of type array of array cannot be instrumented
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- java, javascript
- Lĩnh vực
- devtools
Hướng nghiên cứu
Bắt đầu trong lib/types.js, tại khu vực getArrayType(), sau đó tái hiện lỗi bằng phương thức được cung cấp TestA.array_of_array(byte[][]) và overload('[[B'). Xác minh cách tên kiểu mảng được chuyển đổi trước factory.use() và casting. Hoàn tất khi việc instrumentation thành công mà không có ClassNotFoundException và phương thức có thể được gọi thông qua Java bridge.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hello,
I run into a problem while trying to instrument methods that take an array of array of byte as argument. For exemple:
package com.example.testclassloader;
public class TestA {
public static int array_of_array(byte[][] arrays) {
int size = 0;
for (byte[] arr: arrays) {
size += arr.length;
}
return size;
}
}
[Android Emulator 5554::TestClassLoader ]-> Java.performNow(() => { })
[Android Emulator 5554::TestClassLoader ]-> TestA = Java.use("com.example.testclassloader.TestA")
"<class: com.example.testclassloader.TestA>"
[Android Emulator 5554::TestClassLoader ]-> method = TestA.array_of_array
function
[Android Emulator 5554::TestClassLoader ]-> method.argumentTypes
[
{
"className": "[[B",
"defaultValue": "0x0",
"name": "[[B",
"size": 1,
"type": "pointer"
}
]
[Android Emulator 5554::TestClassLoader ]-> method.overload('[[B').implementation = function(arrays) { s =
method(arrays); console.log(s); return s; };
function
# after triggering the method in the app:
[Android Emulator 5554::TestClassLoader ]-> Process crashed: java.lang.ClassNotFoundException: Didn't find class "[L[B;" on path: DexPathList[[dex file "/data/data/com.example.testclassloader/code_cache/.overlay/base.apk/classes3.dex", zip file "/data/app/~~NRqmDlxjA4t3ccEvxe4Qlw==/com.example.testclassloader-JhUO40ypsrxE2AIa8f1k4A==/base.apk"],nativeLibraryDirectories=[/data/app/~~NRqmDlxjA4t3ccEvxe4Qlw==/com.example.testclassloader-JhUO40ypsrxE2AIa8f1k4A==/lib/x86_64, /system/lib64, /system_ext/lib64]]
I believe the issue comes from here: https://github.com/frida/frida-java-bridge/blob/1e23abb71fd26726d59627e4da3ad8e10ba849aa/lib/types.js#L480
I think something like this could be a rough solution, but I did not manage to get frida to use patched version of frida-java-bridge:
diff --git a/lib/types.js b/lib/types.js
index 6a0f977..9b8d91f 100644
--- a/lib/types.js
+++ b/lib/types.js
@@ -477,7 +477,13 @@ function getArrayType (typeName, unbox, factory) {
}
// The type name we get is not always the correct representation of the type so we make it so here.
- const internalTypeName = '[L' + elementTypeName.replace(/\./g, '/') + ';';
+ let internalElementTypeName = '';
+ if (elementTypeName.replace[0] === '[') {
+ internalElementTypeName = elementTypeName.replace(/\./g, '/');
+ } else {
+ internalElementTypeName = 'L' + elementTypeName.replace(/\./g, '/') + ';';
+ }
+ const internalTypeName = '[' + internalElementTypeName;
try {
result.$w = factory.cast(arr, factory.use(internalTypeName), owned);
} catch (e) {
PS: Is there some documentation for running a patched java-bridge? I tried https://github.com/frida/frida-tools?tab=readme-ov-file#loading-your-custom-frida-java-bridge and failled
- Ngôn ngữ chính
- JavaScript
- Star
- 413
- Fork
- 174
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của frida/frida-java-bridge
-
Types is missing `deoptimizeMethod`Có thể đã có người làm @Electric1447 đã nhận 175 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
frida/frida-java-bridge#386 ·
-
[v7.0.11+] Process crash on accessing object["<init>"] with JVMTI availableCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
frida/frida-java-bridge#384 · 2 bình luận · 2 reaction ·
-
[Android 17] Early observations: JIT thread pool crash on attach and JNI transition frame abortsĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 12/100
frida/frida-java-bridge#411 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 42/100
frida/frida-java-bridge#409 ·
-
ensureClassInitialized() no longer initializes on ART since 7983e815 — hooks on uninitialized classes install successfully but never dispatchCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
frida/frida-java-bridge#408 ·
Tất cả issue của frida/frida-java-bridge
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
apache/rocketmq-dashboard#6610 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
ACK_WAITING HELP_WANTED UPDATE_CS
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
OWASP/CheatSheetSeries#2781 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Hermes: /ponytail off never reaches the model, the ruleset stays activeCó thể đã có người làm @szsunyuan đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
DietrichGebert/ponytail#1121 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
integrations plugin
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
mem0ai/mem0#7622 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày