js脚本
function hook_overload_1() {
if(Java.available) {
Java.perform(function () {
console.log("start hook");
console.log("start end");
});
}else{
console.log("Java cannot use");
}
}
setImmediate(hook_overload_1);
➜ frida -U -l test1.js -f com.kymjs.themvp.samples
在终端中执行上述命令可正常执行
com.kymjs.themvp.samples 是测试apk的包名
Spawned com.kymjs.themvp.samples. Resuming main thread!
[Pixel 4 XL::com.kymjs.themvp.samples ]-> start hook
start end
Process terminated
[Pixel 4 XL::com.kymjs.themvp.samples ]->
Thank you for using Frida!
➜ cs frida -U -l test1.js -f com.vest231219
在终端中执行上述命令执行报错
com.vest231219 是真正想要hook的apk的包名
错误信息:
Spawned `com.vest231219`. Resuming main thread!
Process crashed: SIGBUS BUS_ADRALN
***
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'google/coral/coral:13/TP1A.221005.002/9012097:user/release-keys'
Revision: 'MP1.0'
ABI: 'arm'
Timestamp: 2024-12-02 10:44:23.216349420+0800
Process uptime: 2s
Cmdline: com.vest231219
pid: 29052, tid: 29082, name: Thread-3 >>> com.vest231219 , std::__1::allocator >, std::__1::allocator, std::__1::allocator > > > const*, std::__1::vector, std::__1::allocator >, std::__1::allocator, std::__1::allocator > > > const*)+794) (BuildId: 714d6ffee35369e924e256229f110189)
#06 pc 00008db9 /apex/com.android.art/lib/libbacktrace.so (Backtrace::Unwind(unwindstack::Regs*, BacktraceMap*, std::__1::vector >*, unsigned int, std::__1::vector, std::__1::allocator >, std::__1::allocator, std::__1::allocator > > >*, BacktraceUnwindError*)+276) (BuildId: d7f2dec7313130b41acf186819207fb7)
#07 pc 00009419 /apex/com.android.art/lib/libbacktrace.so (UnwindStackCurrent::UnwindFromContext(unsigned int, void*)+280) (BuildId: d7f2dec7313130b41acf186819207fb7)
***
[Pixel 4 XL::com.vest231219 ]-> Exception in thread Thread-1 (_run):
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/threading.py", line 1041, in _bootstrap_inner
self.run()
~~~~~~~~^^
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/threading.py", line 992, in run
self._target(*self._args, **self._kwargs)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/frida_tools/reactor.py", line 70, in _run
work()
~~~~^^
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/frida_tools/_repl_magic.py", line 34, in
repl._reactor.schedule(lambda: repl._resume())
~~~~~~~~~~~~^^
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/frida_tools/application.py", line 492, in _resume
self._device.resume(self._spawned_pid)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/frida/core.py", line 86, in wrapper
return f(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/frida/core.py", line 1047, in resume
self._impl.resume(self._pid_of(target))
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
frida.ProcessNotFoundError: unable to find process with pid 29052