We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm trying to replace the StringBuilder constructor implementation in a desktop Java application, but it freezes immediately.
$ java --version java 17.0.11 2024-04-16 LTS Java(TM) SE Runtime Environment (build 17.0.11+7-LTS-207) Java HotSpot(TM) 64-Bit Server VM (build 17.0.11+7-LTS-207, mixed mode, sharing) $ frida --version 16.2.5
Script
Java.perform(() => { const StringBuilder = Java.use('java.lang.StringBuilder'); // We need to replace .$init() instead of .$new(), since .$new() = .alloc() + .init() const ctor = StringBuilder.$init.overload('java.lang.String'); ctor.implementation = function (arg) { console.log(arg); return this.ctor(arg); }; console.log('[+] new StringBuilder(java.lang.String) hooked'); });
The text was updated successfully, but these errors were encountered:
what about:
Java.perform(() => { const StringBuilder = Java.use('java.lang.StringBuilder'); const ctor = StringBuilder.$init.overload('java.lang.String'); ctor.implementation = function (arg) { console.log(arg); return ctor.call(this, arg); }; console.log('[+] new StringBuilder(java.lang.String) hooked'); });
or:
Java.perform(() => { const StringBuilder = Java.use('java.lang.StringBuilder'); StringBuilder.$init.overload('java.lang.String').implementation = function (arg) { console.log(arg); return this.$init.overload('java.lang.String').call(this, arg); }; console.log('[+] new StringBuilder(java.lang.String) hooked'); });
Sorry, something went wrong.
No branches or pull requests
I'm trying to replace the StringBuilder constructor implementation in a desktop Java application, but it freezes immediately.
Script
The text was updated successfully, but these errors were encountered: