Comments (4)
With Frida 10.0.10, Android 6.0.0, I can hook constructor with code below:
function print_args() {
var str = "";
for (var i = 0; i < arguments.length; i++) {
str += arguments[i] + ", "
}
return str;
}
Java.perform(function () {
var AudioRecord = Java.use("android.media.AudioRecord");
AudioRecord.$init.overload("int", "int", "int", "int", "int").implementation = function (audioSource, sampleRateInHz, channelConfig, audioFormat, bufferSizeInBytes) {
send("android.media.AudioRecord(" + this + ").<init>: " + print_args(audioSource, sampleRateInHz, channelConfig, audioFormat, bufferSizeInBytes));
return this.$init(audioSource, sampleRateInHz, channelConfig, audioFormat, bufferSizeInBytes);
};
});
If I use $new
, it will give such error message: Error: Reimplementing $new is not possible. Please replace implementation of $init instead.
, so I use $init
, and it works.
from frida-gum.
Ran into this same issue. Interestingly enough, depending on the way I hook it the results vary.
$new.overloads[i]
will crash the app.
$new.overload()
with apply(this, arguments)
as the last line will freeze it with a black screen.
$new.overload()
with anything else will crash the app.
from frida-gum.
I encountered the same problem on Android 6.0.1, with Frida 8.1.13. When I try to attach to a constructor of a Java class, the application crashes.
from frida-gum.
Thanks for pointing this out, @Piasy!
from frida-gum.
Related Issues (20)
- Diet version of Frida-gum doesn't build on Android ARM64 HOT 1
- Can't find Go binary symbols when running in Linux using Docker + Virtiofs + macOS host HOT 3
- gum-js-loop (20): EXC_BAD_ACCESS (code=1, address=0x0)
- gum_memory_patch_code causes EXC_BAD_ACCESS (code=2) on jailbroken iOS 16.5 HOT 1
- gum_stalker_new() Crash!!!!!!!!!! HOT 1
- Regression(?) in Module.enumerateExports and Module.enumerateSymbols HOT 1
- Under certain cases, `_gum_interceptor_backend_create_trampoline` does not relocate instructions properly on aarch64 for the `on_invoke_trampoline` HOT 1
- Signal handling on macOS
- Frida capstone's version is too older
- iterator.context is undefined
- Windows 11 Build Error
- `Module.enumerateSymbols` missed lots of local symbols from iOS dyld_shared_cache
- Fatal signal 11 (SIGSEGV), code 1, fault addr 0x38 in tid 16884 HOT 3
- TypeError: cannot read property 'objc_lookUpClass' of null
- NativeCallback unable to leave thread's last error unchanged
- Don't lose track of the stalker follow when a windows C++/SEH exception is thrown HOT 2
- [Stalker]Unable to allocate code slab near 0x7c4f333000 with max_distance=2138779647 HOT 2
- Diet Build fails
- Error from previous versions happened again with Module.load in the latest branch of frida
- [BUG] GUM_INSTRUMENTATION_ERROR_WRONG_SIGNATURE, GUM_ATTACH_WRONG_SIGNATURE
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from frida-gum.