{"id":113788,"date":"2026-10-07T12:49:55","date_gmt":"2026-10-07T04:49:55","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/113788.html"},"modified":"2026-10-07T12:49:55","modified_gmt":"2026-10-07T04:49:55","slug":"frida%e5%85%a5%e9%97%a8%e5%88%b0%e5%ae%9e%e6%88%98%ef%bc%9ahook-so%e5%b1%82%e4%b8%8ejava%e5%b1%82%e7%9a%84%e5%a7%bf%e5%8a%bf%e6%80%bb%e7%bb%93","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/113788.html","title":{"rendered":"Frida\u5165\u95e8\u5230\u5b9e\u6218\uff1ahook so\u5c42\u4e0eJava\u5c42\u7684\u59ff\u52bf\u603b\u7ed3"},"content":{"rendered":"<p>Frida \u662f\u4e00\u6b3e\u8de8\u5e73\u53f0\u7684\u52a8\u6001\u4e8c\u8fdb\u5236\u63d2\u6869\u5de5\u5177&#xff0c;\u51ed\u501f JavaScript \u811a\u672c\u5316\u3001\u8f7b\u91cf\u7075\u6d3b\u3001\u5168\u5e73\u53f0\u8986\u76d6\u7684\u7279\u6027&#xff0c;\u6210\u4e3a\u79fb\u52a8\u7aef\u9006\u5411\u5206\u6790\u3001\u5b89\u5168\u6d4b\u8bd5\u9886\u57df\u7684\u6807\u914d\u5de5\u5177\u3002\u65e0\u8bba\u662f Java \u5c42\u7684\u4e1a\u52a1\u903b\u8f91 Hook&#xff0c;\u8fd8\u662f so \u539f\u751f\u5c42\u7684\u7b97\u6cd5\u5206\u6790&#xff0c;Frida \u90fd\u80fd\u63d0\u4f9b\u7edf\u4e00\u7684\u64cd\u4f5c\u8303\u5f0f\u3002\u672c\u6587\u5c06\u4ece\u57fa\u7840\u73af\u5883\u642d\u5efa\u51fa\u53d1&#xff0c;\u7cfb\u7edf\u603b\u7ed3 Java \u5c42\u4e0e so \u5c42\u7684\u5e38\u7528 Hook \u59ff\u52bf&#xff0c;\u7ed3\u5408\u5b9e\u6218\u6848\u4f8b\u68b3\u7406\u5b8c\u6574\u7684\u5206\u6790\u94fe\u8def&#xff0c;\u5e2e\u52a9\u8bfb\u8005\u5feb\u901f\u638c\u63e1 Frida \u7684\u6838\u5fc3\u7528\u6cd5\u3002<\/p>\n<h3>\u4e00\u3001Frida \u57fa\u7840\u5165\u95e8<\/h3>\n<h4>1.1 \u4ec0\u4e48\u662f Frida<\/h4>\n<p>Frida \u672c\u8d28\u662f\u4e00\u4e2a\u6ce8\u5165\u5f0f\u8c03\u8bd5\u6846\u67b6&#xff0c;\u5b83\u5411\u76ee\u6807\u8fdb\u7a0b\u6ce8\u5165 frida-gum \u5f15\u64ce&#xff0c;\u5141\u8bb8\u5f00\u53d1\u8005\u901a\u8fc7 JavaScript \u811a\u672c\u76f4\u63a5\u64cd\u4f5c\u8fdb\u7a0b\u5185\u5b58\u3001Hook \u51fd\u6570\u3001\u8c03\u7528\u539f\u751f\u65b9\u6cd5\u3002\u5b83\u652f\u6301 Android\u3001iOS\u3001Linux\u3001Windows\u3001macOS \u7b49\u4e3b\u6d41\u5e73\u53f0&#xff0c;\u5c24\u5176\u5728 Android \u9006\u5411\u573a\u666f\u4e2d&#xff0c;Frida \u53ef\u4ee5\u65e0\u7f1d\u5de5\u4f5c\u5728 Java \u865a\u62df\u673a\u5c42\u4e0e Native \u539f\u751f\u5c42&#xff0c;\u662f\u5206\u6790 APP \u903b\u8f91\u3001\u7834\u89e3\u9a8c\u8bc1\u3001\u9006\u5411\u7b97\u6cd5\u7684\u6838\u5fc3\u5de5\u5177\u3002<\/p>\n<h4>1.2 \u73af\u5883\u642d\u5efa<\/h4>\n<ul>\n<li>\u7535\u8111\u7aef&#xff1a;\u5b89\u88c5 Python \u73af\u5883\u540e&#xff0c;\u6267\u884c pip install frida frida-tools \u5373\u53ef\u5b89\u88c5\u5ba2\u6237\u7aef\u5de5\u5177\u4e0e\u4f9d\u8d56\u5e93\u3002<\/li>\n<li>\u624b\u673a\u7aef&#xff1a;\u4e0b\u8f7d\u4e0e\u624b\u673a\u67b6\u6784&#xff08;arm64\/armv7&#xff09;\u3001\u7535\u8111\u7aef\u7248\u672c\u5b8c\u5168\u4e00\u81f4\u7684 frida-server&#xff0c;\u63a8\u9001\u5230\u624b\u673a \/data\/local\/tmp \u76ee\u5f55&#xff0c;\u8d4b\u4e88\u6267\u884c\u6743\u9650\u5e76\u540e\u53f0\u8fd0\u884c\u3002<\/li>\n<li>\u73af\u5883\u9a8c\u8bc1&#xff1a;\u624b\u673a\u901a\u8fc7 USB \u8fde\u63a5\u7535\u8111\u5e76\u5f00\u542f\u8c03\u8bd5&#xff0c;\u6267\u884c frida-ps -U \u53ef\u5217\u51fa\u624b\u673a\u7aef\u8fdb\u7a0b&#xff0c;\u5373\u4e3a\u73af\u5883\u642d\u5efa\u6210\u529f\u3002<\/li>\n<\/ul>\n<h4>1.3 \u6838\u5fc3\u6982\u5ff5\u4e0e\u57fa\u7840\u811a\u672c\u7ed3\u6784<\/h4>\n<p>Frida \u6709\u4e24\u79cd\u6838\u5fc3\u8fd0\u884c\u6a21\u5f0f&#xff0c;\u5bf9\u5e94\u4e0d\u540c\u5206\u6790\u573a\u666f&#xff1a;<\/p>\n<ul>\n<li>Attach \u6a21\u5f0f&#xff1a;\u9644\u52a0\u5230\u5df2\u7ecf\u8fd0\u884c\u7684\u8fdb\u7a0b&#xff0c;\u9002\u5408\u8c03\u8bd5\u540e\u53f0\u8fd0\u884c\u7684\u5e94\u7528\u3001\u9875\u9762\u4ea4\u4e92\u903b\u8f91&#xff0c;\u65e0\u9700\u91cd\u542f APP\u3002<\/li>\n<li>Spawn \u6a21\u5f0f&#xff1a;\u5e94\u7528\u542f\u52a8\u65f6\u76f4\u63a5\u6ce8\u5165&#xff0c;\u80fd Hook \u5e94\u7528\u521d\u59cb\u5316\u3001Application \u751f\u547d\u5468\u671f\u3001so \u52a0\u8f7d\u9636\u6bb5\u7684\u903b\u8f91&#xff0c;\u9002\u5408\u5206\u6790\u542f\u52a8\u6d41\u7a0b\u3002<\/li>\n<\/ul>\n<p>\u57fa\u7840\u811a\u672c\u7684\u901a\u7528\u7ed3\u6784\u5982\u4e0b&#xff1a;<\/p>\n<p>\/\/ Java \u5c42\u64cd\u4f5c\u5fc5\u987b\u5305\u88f9\u5728 Java.perform \u4e2d&#xff0c;\u786e\u4fdd\u5728 Java \u7ebf\u7a0b\u6267\u884c<br \/>\nJava.perform(function () {<br \/>\n  \/\/ Java \u5c42 Hook \u903b\u8f91\u5199\u5728\u8fd9\u91cc<br \/>\n});<\/p>\n<p>\/\/ Native \u5c42\u64cd\u4f5c\u53ef\u76f4\u63a5\u5168\u5c40\u6267\u884c<br \/>\nInterceptor.attach(\u76ee\u6807\u51fd\u6570\u5730\u5740, {<br \/>\n  onEnter: function(args) {<br \/>\n    \/\/ \u51fd\u6570\u8fdb\u5165\u65f6\u89e6\u53d1&#xff0c;\u7528\u4e8e\u8bfb\u53d6\u53c2\u6570<br \/>\n  },<br \/>\n  onLeave: function(retval) {<br \/>\n    \/\/ \u51fd\u6570\u8fd4\u56de\u65f6\u89e6\u53d1&#xff0c;\u7528\u4e8e\u8bfb\u53d6\/\u4fee\u6539\u8fd4\u56de\u503c<br \/>\n  }<br \/>\n});<\/p>\n<p>\u8fd0\u884c\u811a\u672c\u7684\u57fa\u7840\u547d\u4ee4&#xff1a;<\/p>\n<p># Attach \u6a21\u5f0f&#xff1a;\u9644\u52a0\u5230\u8fd0\u884c\u4e2d\u7684\u8fdb\u7a0b<br \/>\nfrida -U \u5e94\u7528\u5305\u540d -l script.js<\/p>\n<p># Spawn \u6a21\u5f0f&#xff1a;\u51b7\u542f\u52a8\u5e94\u7528\u5e76\u6ce8\u5165\u811a\u672c<br \/>\nfrida -U -f \u5e94\u7528\u5305\u540d -l script.js<\/p>\n<h3>\u4e8c\u3001Java \u5c42 Hook \u5e38\u7528\u59ff\u52bf<\/h3>\n<p>Java \u5c42 Hook \u662f Frida \u6700\u5e38\u7528\u7684\u573a\u666f&#xff0c;\u6838\u5fc3\u56f4\u7ed5 Java.use() \u83b7\u53d6\u7c7b\u5f15\u7528&#xff0c;\u901a\u8fc7\u91cd\u5199\u65b9\u6cd5\u5b9e\u73b0\u62e6\u622a\u3002<\/p>\n<h4>2.1 \u57fa\u7840\u65b9\u6cd5 Hook<\/h4>\n<p>\u6700\u5e38\u89c4\u7684\u573a\u666f\u662f\u62e6\u622a\u6307\u5b9a\u7c7b\u7684\u666e\u901a\u65b9\u6cd5&#xff0c;\u8bfb\u53d6\u53c2\u6570\u3001\u4fee\u6539\u8fd4\u56de\u503c\u6216\u76f4\u63a5\u66ff\u6362\u903b\u8f91\u3002<\/p>\n<p>\u793a\u4f8b&#xff1a;Hook \u767b\u5f55\u6821\u9a8c\u65b9\u6cd5&#xff0c;\u6253\u5370\u8f93\u5165\u5bc6\u7801\u4e0e\u8fd4\u56de\u7ed3\u679c<\/p>\n<p>Java.perform(function () {<br \/>\n  \/\/ \u901a\u8fc7\u5b8c\u6574\u7c7b\u540d\u83b7\u53d6\u76ee\u6807\u7c7b\u5f15\u7528<br \/>\n  var LoginManager &#061; Java.use(&#034;com.example.app.LoginManager&#034;);<\/p>\n<p>  \/\/ \u91cd\u5199\u65b9\u6cd5\u5b9e\u73b0<br \/>\n  LoginManager.verifyPassword.implementation &#061; function (inputPwd) {<br \/>\n    \/\/ \u6253\u5370\u5165\u53c2<br \/>\n    console.log(&#034;[Java Hook] \u8f93\u5165\u5bc6\u7801&#xff1a;&#034; &#043; inputPwd);<\/p>\n<p>    \/\/ \u8c03\u7528\u539f\u65b9\u6cd5&#xff0c;\u4fdd\u7559\u539f\u6709\u903b\u8f91<br \/>\n    var result &#061; this.verifyPassword(inputPwd);<br \/>\n    console.log(&#034;[Java Hook] \u6821\u9a8c\u7ed3\u679c&#xff1a;&#034; &#043; result);<\/p>\n<p>    \/\/ \u4e5f\u53ef\u76f4\u63a5\u8fd4\u56de true \u7ed5\u8fc7\u6821\u9a8c<br \/>\n    \/\/ return true;<br \/>\n    return result;<br \/>\n  };<br \/>\n});<\/p>\n<h4>2.2 \u6784\u9020\u65b9\u6cd5\u4e0e\u91cd\u8f7d\u65b9\u6cd5<\/h4>\n<ul>\n<li>\u6784\u9020\u65b9\u6cd5 Hook&#xff1a;\u4f7f\u7528 $init \u4ee3\u8868\u7c7b\u7684\u6784\u9020\u51fd\u6570&#xff0c;\u7528\u4e8e\u76d1\u542c\u5bf9\u8c61\u521b\u5efa\u8fc7\u7a0b\u3002<\/li>\n<li>\u91cd\u8f7d\u65b9\u6cd5 Hook&#xff1a;\u540c\u4e00\u4e2a\u65b9\u6cd5\u540d\u5b58\u5728\u591a\u4e2a\u53c2\u6570\u7248\u672c\u65f6&#xff0c;\u5fc5\u987b\u7528 overload() \u7cbe\u786e\u6307\u5b9a\u53c2\u6570\u7c7b\u578b\u3002<\/li>\n<\/ul>\n<p>\u793a\u4f8b&#xff1a;Hook \u91cd\u8f7d\u65b9\u6cd5\u4e0e\u6784\u9020\u51fd\u6570<\/p>\n<p>var UserInfo &#061; Java.use(&#034;com.example.app.UserInfo&#034;);<\/p>\n<p>\/\/ Hook \u5e26\u4e24\u4e2a\u53c2\u6570\u7684\u6784\u9020\u65b9\u6cd5<br \/>\nUserInfo.$init.overload(&#034;java.lang.String&#034;, &#034;int&#034;).implementation &#061; function (name, age) {<br \/>\n  console.log(&#034;[\u6784\u9020] \u521b\u5efa\u7528\u6237&#xff1a;&#034; &#043; name &#043; &#034;&#xff0c;\u5e74\u9f84&#xff1a;&#034; &#043; age);<br \/>\n  this.$init(name, age); \/\/ \u5fc5\u987b\u8c03\u7528\u539f\u6784\u9020&#xff0c;\u5426\u5219\u5bf9\u8c61\u65e0\u6cd5\u521d\u59cb\u5316<br \/>\n};<\/p>\n<p>\/\/ Hook \u91cd\u8f7d\u7684 getSign \u65b9\u6cd5&#xff08;String &#043; int \u53c2\u6570\u7248\u672c&#xff09;<br \/>\nUserInfo.getSign.overload(&#034;java.lang.String&#034;, &#034;int&#034;).implementation &#061; function (data, type) {<br \/>\n  console.log(&#034;[\u91cd\u8f7d] data&#061;&#034; &#043; data &#043; &#034;&#xff0c;type&#061;&#034; &#043; type);<br \/>\n  return this.getSign(data, type);<br \/>\n};<\/p>\n<h4>2.3 \u5b57\u6bb5\u8bfb\u5199\u4e0e\u5185\u90e8\u7c7b Hook<\/h4>\n<ul>\n<li>\u4fee\u6539\u6210\u5458\u5b57\u6bb5&#xff1a;\u901a\u8fc7 .value \u8bfb\u5199\u5bf9\u8c61\u7684\u6210\u5458\u53d8\u91cf&#xff0c;\u9759\u6001\u5b57\u6bb5\u53ef\u76f4\u63a5\u901a\u8fc7\u7c7b\u8bbf\u95ee\u3002<\/li>\n<li>\u5185\u90e8\u7c7b Hook&#xff1a;Java \u5185\u90e8\u7c7b\u5728\u865a\u62df\u673a\u4e2d\u4ee5 \u5916\u90e8\u7c7b$\u5185\u90e8\u7c7b \u7684\u5f62\u5f0f\u547d\u540d&#xff0c;\u6309\u6b64\u89c4\u5219\u5f15\u7528\u5373\u53ef\u3002<\/li>\n<\/ul>\n<p>\u793a\u4f8b&#xff1a;\u4fee\u6539\u5b57\u6bb5\u4e0e Hook \u533f\u540d\u5185\u90e8\u7c7b<\/p>\n<p>var MainActivity &#061; Java.use(&#034;com.example.app.MainActivity&#034;);<\/p>\n<p>\/\/ Hook \u6309\u94ae\u70b9\u51fb\u7684\u533f\u540d\u5185\u90e8\u7c7b<br \/>\nvar ClickListener &#061; Java.use(&#034;com.example.app.MainActivity$1&#034;);<br \/>\nClickListener.onClick.implementation &#061; function (v) {<br \/>\n  console.log(&#034;[\u5185\u90e8\u7c7b] \u767b\u5f55\u6309\u94ae\u88ab\u70b9\u51fb&#034;);<br \/>\n  this.onClick(v);<br \/>\n};<\/p>\n<p>\/\/ \u4fee\u6539\u9759\u6001\u5b57\u6bb5&#xff0c;\u5f3a\u5236\u5f00\u542f\u8c03\u8bd5\u6a21\u5f0f<br \/>\nMainActivity.IS_DEBUG.value &#061; true;<br \/>\nconsole.log(&#034;[\u5b57\u6bb5] \u8c03\u8bd5\u6a21\u5f0f\u72b6\u6001&#xff1a;&#034; &#043; MainActivity.IS_DEBUG.value);<\/p>\n<h4>2.4 \u4e3b\u52a8\u8c03\u7528\u4e0e\u6279\u91cf Hook<\/h4>\n<p>Frida \u4e0d\u4ec5\u80fd\u88ab\u52a8\u62e6\u622a&#xff0c;\u8fd8\u53ef\u4ee5\u4e3b\u52a8\u8c03\u7528\u7c7b\u7684\u9759\u6001 \/ \u5b9e\u4f8b\u65b9\u6cd5&#xff1b;\u6279\u91cf Hook \u5219\u9002\u5408\u5feb\u901f\u5b9a\u4f4d\u76ee\u6807\u51fd\u6570\u3002<\/p>\n<p>\u793a\u4f8b&#xff1a;\u4e3b\u52a8\u8c03\u7528\u9759\u6001\u52a0\u5bc6\u65b9\u6cd5<\/p>\n<p>Java.perform(function () {<br \/>\n  var SignUtils &#061; Java.use(&#034;com.example.app.utils.SignUtils&#034;);<br \/>\n  \/\/ \u4e3b\u52a8\u8c03\u7528 md5 \u52a0\u5bc6\u65b9\u6cd5<br \/>\n  var sign &#061; SignUtils.md5Encrypt(&#034;test123456&#034;);<br \/>\n  console.log(&#034;[\u4e3b\u52a8\u8c03\u7528] \u52a0\u5bc6\u7ed3\u679c&#xff1a;&#034; &#043; sign);<br \/>\n});<\/p>\n<p>\u6279\u91cf Hook \u76ee\u6807\u7c7b\u7684\u6240\u6709\u65b9\u6cd5&#xff0c;\u7528\u4e8e\u5feb\u901f\u5b9a\u4f4d\u5173\u952e\u903b\u8f91&#xff1a;<\/p>\n<p>var targetClass &#061; Java.use(&#034;com.example.app.utils.SecurityUtils&#034;);<br \/>\nvar methods &#061; targetClass.class.getDeclaredMethods();<\/p>\n<p>methods.forEach(function (method) {<br \/>\n  var methodName &#061; method.getName();<br \/>\n  targetClass[methodName].implementation &#061; function () {<br \/>\n    console.log(&#034;[\u6279\u91cfHook] \u8c03\u7528\u65b9\u6cd5&#xff1a;&#034; &#043; methodName);<br \/>\n    return this[methodName].apply(this, arguments);<br \/>\n  };<br \/>\n});<\/p>\n<h3>\u4e09\u3001Native&#xff08;so \u5c42&#xff09;Hook \u6838\u5fc3\u59ff\u52bf<\/h3>\n<p>so \u5c42 Hook \u9488\u5bf9 Native \u4ee3\u7801&#xff0c;\u6838\u5fc3\u4f9d\u8d56 Interceptor \u62e6\u622a\u6a21\u5757\u4e0e Module \u5185\u5b58\u5b9a\u4f4d\u6a21\u5757\u3002<\/p>\n<h4>3.1 Native \u5c42 Hook \u7684\u4e24\u79cd\u601d\u8def<\/h4>\n<p>so \u5c42 Hook \u4e3b\u8981\u8986\u76d6\u4e24\u7c7b\u573a\u666f&#xff1a;<\/p>\n<li>Java Native \u65b9\u6cd5&#xff1a;Java \u4ee3\u7801\u4e2d\u58f0\u660e\u4e3a native \u7684\u65b9\u6cd5&#xff0c;\u65e2\u53ef\u4ee5\u4ece Java \u5c42 Hook&#xff0c;\u4e5f\u53ef\u4ee5\u4ece so \u5c42 Hook\u3002<\/li>\n<li>\u7eaf Native \u51fd\u6570&#xff1a;so \u5185\u90e8\u7684\u666e\u901a\u51fd\u6570&#xff08;\u5bfc\u51fa\u6216\u672a\u5bfc\u51fa&#xff09;&#xff0c;\u6bd4\u5982\u7cfb\u7edf libc \u7684 strcmp\u3001\u81ea\u5b9a\u4e49 so \u7684\u5185\u90e8\u7b97\u6cd5\u51fd\u6570&#xff0c;\u53ea\u80fd\u901a\u8fc7 Native \u5c42 Hook\u3002<\/li>\n<h4>3.2 \u5bfc\u51fa\u51fd\u6570 Hook<\/h4>\n<p>\u5bfc\u51fa\u51fd\u6570\u662f so \u5bf9\u5916\u66b4\u9732\u7684\u63a5\u53e3&#xff0c;\u53ef\u4ee5\u76f4\u63a5\u901a\u8fc7 Module.findExportByName() \u5b9a\u4f4d\u5185\u5b58\u5730\u5740\u3002<\/p>\n<p>\u793a\u4f8b 1&#xff1a;Hook Java Native \u65b9\u6cd5&#xff08;so \u5c42\u89c6\u89d2&#xff09;<\/p>\n<p>\/\/ \u786e\u4fdd\u76ee\u6807 so \u5df2\u52a0\u8f7d\u5b8c\u6210<br \/>\nModule.ensureInitialized(&#034;libsecurity.so&#034;);<\/p>\n<p>\/\/ \u6309 JNI \u547d\u540d\u89c4\u5219\u67e5\u627e\u5bfc\u51fa\u51fd\u6570<br \/>\nvar nativeSign &#061; Module.findExportByName(&#034;libsecurity.so&#034;,<br \/>\n  &#034;Java_com_example_app_utils_SignUtils_nativeSign&#034;);<\/p>\n<p>Interceptor.attach(nativeSign, {<br \/>\n  onEnter: function (args) {<br \/>\n    \/\/ JNI \u51fd\u6570\u524d\u4e24\u4e2a\u53c2\u6570\u56fa\u5b9a\u4e3a JNIEnv* \u548c jobject<br \/>\n    \/\/ args[2] \u624d\u5bf9\u5e94 Java \u5c42\u4f20\u5165\u7684\u7b2c\u4e00\u4e2a\u53c2\u6570<br \/>\n    var input &#061; Memory.readCString(args[2]);<br \/>\n    console.log(&#034;[so Hook] \u7b7e\u540d\u8f93\u5165&#xff1a;&#034; &#043; input);<br \/>\n  },<br \/>\n  onLeave: function (retval) {<br \/>\n    var result &#061; Memory.readCString(retval);<br \/>\n    console.log(&#034;[so Hook] \u7b7e\u540d\u7ed3\u679c&#xff1a;&#034; &#043; result);<br \/>\n  }<br \/>\n});<\/p>\n<p>\u793a\u4f8b 2&#xff1a;Hook \u7cfb\u7edf libc \u7684 strcmp \u51fd\u6570<\/p>\n<p>\/\/ \u5e38\u7528\u4e8e\u7ed5\u8fc7\u5b57\u7b26\u4e32\u6bd4\u8f83\u6821\u9a8c<br \/>\nvar strcmp &#061; Module.findExportByName(&#034;libc.so&#034;, &#034;strcmp&#034;);<br \/>\nInterceptor.attach(strcmp, {<br \/>\n  onEnter: function (args) {<br \/>\n    var str1 &#061; Memory.readCString(args[0]);<br \/>\n    var str2 &#061; Memory.readCString(args[1]);<br \/>\n    console.log(&#034;[strcmp] \u6bd4\u8f83&#xff1a;&#034; &#043; str1 &#043; &#034; vs &#034; &#043; str2);<br \/>\n  },<br \/>\n  onLeave: function (retval) {<br \/>\n    \/\/ \u4fee\u6539\u8fd4\u56de\u503c\u4e3a 0&#xff0c;\u5f3a\u5236\u5224\u5b9a\u5b57\u7b26\u4e32\u76f8\u7b49<br \/>\n    retval.replace(0);<br \/>\n  }<br \/>\n});<\/p>\n<h4>3.3 \u672a\u5bfc\u51fa\u51fd\u6570 Hook&#xff08;\u57fa\u5740 &#043; \u504f\u79fb&#xff09;<\/h4>\n<p>\u6838\u5fc3\u7b97\u6cd5\u51fd\u6570\u901a\u5e38\u4e0d\u4f1a\u5bfc\u51fa&#xff0c;\u9700\u8981\u5148\u901a\u8fc7 IDA Pro \u7b49\u9759\u6001\u5206\u6790\u5de5\u5177\u5f97\u5230\u51fd\u6570\u5728 so \u6587\u4ef6\u4e2d\u7684\u504f\u79fb&#xff0c;\u518d\u52a0\u4e0a\u5185\u5b58\u52a0\u8f7d\u57fa\u5740&#xff0c;\u8ba1\u7b97\u51fa\u8fd0\u884c\u65f6\u5730\u5740\u3002<\/p>\n<p>\u793a\u4f8b&#xff1a;\u901a\u8fc7\u57fa\u5740 &#043; \u504f\u79fb Hook \u672a\u5bfc\u51fa\u7b97\u6cd5\u51fd\u6570<\/p>\n<p>\/\/ \u83b7\u53d6 so \u5728\u5185\u5b58\u4e2d\u7684\u52a0\u8f7d\u57fa\u5740<br \/>\nvar baseAddr &#061; Module.findBaseAddress(&#034;libnative.so&#034;);<br \/>\nif (!baseAddr) {<br \/>\n  console.log(&#034;[-] libnative.so \u5c1a\u672a\u52a0\u8f7d&#034;);<br \/>\n  return;<br \/>\n}<\/p>\n<p>\/\/ IDA \u4e2d\u5206\u6790\u5f97\u5230\u7684\u51fd\u6570\u6587\u4ef6\u504f\u79fb&#xff08;\u793a\u4f8b\u503c&#xff09;<br \/>\nvar funcOffset &#061; 0x3F2C;<br \/>\n\/\/ \u8ba1\u7b97\u8fd0\u884c\u65f6\u7684\u51fd\u6570\u5730\u5740<br \/>\nvar targetFunc &#061; baseAddr.add(funcOffset);<\/p>\n<p>Interceptor.attach(targetFunc, {<br \/>\n  onEnter: function (args) {<br \/>\n    console.log(&#034;[\u672a\u5bfc\u51fa\u51fd\u6570] \u8fdb\u5165\u76ee\u6807\u51fd\u6570&#xff0c;\u53c2\u65701&#xff1a;&#034; &#043; args[0]);<br \/>\n    this.arg1 &#061; args[0]; \/\/ \u4fdd\u5b58\u4e0a\u4e0b\u6587&#xff0c;onLeave \u4e2d\u4f7f\u7528<br \/>\n  },<br \/>\n  onLeave: function (retval) {<br \/>\n    console.log(&#034;[\u672a\u5bfc\u51fa\u51fd\u6570] \u8fd4\u56de\u503c&#xff1a;&#034; &#043; retval.toInt32());<br \/>\n  }<br \/>\n});<\/p>\n<h4>3.4 \u5185\u5b58\u64cd\u4f5c\u4e0e\u53c2\u6570\u89e3\u6790<\/h4>\n<p>Native \u5c42\u53c2\u6570\u591a\u4e3a\u6307\u9488\u7c7b\u578b&#xff0c;\u9700\u8981\u901a\u8fc7 Memory \u6a21\u5757\u8bfb\u5199\u5185\u5b58\u5185\u5bb9&#xff0c;\u5e38\u7528 API \u5305\u62ec&#xff1a;<\/p>\n<ul>\n<li>Memory.readCString(addr)&#xff1a;\u8bfb\u53d6 C \u98ce\u683c\u5b57\u7b26\u4e32<\/li>\n<li>Memory.readInt(addr) \/ Memory.readLong(addr)&#xff1a;\u8bfb\u53d6\u6574\u578b\u6570\u503c<\/li>\n<li>Memory.writeInt(addr, value)&#xff1a;\u5411\u6307\u5b9a\u5185\u5b58\u5199\u5165\u6570\u503c<\/li>\n<li>hexdump(addr, {length: len})&#xff1a;\u4ee5\u5341\u516d\u8fdb\u5236\u683c\u5f0f\u6253\u5370\u5185\u5b58<\/li>\n<\/ul>\n<p>\u793a\u4f8b&#xff1a;\u89e3\u6790\u7ed3\u6784\u4f53\u7c7b\u578b\u53c2\u6570<\/p>\n<p>Interceptor.attach(targetFunc, {<br \/>\n  onEnter: function (args) {<br \/>\n    \/\/ args[1] \u4e3a\u7ed3\u6784\u4f53\u6307\u9488&#xff0c;\u504f\u79fb 0x8 \u5904\u662f int \u7c7b\u578b\u7684\u957f\u5ea6\u5b57\u6bb5<br \/>\n    var dataPtr &#061; Memory.readPointer(args[1]);<br \/>\n    var dataLen &#061; Memory.readInt(args[1].add(8));<br \/>\n    var data &#061; Memory.readByteArray(dataPtr, dataLen);<\/p>\n<p>    console.log(&#034;[\u7ed3\u6784\u4f53] \u6570\u636e\u957f\u5ea6&#xff1a;&#034; &#043; dataLen);<br \/>\n    console.log(hexdump(data, { length: dataLen }));<br \/>\n  }<br \/>\n});<\/p>\n<h3>\u56db\u3001\u5b9e\u6218\u6848\u4f8b&#xff1a;\u4ece Java \u5230 so \u7684\u5168\u94fe\u8def Hook<\/h3>\n<h4>4.1 \u6848\u4f8b\u4e00&#xff1a;Java \u5c42\u767b\u5f55\u660e\u6587\u6293\u53d6<\/h4>\n<p>\u573a\u666f&#xff1a;\u67d0 APP \u767b\u5f55\u5bc6\u7801\u5728 Java \u5c42\u505a\u4e86\u52a0\u5bc6\u540e\u4f20\u8f93&#xff0c;\u9700\u8981\u83b7\u53d6\u7528\u6237\u8f93\u5165\u7684\u539f\u59cb\u660e\u6587\u5bc6\u7801\u3002<\/p>\n<p>\u5206\u6790\u601d\u8def&#xff1a;\u53cd\u7f16\u8bd1 APK \u5b9a\u4f4d\u767b\u5f55\u6309\u94ae\u70b9\u51fb\u4e8b\u4ef6&#xff0c;\u8ffd\u8e2a\u5230\u5bc6\u7801\u5904\u7406\u7c7b LoginHelper \u7684 encryptPassword \u65b9\u6cd5&#xff0c;Hook \u8be5\u65b9\u6cd5\u7684\u5165\u53c2\u5373\u53ef\u5f97\u5230\u660e\u6587\u3002<\/p>\n<p>\u5b8c\u6574\u811a\u672c&#xff1a;<\/p>\n<p>Java.perform(function () {<br \/>\n  var LoginHelper &#061; Java.use(&#034;com.example.app.login.LoginHelper&#034;);<\/p>\n<p>  LoginHelper.encryptPassword.overload(&#034;java.lang.String&#034;).implementation &#061; function (pwd) {<br \/>\n    console.log(&#034;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061; \u767b\u5f55\u660e\u6587\u6293\u53d6 &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#034;);<br \/>\n    console.log(&#034;\u539f\u59cb\u660e\u6587\u5bc6\u7801&#xff1a;&#034; &#043; pwd);<br \/>\n    var encrypted &#061; this.encryptPassword(pwd);<br \/>\n    console.log(&#034;\u52a0\u5bc6\u540e\u5bc6\u7801&#xff1a;&#034; &#043; encrypted);<br \/>\n    console.log(&#034;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#034;);<br \/>\n    return encrypted;<br \/>\n  };<br \/>\n});<\/p>\n<p>\u6267\u884c\u547d\u4ee4 frida -U -f com.example.app -l login_hook.js&#xff0c;\u542f\u52a8 APP \u8f93\u5165\u5bc6\u7801\u540e&#xff0c;\u63a7\u5236\u53f0\u5373\u53ef\u8f93\u51fa\u539f\u59cb\u660e\u6587\u3002<\/p>\n<h4>4.2 \u6848\u4f8b\u4e8c&#xff1a;so \u5c42\u52a0\u5bc6\u51fd\u6570 Hook \u4e0e\u53c2\u6570\u8fd8\u539f<\/h4>\n<p>\u573a\u666f&#xff1a;\u67d0 APP \u7684\u6838\u5fc3\u7b7e\u540d\u7b97\u6cd5\u653e\u5728 so \u5c42&#xff0c;Java \u5c42\u8c03\u7528 nativeGetSign(String data) \u8fd4\u56de\u7b7e\u540d\u5b57\u7b26\u4e32&#xff0c;\u9700\u8981\u6df1\u5165\u5206\u6790\u7b97\u6cd5\u7684\u8f93\u5165\u8f93\u51fa\u3002<\/p>\n<p>\u5206\u6790\u601d\u8def&#xff1a;<\/p>\n<li>\u5148\u901a\u8fc7 Java \u5c42 Hook \u786e\u8ba4 native \u65b9\u6cd5\u7684\u8c03\u7528\u65f6\u673a\u4e0e\u5165\u53c2&#xff1b;<\/li>\n<li>\u7528 IDA \u5206\u6790 libsign.so&#xff0c;\u4ece\u5bfc\u51fa\u7684 JNI \u51fd\u6570\u5411\u4e0b\u8ffd\u8e2a&#xff0c;\u627e\u5230\u5185\u90e8\u6838\u5fc3\u52a0\u5bc6\u51fd\u6570&#xff08;\u672a\u5bfc\u51fa&#xff0c;\u504f\u79fb 0x256C&#xff09;&#xff1b;<\/li>\n<li>Hook \u6838\u5fc3\u51fd\u6570&#xff0c;\u6253\u5370\u8f93\u5165\u7f13\u51b2\u533a\u4e0e\u8f93\u51fa\u7ed3\u679c\u3002<\/li>\n<p>\u5b8c\u6574\u811a\u672c&#xff1a;<\/p>\n<p>\/\/ 1. Java \u5c42&#xff1a;\u786e\u8ba4 native \u65b9\u6cd5\u8c03\u7528\u65f6\u673a<br \/>\nJava.perform(function () {<br \/>\n  var SignUtils &#061; Java.use(&#034;com.example.app.utils.SignUtils&#034;);<br \/>\n  SignUtils.nativeGetSign.implementation &#061; function (data) {<br \/>\n    console.log(&#034;[Java] \u8c03\u7528 nativeGetSign&#xff0c;\u5165\u53c2&#xff1a;&#034; &#043; data);<br \/>\n    var result &#061; this.nativeGetSign(data);<br \/>\n    console.log(&#034;[Java] \u8fd4\u56de\u7ed3\u679c&#xff1a;&#034; &#043; result);<br \/>\n    return result;<br \/>\n  };<br \/>\n});<\/p>\n<p>\/\/ 2. so \u5c42&#xff1a;\u76d1\u542c so \u52a0\u8f7d\u5e76 Hook \u6838\u5fc3\u51fd\u6570<br \/>\nsetImmediate(function () {<br \/>\n  var base &#061; Module.findBaseAddress(&#034;libsign.so&#034;);<br \/>\n  if (!base) {<br \/>\n    \/\/ so \u672a\u52a0\u8f7d\u65f6&#xff0c;Hook dlopen \u76d1\u542c\u52a0\u8f7d\u4e8b\u4ef6<br \/>\n    var dlopen &#061; Module.findExportByName(null, &#034;dlopen&#034;);<br \/>\n    Interceptor.attach(dlopen, {<br \/>\n      onEnter: function (args) {<br \/>\n        this.soPath &#061; Memory.readCString(args[0]);<br \/>\n      },<br \/>\n      onLeave: function () {<br \/>\n        if (this.soPath &amp;&amp; this.soPath.indexOf(&#034;libsign.so&#034;) !&#061;&#061; -1) {<br \/>\n          console.log(&#034;[so] libsign.so \u52a0\u8f7d\u5b8c\u6210&#xff0c;\u5f00\u59cbHook\u6838\u5fc3\u51fd\u6570&#034;);<br \/>\n          hookCoreFunc();<br \/>\n        }<br \/>\n      }<br \/>\n    });<br \/>\n  } else {<br \/>\n    hookCoreFunc();<br \/>\n  }<br \/>\n});<\/p>\n<p>function hookCoreFunc() {<br \/>\n  var baseAddr &#061; Module.findBaseAddress(&#034;libsign.so&#034;);<br \/>\n  var coreFunc &#061; baseAddr.add(0x256C); \/\/ IDA \u5206\u6790\u5f97\u5230\u7684\u51fd\u6570\u504f\u79fb<\/p>\n<p>  Interceptor.attach(coreFunc, {<br \/>\n    onEnter: function (args) {<br \/>\n      this.inputBuf &#061; args[0];<br \/>\n      this.inputLen &#061; args[1].toInt32();<br \/>\n      console.log(&#034;[so\u6838\u5fc3] \u8f93\u5165\u6570\u636e\u957f\u5ea6&#xff1a;&#034; &#043; this.inputLen);<br \/>\n      console.log(hexdump(this.inputBuf, { length: this.inputLen }));<br \/>\n    },<br \/>\n    onLeave: function (retval) {<br \/>\n      console.log(&#034;[so\u6838\u5fc3] \u8f93\u51fa\u7b7e\u540d&#xff1a;&#034; &#043; Memory.readCString(retval));<br \/>\n    }<br \/>\n  });<br \/>\n}<\/p>\n<h3>\u4e94\u3001\u8fdb\u9636\u6280\u5de7\u4e0e\u907f\u5751\u6307\u5357<\/h3>\n<h4>5.1 Spawn \u4e0e Attach \u6a21\u5f0f\u9009\u578b<\/h4>\n<ul>\n<li>Spawn \u6a21\u5f0f&#xff1a;\u9002\u5408\u5206\u6790\u5e94\u7528\u542f\u52a8\u903b\u8f91\u3001Application \u521d\u59cb\u5316\u3001so \u52a0\u8f7d\u9636\u6bb5\u7684\u6821\u9a8c&#xff0c;\u7f3a\u70b9\u662f\u4f1a\u91cd\u542f\u5e94\u7528\u3002<\/li>\n<li>Attach \u6a21\u5f0f&#xff1a;\u9002\u5408\u5206\u6790\u9875\u9762\u4ea4\u4e92\u3001\u540e\u53f0\u4efb\u52a1&#xff0c;\u65e0\u9700\u91cd\u542f APP&#xff1b;\u7f3a\u70b9\u662f\u65e0\u6cd5\u62e6\u622a\u542f\u52a8\u9636\u6bb5\u5df2\u7ecf\u6267\u884c\u8fc7\u7684\u4ee3\u7801\u3002<\/li>\n<\/ul>\n<h4>5.2 \u5e38\u89c1\u65f6\u5e8f\u95ee\u9898<\/h4>\n<ul>\n<li>\u591a ClassLoader \u95ee\u9898&#xff1a;\u63d2\u4ef6\u5316\u3001\u70ed\u4fee\u590d APP \u5b58\u5728\u591a\u4e2a\u7c7b\u52a0\u8f7d\u5668&#xff0c;\u76f4\u63a5 Java.use \u53ef\u80fd\u627e\u4e0d\u5230\u7c7b\u3002\u9700\u8981\u904d\u5386 ClassLoader \u5b9a\u4f4d\u76ee\u6807\u7c7b\u6240\u5728\u7684\u52a0\u8f7d\u5668\u3002<\/li>\n<li>so \u52a0\u8f7d\u65f6\u673a\u95ee\u9898&#xff1a;so \u662f\u52a8\u6001\u52a0\u8f7d\u7684&#xff0c;\u811a\u672c\u6267\u884c\u65f6 so \u53ef\u80fd\u5c1a\u672a\u52a0\u8f7d\u3002\u6807\u51c6\u89e3\u51b3\u65b9\u6848\u662f Hook dlopen \/ android_dlopen_ext \u76d1\u542c\u52a0\u8f7d\u4e8b\u4ef6&#xff0c;\u52a0\u8f7d\u5b8c\u6210\u540e\u518d\u6267\u884c Hook\u3002<\/li>\n<\/ul>\n<h4>5.3 \u53cd\u68c0\u6d4b\u4e0e\u5bf9\u6297\u6280\u5de7<\/h4>\n<p>\u5f88\u591a APP \u4f1a\u68c0\u6d4b Frida \u7279\u5f81&#xff0c;\u5e38\u7528\u5bf9\u6297\u624b\u6bb5&#xff1a;<\/p>\n<li>\u57fa\u7840\u9690\u85cf&#xff1a;\u91cd\u547d\u540d frida-server \u4e8c\u8fdb\u5236\u6587\u4ef6&#xff0c;\u4fee\u6539\u9ed8\u8ba4\u76d1\u542c\u7aef\u53e3&#xff0c;\u4f7f\u7528\u975e\u9ed8\u8ba4\u7aef\u53e3\u8fde\u63a5\u3002<\/li>\n<li>\u7279\u5f81\u5c4f\u853d&#xff1a;Hook strcmp\u3001strstr \u7b49\u51fd\u6570&#xff0c;\u62e6\u622a\u5bf9 &#034;frida&#034;\u3001&#034;gum-js&#034; \u7b49\u7279\u5f81\u5b57\u7b26\u4e32\u7684\u68c0\u6d4b\u3002<\/li>\n<li>\u6ce8\u5165\u65b9\u5f0f\u5bf9\u6297&#xff1a;\u4f7f\u7528 frida-gadget \u4ee3\u66ff frida-server&#xff0c;\u901a\u8fc7\u91cd\u6253\u5305 APK \u6ce8\u5165 so&#xff0c;\u7ed5\u8fc7 ptrace \u68c0\u6d4b\u3002<\/li>\n<h4>5.4 \u9ad8\u9891\u5751\u70b9\u6c47\u603b<\/h4>\n<li>JNI \u53c2\u6570\u504f\u79fb&#xff1a;Native \u51fd\u6570\u524d\u4e24\u4e2a\u53c2\u6570\u662f JNIEnv* \u548c jobject&#xff0c;Java \u5c42\u7b2c\u4e00\u4e2a\u53c2\u6570\u5bf9\u5e94 Native \u5c42\u7684 args [2]\u3002<\/li>\n<li>\u4f4d\u6570\u5dee\u5f02&#xff1a;64 \u4f4d\u7cfb\u7edf\u6307\u9488\u957f\u5ea6\u4e3a 8 \u5b57\u8282&#xff0c;32 \u4f4d\u4e3a 4 \u5b57\u8282&#xff0c;\u8ba1\u7b97\u7ed3\u6784\u4f53\u504f\u79fb\u65f6\u5fc5\u987b\u533a\u5206\u3002<\/li>\n<li>Java \u5bf9\u8c61\u6253\u5370&#xff1a;\u76f4\u63a5\u6253\u5370 Java \u5bf9\u8c61\u4f1a\u663e\u793a [object Object]&#xff0c;\u9700\u8981\u8c03\u7528 toString() \u6216\u624b\u52a8\u62fc\u63a5\u5b57\u6bb5\u3002<\/li>\n<li>\u7ebf\u7a0b\u5b89\u5168&#xff1a;Java.perform \u5fc5\u987b\u5728\u6709 Java \u73af\u5883\u7684\u7ebf\u7a0b\u6267\u884c&#xff0c;Native \u7ebf\u7a0b\u4e2d\u8c03\u7528\u9700\u4f7f\u7528 Java.scheduleOnMainThread\u3002<\/li>\n<h3>\u516d\u3001\u603b\u7ed3<\/h3>\n<p>Frida \u7684\u6838\u5fc3\u4ef7\u503c\u5728\u4e8e\u6253\u901a\u4e86 Java \u5c42\u4e0e Native \u5c42\u7684\u5206\u6790\u58c1\u5792&#xff1a;Java \u5c42 Hook \u9002\u5408\u5feb\u901f\u5b9a\u4f4d\u4e1a\u52a1\u903b\u8f91\u3001\u9501\u5b9a\u5173\u952e\u51fd\u6570\u5165\u53e3&#xff1b;so \u5c42 Hook \u5219\u6df1\u5165\u5e95\u5c42&#xff0c;\u7528\u4e8e\u8fd8\u539f\u52a0\u5bc6\u7b97\u6cd5\u3001\u7ed5\u8fc7 native \u6821\u9a8c\u3002<\/p>\n<p>\u5b9e\u9645\u9006\u5411\u5206\u6790\u4e2d&#xff0c;\u901a\u5e38\u9075\u5faa \u201c\u5148 Java \u540e so&#xff0c;\u5148\u5bfc\u51fa\u540e\u672a\u5bfc\u51fa\u201d \u7684\u601d\u8def&#xff1a;\u4ece\u4e0a\u5c42\u4e1a\u52a1\u903b\u8f91\u9010\u6b65\u8ffd\u8e2a\u5230\u5e95\u5c42\u7b97\u6cd5&#xff0c;\u7ed3\u5408\u9759\u6001\u5206\u6790\u4e0e\u52a8\u6001\u8c03\u8bd5&#xff0c;\u5f62\u6210\u5b8c\u6574\u7684\u5206\u6790\u94fe\u8def\u3002\u638c\u63e1\u672c\u6587\u7684\u57fa\u7840\u59ff\u52bf\u4e0e\u5b9e\u6218\u6280\u5de7&#xff0c;\u8db3\u4ee5\u5e94\u5bf9\u7edd\u5927\u591a\u6570 APP \u7684\u9006\u5411\u5206\u6790\u573a\u666f\u3002\u5728\u6b64\u57fa\u7840\u4e0a&#xff0c;\u8fd8\u53ef\u4ee5\u8fdb\u4e00\u6b65\u5b66\u4e60 Frida RPC\u3001Stalker \u4ee3\u7801\u8ffd\u8e2a\u3001\u5185\u5b58\u6f2b\u6e38\u7b49\u8fdb\u9636\u529f\u80fd&#xff0c;\u5411\u66f4\u6df1\u5ea6\u7684\u9006\u5411\u5206\u6790\u65b9\u5411\u8fdb\u9636\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Frida \u662f\u4e00\u6b3e\u8de8\u5e73\u53f0\u7684\u52a8\u6001\u4e8c\u8fdb\u5236\u63d2\u6869\u5de5\u5177&#xff0c;\u51ed\u501f JavaScript \u811a\u672c\u5316\u3001\u8f7b\u91cf\u7075\u6d3b\u3001\u5168\u5e73\u53f0\u8986\u76d6\u7684\u7279\u6027&#xff0c;\u6210\u4e3a\u79fb\u52a8\u7aef\u9006\u5411\u5206\u6790\u3001\u5b89\u5168\u6d4b\u8bd5\u9886\u57df\u7684\u6807\u914d\u5de5\u5177\u3002\u65e0\u8bba\u662f Java \u5c42\u7684\u4e1a\u52a1\u903b\u8f91 Hook&#xff0c;\u8fd8\u662f so \u539f\u751f\u5c42\u7684\u7b97\u6cd5\u5206\u6790&#xff0c;Frida \u90fd\u80fd\u63d0\u4f9b\u7edf\u4e00\u7684\u64cd\u4f5c\u8303\u5f0f\u3002\u672c\u6587\u5c06\u4ece\u57fa\u7840\u73af\u5883\u642d\u5efa\u51fa\u53d1&#xff0c;\u7cfb\u7edf\u603b\u7ed3 Java \u5c42\u4e0e so \u5c42\u7684\u5e38\u7528 Hook \u59ff\u52bf&#xff0c;\u7ed3\u5408\u5b9e\u6218\u6848\u4f8b\u68b3\u7406\u5b8c\u6574\u7684\u5206\u6790\u94fe\u8def&#xff0c;\u5e2e\u52a9<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[9210,677],"topic":[],"class_list":["post-113788","post","type-post","status-publish","format-standard","hentry","category-server","tag-frida","tag-677"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Frida\u5165\u95e8\u5230\u5b9e\u6218\uff1ahook so\u5c42\u4e0eJava\u5c42\u7684\u59ff\u52bf\u603b\u7ed3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/113788.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Frida\u5165\u95e8\u5230\u5b9e\u6218\uff1ahook so\u5c42\u4e0eJava\u5c42\u7684\u59ff\u52bf\u603b\u7ed3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"Frida \u662f\u4e00\u6b3e\u8de8\u5e73\u53f0\u7684\u52a8\u6001\u4e8c\u8fdb\u5236\u63d2\u6869\u5de5\u5177&#xff0c;\u51ed\u501f JavaScript \u811a\u672c\u5316\u3001\u8f7b\u91cf\u7075\u6d3b\u3001\u5168\u5e73\u53f0\u8986\u76d6\u7684\u7279\u6027&#xff0c;\u6210\u4e3a\u79fb\u52a8\u7aef\u9006\u5411\u5206\u6790\u3001\u5b89\u5168\u6d4b\u8bd5\u9886\u57df\u7684\u6807\u914d\u5de5\u5177\u3002\u65e0\u8bba\u662f Java \u5c42\u7684\u4e1a\u52a1\u903b\u8f91 Hook&#xff0c;\u8fd8\u662f so \u539f\u751f\u5c42\u7684\u7b97\u6cd5\u5206\u6790&#xff0c;Frida \u90fd\u80fd\u63d0\u4f9b\u7edf\u4e00\u7684\u64cd\u4f5c\u8303\u5f0f\u3002\u672c\u6587\u5c06\u4ece\u57fa\u7840\u73af\u5883\u642d\u5efa\u51fa\u53d1&#xff0c;\u7cfb\u7edf\u603b\u7ed3 Java \u5c42\u4e0e so \u5c42\u7684\u5e38\u7528 Hook \u59ff\u52bf&#xff0c;\u7ed3\u5408\u5b9e\u6218\u6848\u4f8b\u68b3\u7406\u5b8c\u6574\u7684\u5206\u6790\u94fe\u8def&#xff0c;\u5e2e\u52a9\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/113788.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-07T04:49:55+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/113788.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/113788.html\",\"name\":\"Frida\u5165\u95e8\u5230\u5b9e\u6218\uff1ahook so\u5c42\u4e0eJava\u5c42\u7684\u59ff\u52bf\u603b\u7ed3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-07T04:49:55+00:00\",\"dateModified\":\"2026-10-07T04:49:55+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/113788.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/113788.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/113788.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Frida\u5165\u95e8\u5230\u5b9e\u6218\uff1ahook so\u5c42\u4e0eJava\u5c42\u7684\u59ff\u52bf\u603b\u7ed3\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Frida\u5165\u95e8\u5230\u5b9e\u6218\uff1ahook so\u5c42\u4e0eJava\u5c42\u7684\u59ff\u52bf\u603b\u7ed3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/113788.html","og_locale":"zh_CN","og_type":"article","og_title":"Frida\u5165\u95e8\u5230\u5b9e\u6218\uff1ahook so\u5c42\u4e0eJava\u5c42\u7684\u59ff\u52bf\u603b\u7ed3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"Frida \u662f\u4e00\u6b3e\u8de8\u5e73\u53f0\u7684\u52a8\u6001\u4e8c\u8fdb\u5236\u63d2\u6869\u5de5\u5177&#xff0c;\u51ed\u501f JavaScript \u811a\u672c\u5316\u3001\u8f7b\u91cf\u7075\u6d3b\u3001\u5168\u5e73\u53f0\u8986\u76d6\u7684\u7279\u6027&#xff0c;\u6210\u4e3a\u79fb\u52a8\u7aef\u9006\u5411\u5206\u6790\u3001\u5b89\u5168\u6d4b\u8bd5\u9886\u57df\u7684\u6807\u914d\u5de5\u5177\u3002\u65e0\u8bba\u662f Java \u5c42\u7684\u4e1a\u52a1\u903b\u8f91 Hook&#xff0c;\u8fd8\u662f so \u539f\u751f\u5c42\u7684\u7b97\u6cd5\u5206\u6790&#xff0c;Frida \u90fd\u80fd\u63d0\u4f9b\u7edf\u4e00\u7684\u64cd\u4f5c\u8303\u5f0f\u3002\u672c\u6587\u5c06\u4ece\u57fa\u7840\u73af\u5883\u642d\u5efa\u51fa\u53d1&#xff0c;\u7cfb\u7edf\u603b\u7ed3 Java \u5c42\u4e0e so \u5c42\u7684\u5e38\u7528 Hook \u59ff\u52bf&#xff0c;\u7ed3\u5408\u5b9e\u6218\u6848\u4f8b\u68b3\u7406\u5b8c\u6574\u7684\u5206\u6790\u94fe\u8def&#xff0c;\u5e2e\u52a9","og_url":"https:\/\/www.wsisp.com\/helps\/113788.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-07T04:49:55+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/113788.html","url":"https:\/\/www.wsisp.com\/helps\/113788.html","name":"Frida\u5165\u95e8\u5230\u5b9e\u6218\uff1ahook so\u5c42\u4e0eJava\u5c42\u7684\u59ff\u52bf\u603b\u7ed3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-07T04:49:55+00:00","dateModified":"2026-10-07T04:49:55+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/113788.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/113788.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/113788.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Frida\u5165\u95e8\u5230\u5b9e\u6218\uff1ahook so\u5c42\u4e0eJava\u5c42\u7684\u59ff\u52bf\u603b\u7ed3"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/113788","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=113788"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/113788\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=113788"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=113788"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=113788"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=113788"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}