forked from hardest1/cam-reverse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloader3.py
More file actions
executable file
·47 lines (38 loc) · 1.31 KB
/
loader3.py
File metadata and controls
executable file
·47 lines (38 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/env python
import frida
# Define the JavaScript code to hook System.loadLibrary()
js_code = """
const System = Java.use('java.lang.System');
System.loadLibrary.implementation = function(libraryName) {
console.log('Loading library: ' + libraryName);
// You can add your custom logic here before calling the original function.
return this.loadLibrary(libraryName);
};
"""
target_package_name = "com.ysxlite.cam"
shared_library_name = "vdp.so"
native_function_name = "p2p_read"
js_code = open('bundle.js').read()
def on_message(m, _data):
print('got', m, _data)
def main():
# Replace 'com.example.targetapp' with the actual package name of your target app.
app_id = "com.ysxlite.cam"
target_app_package = 'com.ysxlite.cam'
target_app_package = 'YsxLite'
device = frida.get_usb_device()
session = device.attach(target_app_package)
#pid = device.spawn([app_id])
#print(pid)
#session = device.attach(pid)
# Attach to the target app
print(session)
# Create a script and load the JavaScript code
script = session.create_script(js_code)
script.on('message', on_message)
script.load()
# device.resume(target_app_package)
# Keep the script running to continue monitoring the app
input("Press Enter to stop...")
if __name__ == '__main__':
main()