frida-java-bridge 5.0.0 → 5.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/android.d.ts +33 -0
- package/lib/android.js +21 -1
- package/lib/env.js +4 -0
- package/package.json +3 -2
package/lib/android.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export function getApi(): Api;
|
|
2
|
+
export function withRunnableArtThread(vm: VM, env: Env, callback: (thread: Thread) => void): void;
|
|
3
|
+
export function translateMethod(methodId: NativePointerValue): NativePointer;
|
|
4
|
+
|
|
5
|
+
export class ArtStackVisitor {
|
|
6
|
+
constructor(thread: Thread, context: Context, walkKind: WalkKind, numFrames?: number, checkSuspended?: boolean);
|
|
7
|
+
walkStack(includeTransitions?: boolean): void;
|
|
8
|
+
getMethod(): ArtMethod | null;
|
|
9
|
+
getCurrentQuickFramePc(): NativePointer;
|
|
10
|
+
getCurrentQuickFrame(): NativePointer;
|
|
11
|
+
getCurrentShadowFrame(): NativePointer;
|
|
12
|
+
describeLocation(): string;
|
|
13
|
+
getCurrentOatQuickMethodHeader(): NativePointer;
|
|
14
|
+
getCurrentQuickFrameInfo(): QuickFrameInfo;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export type WalkKind = "include-inlined-frames" | "skip-inlined-frames";
|
|
18
|
+
|
|
19
|
+
export interface ArtMethod extends ObjectWrapper {
|
|
20
|
+
prettyMethod(withSignature?: boolean): string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface QuickFrameInfo {
|
|
24
|
+
frameSizeInBytes: number;
|
|
25
|
+
coreSpillMask: number;
|
|
26
|
+
fpSpillMask: number;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type Api = any;
|
|
30
|
+
export type VM = any;
|
|
31
|
+
export type Env = any;
|
|
32
|
+
export type Thread = any;
|
|
33
|
+
export type Context = any;
|
package/lib/android.js
CHANGED
|
@@ -1541,7 +1541,7 @@ set_replacement_method (gpointer original_method,
|
|
|
1541
1541
|
g_mutex_lock (&lock);
|
|
1542
1542
|
|
|
1543
1543
|
g_hash_table_insert (methods, original_method, replacement_method);
|
|
1544
|
-
|
|
1544
|
+
g_hash_table_insert (replacements, replacement_method, original_method);
|
|
1545
1545
|
|
|
1546
1546
|
g_mutex_unlock (&lock);
|
|
1547
1547
|
}
|
|
@@ -1563,6 +1563,20 @@ delete_replacement_method (gpointer original_method)
|
|
|
1563
1563
|
g_mutex_unlock (&lock);
|
|
1564
1564
|
}
|
|
1565
1565
|
|
|
1566
|
+
gpointer
|
|
1567
|
+
translate_method (gpointer method)
|
|
1568
|
+
{
|
|
1569
|
+
gpointer translated_method;
|
|
1570
|
+
|
|
1571
|
+
g_mutex_lock (&lock);
|
|
1572
|
+
|
|
1573
|
+
translated_method = g_hash_table_lookup (replacements, method);
|
|
1574
|
+
|
|
1575
|
+
g_mutex_unlock (&lock);
|
|
1576
|
+
|
|
1577
|
+
return (translated_method != NULL) ? translated_method : method;
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1566
1580
|
gpointer
|
|
1567
1581
|
find_replacement_method_from_quick_code (gpointer method,
|
|
1568
1582
|
gpointer thread)
|
|
@@ -1691,6 +1705,7 @@ on_leave_gc_concurrent_copying_copying_phase (GumInvocationContext * ic)
|
|
|
1691
1705
|
get: new NativeFunction(cm.get_replacement_method, 'pointer', ['pointer'], fastOptions),
|
|
1692
1706
|
set: new NativeFunction(cm.set_replacement_method, 'void', ['pointer', 'pointer'], fastOptions),
|
|
1693
1707
|
delete: new NativeFunction(cm.delete_replacement_method, 'void', ['pointer'], fastOptions),
|
|
1708
|
+
translate: new NativeFunction(cm.translate_method, 'pointer', ['pointer'], fastOptions),
|
|
1694
1709
|
findReplacementFromQuickCode: cm.find_replacement_method_from_quick_code
|
|
1695
1710
|
},
|
|
1696
1711
|
getOatQuickMethodHeaderImpl,
|
|
@@ -1793,6 +1808,10 @@ function makeMethodMangler (methodId) {
|
|
|
1793
1808
|
return new MethodMangler(methodId);
|
|
1794
1809
|
}
|
|
1795
1810
|
|
|
1811
|
+
function translateMethod (methodId) {
|
|
1812
|
+
return artController.replacedMethods.translate(methodId);
|
|
1813
|
+
}
|
|
1814
|
+
|
|
1796
1815
|
function revertGlobalPatches () {
|
|
1797
1816
|
patchedClasses.forEach(entry => {
|
|
1798
1817
|
entry.vtablePtr.writePointer(entry.vtable);
|
|
@@ -4045,6 +4064,7 @@ module.exports = {
|
|
|
4045
4064
|
ArtStackVisitor,
|
|
4046
4065
|
ArtMethod,
|
|
4047
4066
|
makeMethodMangler,
|
|
4067
|
+
translateMethod,
|
|
4048
4068
|
revertGlobalPatches,
|
|
4049
4069
|
deoptimizeEverything,
|
|
4050
4070
|
deoptimizeBootImage,
|
package/lib/env.js
CHANGED
|
@@ -531,6 +531,10 @@ Env.prototype.monitorExit = proxy(218, 'int32', ['pointer', 'pointer'], function
|
|
|
531
531
|
return impl(this.handle, obj);
|
|
532
532
|
});
|
|
533
533
|
|
|
534
|
+
Env.prototype.getDirectBufferAddress = proxy(230, 'pointer', ['pointer', 'pointer'], function (impl, obj) {
|
|
535
|
+
return impl(this.handle, obj);
|
|
536
|
+
});
|
|
537
|
+
|
|
534
538
|
Env.prototype.getObjectRefType = proxy(232, 'int32', ['pointer', 'pointer'], function (impl, ref) {
|
|
535
539
|
return impl(this.handle, ref);
|
|
536
540
|
});
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "frida-java-bridge",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.2.2",
|
|
4
4
|
"description": "Java runtime interop from Frida",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
7
7
|
"/index.js",
|
|
8
|
-
"/lib/**/*.js"
|
|
8
|
+
"/lib/**/*.js",
|
|
9
|
+
"/lib/**/*.d.ts"
|
|
9
10
|
],
|
|
10
11
|
"repository": {
|
|
11
12
|
"type": "git",
|