{"id":1500,"date":"2024-09-06T23:29:00","date_gmt":"2024-09-06T15:29:00","guid":{"rendered":"http:\/\/www.xiaosuigu.top\/?p=1500"},"modified":"2024-09-06T23:29:00","modified_gmt":"2024-09-06T15:29:00","slug":"ida%e5%8a%a8%e6%80%81%e8%b0%83%e8%af%95","status":"publish","type":"post","link":"https:\/\/www.xiaosuigu.top\/index.php\/2024\/09\/06\/ida%e5%8a%a8%e6%80%81%e8%b0%83%e8%af%95\/","title":{"rendered":"IDA\u52a8\u6001\u8c03\u8bd5"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">so\u52a0\u8f7d\u6d41\u7a0b<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xiaosuigu.top\/wp-content\/uploads\/2024\/09\/bb663034587188a1fa4ebf55789f66542707-1024x276.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/www.xiaosuigu.top\/wp-content\/uploads\/2024\/09\/bb663034587188a1fa4ebf55789f66542707-1024x276.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" class=\"wp-image-1501\"\/><\/div><\/figure>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>\u51fd\u6570\u540d<\/th><th>\u63cf\u8ff0<\/th><\/tr><\/thead><tbody><tr><td><code>android_dlopen_ext()<\/code>&nbsp;\u3001<code>dlopen()<\/code>\u3001<code>do_dlopen()<\/code><\/td><td>\u8fd9\u4e09\u4e2a\u51fd\u6570\u4e3b\u8981\u7528\u4e8e\u52a0\u8f7d\u5e93\u6587\u4ef6\u3002<code>android_dlopen_ext<\/code>&nbsp;\u662f\u7cfb\u7edf\u7684\u4e00\u4e2a\u51fd\u6570\uff0c\u7528\u4e8e\u5728\u8fd0\u884c\u65f6\u52a8\u6001\u52a0\u8f7d\u5171\u4eab\u5e93\u3002\u4e0e\u6807\u51c6\u7684&nbsp;<code>dlopen()<\/code>&nbsp;\u51fd\u6570\u76f8\u6bd4\uff0c<code>android_dlopen_ext<\/code>&nbsp;\u63d0\u4f9b\u4e86\u66f4\u591a\u7684\u53c2\u6570\u9009\u9879\u548c\u6269\u5c55\u529f\u80fd\uff0c\u4f8b\u5982\u652f\u6301\u547d\u540d\u7a7a\u95f4\u3001\u7b26\u53f7\u7248\u672c\u7b49\u7279\u6027\u3002<\/td><\/tr><tr><td><code>find_library()<\/code><\/td><td><code>find_library()<\/code>&nbsp;\u51fd\u6570\u7528\u4e8e\u67e5\u627e\u5e93\uff0c\u57fa\u672c\u7684\u7528\u9014\u662f\u7ed9\u5b9a\u4e00\u4e2a\u5e93\u7684\u540d\u5b57\uff0c\u7136\u540e\u67e5\u627e\u5e76\u8fd4\u56de\u8fd9\u4e2a\u5e93\u7684\u8def\u5f84\u3002<\/td><\/tr><tr><td><code>call_constructors()<\/code><\/td><td><code>call_constructors()<\/code>&nbsp;\u662f\u7528\u4e8e\u8c03\u7528\u52a8\u6001\u52a0\u8f7d\u5e93\u4e2d\u7684\u6784\u9020\u51fd\u6570\u7684\u51fd\u6570\u3002<\/td><\/tr><tr><td><code>init<\/code><\/td><td>\u5e93\u7684\u6784\u9020\u51fd\u6570\uff0c\u7528\u4e8e\u521d\u59cb\u5316\u5e93\u4e2d\u7684\u9759\u6001\u53d8\u91cf\u6216\u6267\u884c\u5176\u4ed6\u9700\u8981\u5728\u5e93\u88ab\u52a0\u8f7d\u65f6\u5b8c\u6210\u7684\u4efb\u52a1\u3002\u5982\u679c\u6ca1\u6709\u5b9a\u4e49<code>init<\/code>\u51fd\u6570\uff0c\u7cfb\u7edf\u5c06\u4e0d\u4f1a\u6267\u884c\u4efb\u4f55\u52a8\u4f5c\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c<code>init<\/code>\u51fd\u6570\u4e0d\u5e94\u8be5\u6709\u4efb\u4f55\u53c2\u6570\uff0c\u5e76\u4e14\u4e5f\u6ca1\u6709\u8fd4\u56de\u503c\u3002<\/td><\/tr><tr><td><code>init_array<\/code><\/td><td><code>init_array<\/code>\u662fELF\uff08Executable and Linkable Format\uff0c\u53ef\u6267\u884c\u548c\u53ef\u94fe\u63a5\u683c\u5f0f\uff09\u4e8c\u8fdb\u5236\u683c\u5f0f\u4e2d\u7684\u4e00\u4e2a\u7279\u6b8a\u6bb5\uff08section\uff09\uff0c\u8fd9\u4e2a\u6bb5\u5305\u542b\u4e86\u4e00\u4e9b\u51fd\u6570\u7684\u6307\u9488\uff0c\u8fd9\u4e9b\u51fd\u6570\u5c06\u5728<code>main()<\/code>\u51fd\u6570\u6267\u884c\u524d\u88ab\u8c03\u7528\uff0c\u7528\u4e8e\u521d\u59cb\u5316\u9759\u6001\u5c40\u90e8\u53d8\u91cf\u548c\u5168\u5c40\u53d8\u91cf\u3002<\/td><\/tr><tr><td><code>jni_onload<\/code><\/td><td>\u8fd9\u662fAndroid JNI(Java Native Interface)\u4e2d\u7684\u4e00\u4e2a\u51fd\u6570\u3002\u5f53\u4e00\u4e2anative\u5e93\u88ab\u7cfb\u7edf\u52a0\u8f7d\u65f6\uff0c\u8be5\u51fd\u6570\u4f1a\u88ab\u81ea\u52a8\u8c03\u7528\u3002<code>JNI_OnLoad<\/code>\u53ef\u4ee5\u505a\u4e00\u4e9b\u521d\u59cb\u5316\u5de5\u4f5c\uff0c\u4f8b\u5982\u6ce8\u518c\u4f60\u7684native\u65b9\u6cd5\u6216\u8005\u521d\u59cb\u5316\u4e00\u4e9b\u6570\u636e\u7ed3\u6784\u3002\u5982\u679c\u4f60\u7684native\u5e93\u6ca1\u6709\u5b9a\u4e49\u8fd9\u4e2a\u51fd\u6570\uff0c\u90a3\u4e48JNI\u4f1a\u4f7f\u7528\u9ed8\u8ba4\u7684\u884c\u4e3a\u3002<code>JNI_OnLoad<\/code>\u7684\u8fd4\u56de\u503c\u5e94\u8be5\u662f\u9700\u8981\u7684JNI\u7248\u672c\uff0c\u4e00\u822c\u8fd4\u56de<code>JNI_VERSION_1_6<\/code>\u3002<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u4e0b\u65ad\u70b9\u65f6\u673a\uff1a<br>\u5e94\u7528\u7ea7\u522b\u7684\uff1ajava_com_XXX\uff1b<br>\u5916\u58f3\u7ea7\u522b\u7684\uff1aJNI_Onload\uff0c.init\uff0c.init_array(\u53cd\u8c03\u8bd5);<br>\u7cfb\u7edf\u7ea7\u522b\u7684\uff1afopen\uff0cfget\uff0cdvmdexfileopen(\u8131\u58f3)\uff1b<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u52a8\u6001\u8c03\u8bd5<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u524d\u7f6e\u64cd\u4f5c<\/h3>\n\n\n\n<ol class=\"wp-block-list\"><li>\u5728IDA\u76ee\u5f55\u4e0b\u7684dbgsrv\uff0c\u9009\u62e9\u8ddf\u624b\u673a\u67b6\u6784\u4e00\u81f4\u7684server<\/li><li>adb push \u5bf9\u5e94\u7684server\u6587\u4ef6 \/data\/local\/tmp\/<\/li><li>\u8fdb\u5165\u624b\u673a\u7aef\u547d\u4ee4\uff1aadb shell<\/li><li>\u5207\u6362\u83b7\u53d6\u624b\u673a\u7684root\u6743\u9650\uff1asu<\/li><li>\u8df3\u5230\u5bf9\u5e94\u8def\u5f84\uff1acd \/data\/local\/tmp\/<\/li><li>\u63d0\u6743\uff1achmod 777 as<\/li><li>XappDebug hook<\/li><\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">\u8c03\u8bd5\u64cd\u4f5c<\/h3>\n\n\n\n<ol class=\"wp-block-list\"><li>\u4fee\u6539IDAdebug2.bat\u6587\u4ef6\u5185\u7684\u5305\u540d\u548c\u7c7b\u540d\uff08<code>adb shell dumpsys package \u5305\u540d<\/code>  \u6765\u83b7\u53d6\u7c7b\u540d\uff09<\/li><li>\u8fd0\u884cIDAdebug1.bat\u6587\u4ef6<\/li><li>IDA\u9009\u62e9Debugger&#8211;Search Debugger&#8211;ARM<\/li><li>Debugger&#8211;Process options&#8211;IP\u8f93\u5165127.0.0.1&#8211;\u7aef\u53e3\u6ca1\u5728IDAdebug1.bat\u79cd\u4fee\u6539\u5c31\u9ed8\u8ba4\u5373\u53ef<\/li><li>Debugger&#8211;Attach to Process&#8211;\u9009\u62e9\u5bf9\u5e94\u7684\u5305\u540d<\/li><li>\u70b9\u51fb\u8fd0\u884c&#8211;\u6bd4\u5bf9so\u6587\u4ef6&#8211;\u8c03\u8bd5\u5f00\u59cb<\/li><\/ol>\n\n\n\n<p>\u64cd\u4f5c\u89c6\u9891\uff1a<a href=\"https:\/\/www.bilibili.com\/video\/BV1u8411S7xZ\/?spm_id_from=333.788&amp;vd_source=8cd8ff709a3333454baaad478b052c6f\">\u543e\u7231\u7834\u89e3\u5b89\u5353\u9006\u5411\u5165\u95e8\u6559\u7a0b\u300a\u5b89\u5353\u9006\u5411\u8fd9\u6863\u4e8b\u300b\u5341\u4e8c\u3001\u5927\u4f6c\u5e2e\u6211\u5206\u6790\u4e00\u4e0b_\u54d4\u54e9\u54d4\u54e9_bilibili<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5feb\u6377\u952e<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>\u5feb\u6377\u952e<\/th><th>\u529f\u80fd<\/th><\/tr><\/thead><tbody><tr><td><code>F2<\/code><\/td><td>\u5728\u6240\u5728\u884c\u4e0b\u65ad\u70b9<\/td><\/tr><tr><td><code>F5<\/code><\/td><td>\u53ef\u4ee5\u5c06ARM\u6307\u4ee4\u8f6c\u5316\u4e3a\u53ef\u8bfb\u7684C\u4ee3\u7801\uff0c\u540c\u65f6\u53ef\u4ee5\u4f7f\u7528Y\u952e\uff0c\u5bf9JNIEnv\u6307\u9488\u505a\u4e00\u4e2a\u7c7b\u578b\u8f6c\u6362\uff0c\u4ece\u800c\u5bf9JNI\u91cc\u7ecf\u5e38\u4f7f\u7528\u7684JNIEnv\u65b9\u6cd5\u80fd\u591f\u8bc6\u522b<\/td><\/tr><tr><td><code>F7<\/code><\/td><td>\u5355\u6b65\u8fdb\u5165\u8c03\u8bd5<\/td><\/tr><tr><td><code>F8<\/code><\/td><td>\u6309\u7167\u987a\u5e8f\u4e00\u884c\u4e00\u884c\uff0c\u5355\u6b65\u8c03\u8bd5<\/td><\/tr><tr><td><code>F9<\/code><\/td><td>\u76f4\u63a5\u8df3\u5230\u4e0b\u4e00\u4e2a\u65ad\u70b9\u5904<\/td><\/tr><tr><td><code>Shift + F12<\/code><\/td><td>\u5feb\u901f\u67e5\u770bso\u6587\u4ef6\u4e2d\u7684\u5b57\u7b26\u4e32\u4fe1\u606f\uff0c\u5206\u6790\u8fc7\u7a0b\u4e2d\u901a\u8fc7\u4e00\u4e9b\u5173\u952e\u5b57\u7b26\u4e32\u80fd\u591f\u8fc5\u901f\u5b9a\u4f4d\u5230\u5173\u952e\u51fd\u6570<\/td><\/tr><tr><td><code>Ctrl + s<\/code><\/td><td>\u6709\u4e24\u4e2a\u7528\u9014\uff0c\u5728IDA View\u9875\u9762\u4e2d\u53ef\u4ee5\u67e5\u770b\u6587\u4ef6so\u6587\u4ef6\u7684\u6240\u6709\u6bb5\u4fe1\u606f\uff0c\u5728\u8c03\u8bd5\u9875\u9762\u53ef\u4ee5\u67e5\u770b\u7a0b\u5e8f\u4e2d\u6240\u6709so\u6587\u4ef6\u6620\u5c04\u5230\u5185\u5b58\u7684\u57fa\u5730\u5740\u3002tips:\u5728\u8fdb\u884cso\u8c03\u8bd5\u8fc7\u7a0b\u4e2d\uff0c\u5f88\u6709\u7528\u7684\u4e00\u4e2a\u5c0f\u6280\u5de7\u5c31\u662fIDA\u53cc\u5f00\uff0c\u4e00\u4e2a\u7528\u4e8e\u8fdb\u884c\u9759\u6001\u5206\u6790\uff1b\u4e00\u4e2a\u7528\u4e8e\u52a8\u6001\u8c03\u8bd5\u3002\u6bd4\u5982\u8bf4\u8c03\u8bd5\u8fc7\u7a0b\u4e2d\u8981\u627e\u5230\u4e00\u4e2a\u51fd\u6570\u7684\u52a0\u8f7d\u5230\u5185\u5b58\u4e2d\u7684\u4f4d\u7f6e<\/td><\/tr><tr><td><code>Esc<\/code><\/td><td>\u56de\u9000\u952e\uff0c\u80fd\u591f\u5012\u56de\u4e0a\u4e00\u90e8\u64cd\u4f5c\u7684\u89c6\u56fe\uff08\u53ea\u6709\u5728\u53cd\u6c47\u7f16\u7a97\u53e3\u624d\u662f\u8fd9\u4e2a\u4f5c\u7528\uff0c\u5982\u679c\u662f\u5728\u5176\u4ed6\u7a97\u53e3\u6309\u4e0besc\uff0c\u4f1a\u5173\u95ed\u8be5\u7a97\u53e3\uff09<\/td><\/tr><tr><td><code>g<\/code><\/td><td>\u76f4\u63a5\u8df3\u5230\u67d0\u4e2a\u5730\u5740<\/td><\/tr><tr><td><code>y<\/code><\/td><td>\u66f4\u6539\u53d8\u91cf\u7684\u7c7b\u578b<\/td><\/tr><tr><td><code>x<\/code><\/td><td>\u5bf9\u7740\u67d0\u4e2a\u51fd\u6570\u3001\u53d8\u91cf\u6309\u8be5\u5feb\u6377\u952e\uff0c\u53ef\u4ee5\u67e5\u770b\u5b83\u7684\u4ea4\u53c9\u5f15\u7528<\/td><\/tr><tr><td><code>n<\/code><\/td><td>\u66f4\u6539\u53d8\u91cf\u7684\u540d\u79f0<\/td><\/tr><tr><td><code>p<\/code><\/td><td>\u521b\u5efa\u51fd\u6570<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u611f\u8c22\uff1a<a href=\"https:\/\/www.52pojie.cn\/thread-1809646-1-1.html\">\u3010\u65b0\u63d0\u9192\u3011\u300a\u5b89\u5353\u9006\u5411\u8fd9\u6863\u4e8b\u300b\u5341\u4e8c\u3001\u5927\u4f6c\u5e2e\u6211\u5206\u6790\u4e00\u4e0b &#8211; \u300e\u79fb\u52a8\u5b89\u5168\u533a\u300f &#8211; \u543e\u7231\u7834\u89e3 &#8211; LCG &#8211; LSG |\u5b89\u5353\u7834\u89e3|\u75c5\u6bd2\u5206\u6790|www.52pojie.cn<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>so\u52a0\u8f7d\u6d41\u7a0b \u51fd\u6570\u540d \u63cf\u8ff0 android_dlopen_ext()&nbsp;\u3001dlopen()\u3001do_dl [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-1500","post","type-post","status-publish","format-standard","hentry","category-android"],"_links":{"self":[{"href":"https:\/\/www.xiaosuigu.top\/index.php\/wp-json\/wp\/v2\/posts\/1500","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xiaosuigu.top\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xiaosuigu.top\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xiaosuigu.top\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xiaosuigu.top\/index.php\/wp-json\/wp\/v2\/comments?post=1500"}],"version-history":[{"count":0,"href":"https:\/\/www.xiaosuigu.top\/index.php\/wp-json\/wp\/v2\/posts\/1500\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.xiaosuigu.top\/index.php\/wp-json\/wp\/v2\/media?parent=1500"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xiaosuigu.top\/index.php\/wp-json\/wp\/v2\/categories?post=1500"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xiaosuigu.top\/index.php\/wp-json\/wp\/v2\/tags?post=1500"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}