Skip to content

Instantly share code, notes, and snippets.

@jimmy947788
Last active December 30, 2023 21:49
Show Gist options
  • Save jimmy947788/8ef425fb8dc69f5b72503d1b502c04df to your computer and use it in GitHub Desktop.
Save jimmy947788/8ef425fb8dc69f5b72503d1b502c04df to your computer and use it in GitHub Desktop.
frida hook classLoader
function hook_classLoader() {
Java.perform(function () {
Java.enumerateLoadedClasses({
onMatch: function (className) {
try {
if (className == "om.b") {
var om_b = Java.use("om.b");
console.log(om_b);
om_b["o"].implementation = function (jVar) {
console.log(`om.b.o is called: jVar=${jVar}`);
this["o"](jVar);
};
om_b["p"].implementation = function (iVar) {
console.log(`om.b.p is called: iVar=${iVar}`);
this["p"](iVar);
};
om_b["r"].implementation = function (obj, str) {
console.log(`om.b.r is called: obj=${obj}, str=${str}`);
if (str == "before_login") {
}
let result = this["r"](obj, str);
console.log(`om.b.r result=${result}`);
return result;
};
om_b["s"].implementation = function (obj, str) {
console.log(`om.b.s is called: obj=${obj}, str=${str}`);
let result = this["s"](obj, str);
console.log(`om.b.s result=${result}`);
return result;
};
om_b["t"].implementation = function (obj, str, str2) {
console.log(`om.b.t is called: obj=${obj}, str=${str}, str2=${str2}`);
let result = this["t"](obj, str, str2);
console.log(`om.b.t result=${result}`);
return result;
};
}
} catch (error) {
console.log(error);
}
},
onComplete: function () { }
});
});
}

使用時機

  1. 發Rreques之前
  2. Activity 開始載入
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment