Created
February 20, 2016 21:08
-
-
Save subho007/983d7a618694235bc6f2 to your computer and use it in GitHub Desktop.
Frida to Hook Android Log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.util.Log; | |
// The Log function in Android | |
Log.d("TEST", "Wohoo This Works !") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dalvik.perform(function () { | |
var Log = Dalvik.use("android.util.Log"); | |
Log.d.overload("java.lang.String", "java.lang.string", "java.lang.Throwable").implementation = function (a, b, c) { | |
send("Log.d()"); | |
send(a.toString()); | |
send(b.toString()); | |
return this.d.overload("java.lang.String", "java.lang.string", "java.lang.Throwable").call(this, a, b, c); | |
}; | |
Log.v.overload("java.lang.String", "java.lang.string", "java.lang.Throwable").implementation = function (a, b, c) { | |
send("Log.v()"); | |
send(a.toString()); | |
send(b.toString()); | |
return this.v.overload("java.lang.String", "java.lang.string", "java.lang.Throwable").call(this, a, b, c); | |
}; | |
Log.i.overload("java.lang.String", "java.lang.string", "java.lang.Throwable").implementation = function (a, b, c) { | |
send("Log.i()"); | |
send(a.toString()); | |
send(b.toString()); | |
return this.i.overload("java.lang.String", "java.lang.string", "java.lang.Throwable").call(this, a, b, c); | |
}; | |
Log.e.overload("java.lang.String", "java.lang.string", "java.lang.Throwable").implementation = function (a, b, c) { | |
send("Log.e()"); | |
send(a.toString()); | |
send(b.toString()); | |
return this.e.overload("java.lang.String", "java.lang.string", "java.lang.Throwable").call(this, a, b, c); | |
}; | |
Log.w.overload("java.lang.String", "java.lang.string", "java.lang.Throwable").implementation = function (a, b, c) { | |
send("Log.w()"); | |
send(w.toString()); | |
send(w.toString()); | |
return this.w.overload("java.lang.String", "java.lang.string", "java.lang.Throwable").call(this, a, b, c); | |
}; | |
}); |
neomafo88
commented
Jul 27, 2023
•
Java.perform(function () {
var Log = Java.use("android.util.Log");
Log.d.overload("java.lang.String", "java.lang.String").implementation = function (a, b) {
send(JSON.stringify({func: "Log.d", param0: a, param1: b}));
return this.d.overload("java.lang.String", "java.lang.String").call(this, a, b);
};
Log.v.overload("java.lang.String", "java.lang.String").implementation = function (a, b) {
send(JSON.stringify({func: "Log.v", param0: a, param1: b}));
return this.v.overload("java.lang.String", "java.lang.String").call(this, a, b);
};
Log.i.overload("java.lang.String", "java.lang.String").implementation = function (a, b) {
send(JSON.stringify({func: "Log.i", param0: a, param1: b}));
return this.i.overload("java.lang.String", "java.lang.String").call(this, a, b);
};
Log.e.overload("java.lang.String", "java.lang.String").implementation = function (a, b) {
send(JSON.stringify({func: "Log.e", param0: a, param1: b}));
return this.e.overload("java.lang.String", "java.lang.String").call(this, a, b);
};
Log.w.overload("java.lang.String", "java.lang.String").implementation = function (a, b) {
send(JSON.stringify({func: "Log.w", param0: a, param1: b}));
return this.w.overload("java.lang.String", "java.lang.String").call(this, a, b);
};
});
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment