{"id":115655,"date":"2026-10-12T21:56:59","date_gmt":"2026-10-12T13:56:59","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/115655.html"},"modified":"2026-10-12T21:56:59","modified_gmt":"2026-10-12T13:56:59","slug":"android-so-%e9%80%86%e5%90%91%e5%ae%9e%e6%88%98%ef%bc%9a%e5%9f%ba%e4%ba%8e-unicorn-%e5%bc%95%e6%93%8e%e7%9a%84-native-%e7%ae%97%e6%b3%95%e6%a8%a1%e6%8b%9f%e6%89%a7%e8%a1%8c%e4%b8%8e%e8%84%b1%e6%9c%ba","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/115655.html","title":{"rendered":"Android SO \u9006\u5411\u5b9e\u6218\uff1a\u57fa\u4e8e Unicorn \u5f15\u64ce\u7684 Native \u7b97\u6cd5\u6a21\u62df\u6267\u884c\u4e0e\u8131\u673a\u89e3\u5bc6"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261012135658-6acce72a7d7cc.webp\" alt=\"\u5c01\u9762\u4fe1\u606f\u56fe\" \/><\/p>\n<p>\u5728\u79fb\u52a8\u7aef\u5b89\u5168\u4e0e\u4e1a\u52a1\u98ce\u63a7\u5bf9\u6297\u4e2d&#xff0c;\u9006\u5411\u5de5\u7a0b\u5e08\u6700\u5e38\u9762\u5bf9\u7684\u4e00\u9053\u96be\u5173&#xff0c;\u83ab\u8fc7\u4e8e\u7535\u5546 App \u6838\u5fc3\u8d44\u4ea7\u6a21\u5757&#xff08;\u5982\u53cc 11 \u79d2\u6740\u8bf7\u6c42\u7b7e\u540d\u751f\u6210\u3001\u9ad8\u5371\u63a5\u53e3\u8bbe\u5907\u6307\u7eb9\u52a0\u5bc6&#xff09;\u7684\u9006\u5411\u8fd8\u539f\u3002\u5f00\u53d1\u56e2\u961f\u4e3a\u4e86\u5bf9\u6297\u9006\u5411&#xff0c;\u901a\u5e38\u4f1a\u5c06\u6838\u5fc3 C\/C&#043;&#043; \u7b97\u6cd5\u7f16\u8bd1\u8fdb Android Native SO \u5e93&#xff08;\u5982 libsec_sign.so&#xff09;&#xff0c;\u5e76\u5957\u4e0a\u9ad8\u5f3a\u5ea6\u7684\u5546\u4e1a\u52a0\u56fa\u5916\u58f3&#xff1a;\u53cc\u5c42\u63a7\u5236\u6d41\u5e73\u5766\u5316&#xff08;OLLVM Flattening&#xff09;\u3001\u4e0a\u4e07\u6761\u7531\u5b8f\u5c55\u5f00\u6784\u6210\u7684\u865a\u5047\u6307\u4ee4&#xff08;Bogus Control Flow&#xff09;\u3001\u4ee5\u53ca\u52a8\u6001\u6307\u4ee4\u66ff\u6362\u4e0e\u81ea\u4fee\u6539\u4ee3\u7801&#xff08;Self-Modifying Code&#xff09;\u3002<\/p>\n<p>\u9762\u5bf9\u8fd9\u79cd\u52a8\u8f84\u6570\u4e07\u884c\u53cd\u7f16\u8bd1\u4f2a\u4ee3\u7801\u7684\u5e9e\u7136\u5927\u7269&#xff0c;\u5982\u679c\u575a\u6301\u201c\u7eaf\u624b\u5de5\u9759\u6001\u8fd8\u539f\u6bcf\u4e00\u4e2a\u4f4d\u8fd0\u7b97\u3001\u7528 Python \u91cd\u5199\u4e00\u5957\u6570\u5b66\u903b\u8f91\u201d&#xff0c;\u5373\u4fbf\u662f\u4e00\u4e2a\u7ecf\u9a8c\u6781\u4e3a\u4e30\u5bcc\u7684\u9ad8\u7ea7\u9006\u5411\u4e13\u5bb6&#xff0c;\u5f80\u5f80\u4e5f\u9700\u8981\u6d88\u8017\u6570\u5468\u751a\u81f3\u6574\u6708\u7684\u65f6\u95f4&#xff1b;\u800c\u5982\u679c\u91c7\u7528\u57fa\u4e8e\u771f\u673a\u7684 Frida RPC \u6302\u94a9\u65b9\u6848&#xff0c;\u7531\u4e8e\u9700\u8981\u4f9d\u8d56\u771f\u5b9e\u7684\u624b\u673a\u786c\u4ef6\u3001USB \u8c03\u8bd5\u7ebf\u4ee5\u53ca\u771f\u673a\u73af\u5883\u53cd\u68c0\u6d4b\u7ef4\u62a4&#xff0c;\u5176\u5728\u5de5\u4e1a\u7ea7\u81ea\u52a8\u5316\u6d4b\u8bd5\u6216\u9ad8\u5e76\u53d1\u6279\u91cf\u8c03\u7528\u65f6\u4e0d\u4ec5\u6781\u5176\u7b28\u91cd&#xff0c;\u4e14\u6781\u6613\u56e0\u624b\u673a\u53d1\u70ed\u6389\u7ebf\u800c\u5d29\u6e83\u3002<\/p>\n<p>\u9762\u5bf9\u8fd9\u4e00\u56f0\u5883&#xff0c;\u73b0\u4ee3\u9ad8\u9636\u9006\u5411\u5de5\u7a0b\u50ac\u751f\u51fa\u4e86\u4e00\u79cd\u5177\u5907\u964d\u7ef4\u6253\u51fb\u80fd\u529b\u7684\u4f18\u96c5\u6d41\u6d3e\u2014\u2014\u57fa\u4e8e Unicorn \u5f15\u64ce\u7684\u7eaf\u8131\u673a CPU \u6a21\u62df\u6267\u884c&#xff08;CPU Emulation&#xff09;\u3002<\/p>\n<p>\u6211\u4eec\u6839\u672c\u4e0d\u9700\u8981\u53bb\u5173\u5fc3\u7b97\u6cd5\u5185\u90e8\u7ecf\u8fc7\u4e86\u591a\u4e48\u590d\u6742\u7684 OLLVM \u6df7\u6dc6&#xff0c;\u4e5f\u4e0d\u9700\u8981\u4e00\u53f0\u771f\u5b9e\u7684 Android \u624b\u673a\u3002\u6211\u4eec\u76f4\u63a5\u5728 PC \u7aef\u7684 Python \u8fdb\u7a0b\u4e2d&#xff0c;\u7528\u7eaf\u8f6f\u4ef6\u865a\u62df\u51fa\u4e00\u4e2a\u5b8c\u6574\u7684 ARM64 CPU \u7269\u7406\u4eff\u771f\u6c99\u7bb1&#xff0c;\u76f4\u63a5\u628a SO \u5e93\u4e2d\u7684\u52a0\u5bc6\u51fd\u6570\u52a0\u8f7d\u8fdb\u4eff\u771f\u5185\u5b58\u8dd1\u4e00\u904d&#xff0c;\u76f4\u63a5\u635e\u53d6\u6700\u7ec8\u7684\u8ba1\u7b97\u7ed3\u679c&#xff01;<\/p>\n<hr \/>\n<h4>\u4e00\u3001 \u6a21\u62df\u6267\u884c\u7684\u7834\u5c40\u54f2\u5b66&#xff1a;\u4e3a\u4ec0\u4e48 Unicorn \u662f\u6df7\u6dc6\u4ee3\u7801\u7684\u514b\u661f&#xff1f;<\/h4>\n<h5>1. \u8f6f\u4ef6\u865a\u62df\u5316 vs \u7b97\u6cd5\u8fd8\u539f<\/h5>\n<ul>\n<li>\u4f20\u7edf\u4ee3\u7801\u8fd8\u539f\u7684\u75db\u70b9&#xff1a;\u65e0\u8bba\u6df7\u6dc6\u5668\u63d2\u5165\u4e86\u591a\u5c11\u4e0d\u900f\u660e\u8c13\u8bcd\u3001\u6253\u5e73\u4e86\u591a\u5c11\u5faa\u73af&#xff0c;\u6240\u6709\u7684\u6df7\u6dc6\u6307\u4ee4\u5f52\u6839\u5230\u5e95\u90fd\u5fc5\u987b\u5728 CPU \u786c\u4ef6\u4e0a\u771f\u5b9e\u6267\u884c\u4e00\u904d&#xff0c;\u624d\u80fd\u5f97\u51fa\u6b63\u786e\u7684\u7ed3\u679c&#xff1b;<\/li>\n<li>Unicorn \u7684\u964d\u7ef4\u7834\u5c40&#xff1a;Unicorn Engine&#xff08;\u7531\u6743\u5a01\u5b89\u5168\u56e2\u961f\u57fa\u4e8e QEMU \u7684\u5fae\u5185\u6838\u5265\u79bb\u7814\u53d1&#xff09;\u662f\u4e00\u4e2a\u7eaf\u7cb9\u7684 CPU \u6307\u4ee4\u96c6\u6a21\u62df\u5668\u3002\u5b83\u4e0d\u5305\u542b\u4efb\u4f55\u64cd\u4f5c\u7cfb\u7edf\u7684\u5e9e\u6742\u6982\u5ff5&#xff0c;\u53ea\u4e13\u6ce8\u4e8e\u5fe0\u5b9e\u5730\u6267\u884c\u673a\u5668\u6307\u4ee4\u3001\u66f4\u65b0\u5bc4\u5b58\u5668\u72b6\u6001\u548c\u5185\u5b58\u9875\u8868\u3002<\/li>\n<\/ul>\n<p>[\u4f20\u7edf\u9006\u5411\u8fd8\u539f\u8def\u7ebf]:<br \/>\n\u6df7\u6dc6\u7684 ARM64 \u6c47\u7f16 &#8212;&gt; \u8270\u82e6\u7684\u4eba\u5de5\u53bb\u5e73\u5766\u5316 &#8212;&gt; \u8fd8\u539f\u6570\u5b66\u903b\u8f91 &#8212;&gt; \u624b\u5199 Python (\u6781\u5ea6\u8017\u65f6)<\/p>\n<p>[Unicorn \u6a21\u62df\u6267\u884c\u8def\u7ebf]:<br \/>\n\u6df7\u6dc6\u7684 ARM64 \u6c47\u7f16 &#8212;&gt; \u7eaf\u5185\u5b58\u76f4\u63a5\u6620\u5c04\u8fdb Unicorn \u4eff\u771f CPU &#8212;&gt; \u8fd0\u884c 20000 \u6761\u6307\u4ee4 &#8212;&gt; \u76f4\u63a5\u8bfb\u8fd4\u56de\u503c!<br \/>\n(\u6574\u4e2a\u8fc7\u7a0b\u5b8c\u5168\u65e0\u89c6\u4efb\u4f55\u4ee3\u7801\u6df7\u6dc6&#xff0c;\u8017\u65f6\u4ec5\u9700\u6570\u6beb\u79d2!)<\/p>\n<hr \/>\n<h4>\u4e8c\u3001 \u8131\u673a\u6a21\u62df\u6267\u884c\u7684\u56db\u5927\u6838\u5fc3\u5de5\u7a0b\u652f\u67f1<\/h4>\n<p>\u8981\u8ba9\u4e00\u4e2a\u539f\u672c\u4f9d\u8d56 Android \u64cd\u4f5c\u7cfb\u7edf&#xff08;Linux \u5185\u6838 &#043; Bionic Libc &#043; ART \u865a\u62df\u673a&#xff09;\u7684 Native SO \u5e93\u5728\u7eaf PC \u7aef\u8131\u673a\u8fd0\u884c\u8d77\u6765&#xff0c;\u5fc5\u987b\u5728\u7528\u6237\u6001\u5b8c\u6210\u56db\u5927\u73af\u5883\u865a\u62df\u5316&#xff1a;<\/p>\n<p>&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#043;<br \/>\n| \u652f\u67f1 1: \u5185\u5b58\u7a7a\u95f4\u5e03\u5c40\u865a\u62df\u5316 (Memory Layout Emulation)         |<br \/>\n| -&gt; \u5229\u7528 uc.mem_map \u5206\u914d\u4eff\u771f\u5185\u5b58\u7a7a\u95f4: \u4ee3\u7801\u6bb5\u3001\u6570\u636e\u6bb5\u3001\u5806\u6808\u7a7a\u95f4 |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#043;<br \/>\n                              |<br \/>\n                              v<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#043;<br \/>\n| \u652f\u67f1 2: ELF \u4e8c\u8fdb\u5236\u88c5\u8f7d\u4e0e\u91cd\u5b9a\u4f4d (ELF Loader &amp; Relocation)     |<br \/>\n| -&gt; \u89e3\u6790 SO \u7684 Program Headers&#xff0c;\u5c06 LOAD \u6bb5\u62f7\u8d1d\u81f3\u6307\u5b9a\u57fa\u5740       |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#043;<br \/>\n                              |<br \/>\n                              v<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#043;<br \/>\n| \u652f\u67f1 3: \u5bc4\u5b58\u5668\u73af\u5883\u521d\u59cb\u5316 (Register State Setup)              |<br \/>\n| -&gt; \u8bbe\u7f6e SP (\u6808\u9876\u6307\u9488)\u3001\u914d\u7f6e X0 (JNIEnv*)\u3001X2 (\u8f93\u5165\u53c2\u6570\u6307\u9488)    |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#043;<br \/>\n                              |<br \/>\n                              v<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#043;<br \/>\n| \u652f\u67f1 4: \u5916\u90e8\u7cfb\u7edf\u8c03\u7528\u4e0e libc \u51fd\u6570\u6253\u6869 (Hooking &amp; Stubbing)     |<br \/>\n| -&gt; \u9488\u5bf9 malloc, memcpy, __android_log \u7b49\u5916\u90e8\u7b26\u53f7\u8fdb\u884c\u5185\u5b58\u6253\u6869  |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#043;<\/p>\n<hr \/>\n<h4>\u4e09\u3001 \u5de5\u7a0b\u5b9e\u6218&#xff1a;\u57fa\u4e8e Python \u4e0e Unicorn \u8fd8\u539f\u7b7e\u540d\u7b97\u6cd5<\/h4>\n<p>\u5047\u8bbe\u6211\u4eec\u4ece APK \u4e2d\u63d0\u53d6\u51fa\u4e86 libsecurity.so&#xff0c;\u9759\u6001\u9006\u5411\u5df2\u7ecf\u5b9a\u4f4d\u5230\u6838\u5fc3\u52a0\u5bc6\u51fd\u6570\u7684\u504f\u79fb\u4e3a 0x12A40\u3002\u8be5\u51fd\u6570\u662f\u4e00\u4e2a\u7eaf\u6570\u5b66\u54c8\u5e0c\u51fd\u6570&#xff0c;\u63a5\u6536\u4e24\u4e2a\u53c2\u6570&#xff1a;\u8f93\u5165\u6587\u672c\u6307\u9488\u4e0e\u6587\u672c\u957f\u5ea6\u3002<\/p>\n<p>\u4ee5\u4e0b\u5c55\u793a\u5b8c\u6574\u7684 Python \u8131\u673a\u6a21\u62df\u6267\u884c\u5de5\u7a0b\u4ee3\u7801\u9aa8\u67b6&#xff1a;<\/p>\n<p>from unicorn import *<br \/>\nfrom unicorn.arm64_const import *<br \/>\nfrom elftools.elf.elffile import ELFFile<br \/>\nimport struct<\/p>\n<p># 1. \u865a\u62df\u5185\u5b58\u57fa\u5740\u89c4\u5212 (\u5bf9\u9f50\u5230 4KB \u9875\u9762)<br \/>\nSO_BASE_ADDR   &#061; 0x40000000     # SO \u5e93\u52a0\u8f7d\u57fa\u5740<br \/>\nSTACK_ADDR     &#061; 0x80000000     # \u865a\u62df\u6808\u57fa\u5740<br \/>\nSTACK_SIZE     &#061; 1024 * 1024    # 1MB \u6808\u7a7a\u95f4<br \/>\nHEAP_ADDR      &#061; 0x90000000     # \u865a\u62df\u5806\u7a7a\u95f4\u57fa\u5740<br \/>\nHEAP_SIZE      &#061; 1024 * 1024    # 1MB \u5806\u7a7a\u95f4<\/p>\n<p>def load_and_emulate_native_sign(so_path: str, input_payload: bytes) -&gt; str:<br \/>\n    print(f&#034;[*] \u542f\u52a8 Unicorn ARM64 \u6a21\u62df\u6267\u884c\u5f15\u64ce&#8230;&#034;)<br \/>\n    # \u5b9e\u4f8b\u5316 64 \u4f4d ARM \u4eff\u771f\u5f15\u64ce<br \/>\n    uc &#061; Uc(UC_ARCH_ARM64, UC_MODE_ARM)<\/p>\n<p>    # 2. \u6620\u5c04\u865a\u62df\u6808\u4e0e\u5806<br \/>\n    uc.mem_map(STACK_ADDR, STACK_SIZE)<br \/>\n    uc.mem_map(HEAP_ADDR, HEAP_SIZE)<br \/>\n    # \u521d\u59cb\u5316\u6808\u6307\u9488 (SP \u4f4d\u4e8e\u6808\u9876\u9ad8\u5730\u5740&#xff0c;\u5411\u4e0b\u589e\u957f)<br \/>\n    uc.reg_write(UC_ARM64_REG_SP, STACK_ADDR &#043; STACK_SIZE &#8211; 0x1000)<\/p>\n<p>    # 3. \u89e3\u6790\u5e76\u6620\u5c04 ELF \u6587\u4ef6\u5404\u4e2a LOAD \u6bb5<br \/>\n    print(f&#034;[*] \u89e3\u6790\u5e76\u6620\u5c04\u76ee\u6807 SO \u6587\u4ef6: {so_path}&#034;)<br \/>\n    with open(so_path, &#039;rb&#039;) as f:<br \/>\n        elf &#061; ELFFile(f)<br \/>\n        for segment in elf.iter_segments():<br \/>\n            if segment[&#039;p_type&#039;] &#061;&#061; &#039;PT_LOAD&#039;:<br \/>\n                # \u9875\u9762\u5bf9\u9f50\u8ba1\u7b97<br \/>\n                seg_vaddr &#061; segment[&#039;p_vaddr&#039;]<br \/>\n                seg_memsz &#061; segment[&#039;p_memsz&#039;]<br \/>\n                page_start &#061; (SO_BASE_ADDR &#043; seg_vaddr) &amp; ~0xFFF<br \/>\n                page_end &#061; (SO_BASE_ADDR &#043; seg_vaddr &#043; seg_memsz &#043; 0xFFF) &amp; ~0xFFF<br \/>\n                page_size &#061; page_end &#8211; page_start<\/p>\n<p>                # \u6620\u5c04\u5185\u5b58\u9875\u5e76\u5199\u5165\u539f\u59cb\u4e8c\u8fdb\u5236\u6570\u636e<br \/>\n                uc.mem_map(page_start, page_size)<br \/>\n                uc.mem_write(SO_BASE_ADDR &#043; seg_vaddr, segment.data())<\/p>\n<p>    # 4. \u5c06\u8f93\u5165\u53c2\u6570\u5199\u5165\u865a\u62df\u5806\u5185\u5b58\u4e2d<br \/>\n    input_str_addr &#061; HEAP_ADDR &#043; 0x100<br \/>\n    uc.mem_write(input_str_addr, input_payload &#043; b&#039;\\\\x00&#039;)<\/p>\n<p>    # \u4e3a\u8f93\u51fa\u7ed3\u679c\u9884\u5206\u914d\u4e00\u4e2a\u7f13\u51b2\u533a<br \/>\n    output_buf_addr &#061; HEAP_ADDR &#043; 0x200<\/p>\n<p>    # 5. \u914d\u7f6e ARM64 \u51fd\u6570\u8c03\u7528\u5bc4\u5b58\u5668\u53c2\u6570 (\u9075\u5faa AAPCS \u89c4\u7ea6)<br \/>\n    # \u5047\u8bbe\u76ee\u6807\u51fd\u6570\u539f\u578b: char* compute_sign(const char* input, int len, char* out_buf)<br \/>\n    uc.reg_write(UC_ARM64_REG_X0, input_str_addr)        # X0: \u8f93\u5165\u53c2\u6570\u6307\u9488<br \/>\n    uc.reg_write(UC_ARM64_REG_X1, len(input_payload))    # X1: \u8f93\u5165\u957f\u5ea6<br \/>\n    uc.reg_write(UC_ARM64_REG_X2, output_buf_addr)       # X2: \u7ed3\u679c\u56de\u5199\u7f13\u51b2\u533a<\/p>\n<p>    # \u8bbe\u7f6e\u8fd4\u56de\u94fe\u63a5\u5bc4\u5b58\u5668 LR (X30)&#xff0c;\u5f53\u51fd\u6570\u6267\u884c ret \u65f6\u8df3\u56de\u4e00\u4e2a\u9b54\u6570\u5730\u5740\u4f5c\u4e3a\u7ec8\u6b62\u4fe1\u53f7<br \/>\n    MAGIC_EXIT_ADDR &#061; 0x50000000<br \/>\n    uc.mem_map(MAGIC_EXIT_ADDR, 0x1000)<br \/>\n    uc.reg_write(UC_ARM64_REG_X30, MAGIC_EXIT_ADDR)<\/p>\n<p>    # 6. \u6838\u5fc3\u4eff\u771f\u542f\u52a8&#xff01;<br \/>\n    target_func_addr &#061; SO_BASE_ADDR &#043; 0x12A40<br \/>\n    print(f&#034;[*] \u542f\u52a8\u673a\u5668\u7801\u6267\u884c: 0x{target_func_addr:X} &#8212;-&gt; \u7ec8\u6b62\u9000\u51fa\u70b9: 0x{MAGIC_EXIT_ADDR:X}&#034;)<\/p>\n<p>    # \u4eff\u771f\u6267\u884c&#xff0c;\u76f4\u5230 PC \u8fbe\u5230 MAGIC_EXIT_ADDR<br \/>\n    uc.emu_start(target_func_addr, MAGIC_EXIT_ADDR, timeout&#061;5000000, count&#061;0)<\/p>\n<p>    # 7. \u4ece\u8f93\u51fa\u7f13\u51b2\u533a\u8bfb\u53d6\u6700\u7ec8\u7684\u52a0\u5bc6\u5b57\u7b26\u4e32<br \/>\n    result_bytes &#061; uc.mem_read(output_buf_addr, 32)<br \/>\n    final_sign &#061; bytes(result_bytes).split(b&#039;\\\\x00&#039;)[0].decode(&#039;utf-8&#039;, errors&#061;&#039;ignore&#039;)<\/p>\n<p>    print(f&#034;[&#043;] \u6a21\u62df\u6267\u884c\u6210\u529f&#xff01;\u63d0\u53d6\u51fa\u8131\u673a\u52a0\u5bc6\u7ed3\u679c: {final_sign}&#034;)<br \/>\n    return final_sign<\/p>\n<p># \u9a8c\u8bc1\u8c03\u7528<br \/>\ntest_payload &#061; b&#034;timestamp&#061;1791518400&amp;device_id&#061;sec_009&#034;<br \/>\nload_and_emulate_native_sign(&#034;libsecurity.so&#034;, test_payload)<\/p>\n<hr \/>\n<h4>\u56db\u3001 \u9ad8\u7ea7\u5bf9\u6297\u6392\u9519&#xff1a;\u672a\u6253\u6869\u7cfb\u7edf\u8c03\u7528\u4e0e\u73af\u5883\u68c0\u6d4b\u7834\u9664<\/h4>\n<p>\u5728\u771f\u5b9e\u7684\u590d\u6742 SO \u5e93\u4e2d&#xff0c;\u7b97\u6cd5\u5f80\u5f80\u4f1a\u7a7f\u63d2\u5c11\u91cf\u7684\u7cfb\u7edf\u51fd\u6570\u8c03\u7528&#xff0c;\u6a21\u62df\u6267\u884c\u53ef\u80fd\u4f1a\u62a5\u9519 UC_ERR_READ_UNMAPPED&#xff08;\u8bbf\u95ee\u672a\u6620\u5c04\u5185\u5b58&#xff09;&#xff1a;<\/p>\n<li>JNIEnv \u4e0e Java \u56de\u8c03\u6253\u6869&#xff08;Stubbing&#xff09;&#xff1a;\u82e5 SO \u5e93\u8bd5\u56fe\u8c03\u7528 env-&gt;CallStaticObjectMethod \u53cd\u5c04\u83b7\u53d6\u7cfb\u7edf\u7248\u672c&#xff0c;\u6211\u4eec\u53ea\u9700\u5728\u5185\u5b58\u4e2d\u865a\u62df\u4f2a\u9020\u4e00\u4e2a\u5305\u542b\u5168\u90e8\u51fd\u6570\u6307\u9488\u7684 JNIInvokeInterface \u7ed3\u6784\u4f53\u8868&#xff0c;\u5728\u6240\u6709\u51fd\u6570\u6307\u9488\u4f4d\u7f6e\u586b\u5145\u6307\u5411\u4e00\u6761\u7a7a\u8fd4\u56de\u6307\u4ee4&#xff08;ret&#xff09;\u7684\u5185\u5b58\u9875\u5373\u53ef&#xff1b;<\/li>\n<li>\u53cd\u6a21\u62df\u5668\u6307\u7eb9\u7834\u9664&#xff1a;\u90e8\u5206\u7b97\u6cd5\u5728\u6267\u884c\u65f6\u4f1a\u8bfb\u53d6\u7cfb\u7edf\u65f6\u95f4 gettimeofday() \u6216\u6587\u4ef6 \/proc\/cpuinfo\u3002\u5728 Unicorn \u4e2d&#xff0c;\u6211\u4eec\u53ef\u4ee5\u5229\u7528 uc.hook_add(UC_HOOK_CODE, &#8230;) \u6ce8\u518c\u6307\u4ee4\u7ea7\u94a9\u5b50&#xff0c;\u4e00\u65e6\u68c0\u6d4b\u5230\u5373\u5c06\u6267\u884c svc #0 \u7cfb\u7edf\u8c03\u7528&#xff0c;\u76f4\u63a5\u7528 Python \u4fee\u6539\u5bc4\u5b58\u5668\u4f2a\u9020\u5408\u6cd5\u7684\u8fd4\u56de\u503c&#xff0c;\u5b8c\u7f8e\u6b3a\u9a97\u7b97\u6cd5\u903b\u8f91\u3002<\/li>\n<hr \/>\n<h4>\u4e94\u3001 \u7ed3\u8bed<\/h4>\n<p>\u5728\u73b0\u4ee3\u4e8c\u8fdb\u5236\u5bf9\u6297\u7684\u535a\u5f08\u68cb\u5c40\u4e2d&#xff0c;Unicorn \u5f15\u64ce\u7684\u51fa\u73b0\u5f7b\u5e95\u91cd\u6784\u4e86\u9006\u5411\u4e0e\u53cd\u9006\u5411\u7684\u6210\u672c\u5929\u5e73\u3002\u9762\u5bf9\u52a0\u56fa\u5382\u5546\u7cbe\u5fc3\u7f16\u6392\u7684\u6570\u4e07\u884c\u4ee3\u7801\u5e73\u5766\u5316\u4e0e\u865a\u5047\u63a7\u5236\u6d41&#xff0c;\u9006\u5411\u5de5\u7a0b\u5e08\u4e0d\u518d\u9700\u8981\u6df1\u9677\u4e8e\u903b\u8f91\u8ff7\u5bab&#xff0c;\u800c\u662f\u7ad9\u5728\u4f53\u7cfb\u7ed3\u6784\u7684\u9ad8\u7ef4\u89c6\u89d2&#xff0c;\u501f\u529b\u6253\u529b&#xff0c;\u4ee5\u673a\u5668\u6307\u4ee4\u6a21\u62df\u673a\u5668\u8fd0\u7b97\u3002\u6df1\u523b\u7406\u89e3 ARM64 \u6307\u4ee4\u96c6\u7684\u5185\u5b58\u6620\u5c04\u4e0e\u8c03\u7528\u89c4\u8303&#xff0c;\u65b9\u80fd\u5728\u8131\u673a\u73af\u5883\u4e2d\u6e38\u5203\u6709\u4f59\u5730\u9a7e\u9a6d\u4efb\u4f55\u590d\u6742\u7684\u539f\u751f\u4e8c\u8fdb\u5236\u903b\u8f91&#xff0c;\u4e3a\u4e1a\u52a1\u98ce\u63a7\u4e0e\u5b89\u5168\u5ba1\u8ba1\u63d0\u4f9b\u7edd\u5bf9\u964d\u7ef4\u7684\u5206\u6790\u5229\u5203\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u79fb\u52a8\u7aef\u5b89\u5168\u4e0e\u4e1a\u52a1\u98ce\u63a7\u5bf9\u6297\u4e2d&#xff0c;\u9006\u5411\u5de5\u7a0b\u5e08\u6700\u5e38\u9762\u5bf9\u7684\u4e00\u9053\u96be\u5173&#xff0c;\u83ab\u8fc7\u4e8e\u7535\u5546 App \u6838\u5fc3\u8d44\u4ea7\u6a21\u5757&#xff08;\u5982\u53cc 11 \u79d2\u6740\u8bf7\u6c42\u7b7e\u540d\u751f\u6210\u3001\u9ad8\u5371\u63a5\u53e3\u8bbe\u5907\u6307\u7eb9\u52a0\u5bc6&#xff09;\u7684\u9006\u5411\u8fd8\u539f\u3002\u5f00\u53d1\u56e2\u961f\u4e3a\u4e86\u5bf9\u6297\u9006\u5411&#xff0c;\u901a\u5e38\u4f1a\u5c06\u6838\u5fc3 C\/C \u7b97\u6cd5\u7f16\u8bd1\u8fdb Android Native SO \u5e93&#xff08;\u5982 libsec_sign.so&#xff09;&#xff0c;\u5e76\u5957\u4e0a\u9ad8\u5f3a\u5ea6\u7684\u5546\u4e1a\u52a0\u56fa\u5916\u58f3&#xff1a;\u53cc\u5c42\u63a7\u5236\u6d41\u5e73\u5766\u5316&#xff08;OL<\/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":[66,594,50,100,51],"topic":[],"class_list":["post-115655","post","type-post","status-publish","format-standard","hentry","category-server","tag-ai","tag-web","tag-50","tag-100","tag-51"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Android SO \u9006\u5411\u5b9e\u6218\uff1a\u57fa\u4e8e Unicorn \u5f15\u64ce\u7684 Native \u7b97\u6cd5\u6a21\u62df\u6267\u884c\u4e0e\u8131\u673a\u89e3\u5bc6 - \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\/115655.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Android SO \u9006\u5411\u5b9e\u6218\uff1a\u57fa\u4e8e Unicorn \u5f15\u64ce\u7684 Native \u7b97\u6cd5\u6a21\u62df\u6267\u884c\u4e0e\u8131\u673a\u89e3\u5bc6 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u5728\u79fb\u52a8\u7aef\u5b89\u5168\u4e0e\u4e1a\u52a1\u98ce\u63a7\u5bf9\u6297\u4e2d&#xff0c;\u9006\u5411\u5de5\u7a0b\u5e08\u6700\u5e38\u9762\u5bf9\u7684\u4e00\u9053\u96be\u5173&#xff0c;\u83ab\u8fc7\u4e8e\u7535\u5546 App \u6838\u5fc3\u8d44\u4ea7\u6a21\u5757&#xff08;\u5982\u53cc 11 \u79d2\u6740\u8bf7\u6c42\u7b7e\u540d\u751f\u6210\u3001\u9ad8\u5371\u63a5\u53e3\u8bbe\u5907\u6307\u7eb9\u52a0\u5bc6&#xff09;\u7684\u9006\u5411\u8fd8\u539f\u3002\u5f00\u53d1\u56e2\u961f\u4e3a\u4e86\u5bf9\u6297\u9006\u5411&#xff0c;\u901a\u5e38\u4f1a\u5c06\u6838\u5fc3 C\/C \u7b97\u6cd5\u7f16\u8bd1\u8fdb Android Native SO \u5e93&#xff08;\u5982 libsec_sign.so&#xff09;&#xff0c;\u5e76\u5957\u4e0a\u9ad8\u5f3a\u5ea6\u7684\u5546\u4e1a\u52a0\u56fa\u5916\u58f3&#xff1a;\u53cc\u5c42\u63a7\u5236\u6d41\u5e73\u5766\u5316&#xff08;OL\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/115655.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-12T13:56:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261012135658-6acce72a7d7cc.webp\" \/>\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=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/115655.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/115655.html\",\"name\":\"Android SO \u9006\u5411\u5b9e\u6218\uff1a\u57fa\u4e8e Unicorn \u5f15\u64ce\u7684 Native \u7b97\u6cd5\u6a21\u62df\u6267\u884c\u4e0e\u8131\u673a\u89e3\u5bc6 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-12T13:56:59+00:00\",\"dateModified\":\"2026-10-12T13:56:59+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/115655.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/115655.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/115655.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Android SO \u9006\u5411\u5b9e\u6218\uff1a\u57fa\u4e8e Unicorn \u5f15\u64ce\u7684 Native \u7b97\u6cd5\u6a21\u62df\u6267\u884c\u4e0e\u8131\u673a\u89e3\u5bc6\"}]},{\"@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":"Android SO \u9006\u5411\u5b9e\u6218\uff1a\u57fa\u4e8e Unicorn \u5f15\u64ce\u7684 Native \u7b97\u6cd5\u6a21\u62df\u6267\u884c\u4e0e\u8131\u673a\u89e3\u5bc6 - \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\/115655.html","og_locale":"zh_CN","og_type":"article","og_title":"Android SO \u9006\u5411\u5b9e\u6218\uff1a\u57fa\u4e8e Unicorn \u5f15\u64ce\u7684 Native \u7b97\u6cd5\u6a21\u62df\u6267\u884c\u4e0e\u8131\u673a\u89e3\u5bc6 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u5728\u79fb\u52a8\u7aef\u5b89\u5168\u4e0e\u4e1a\u52a1\u98ce\u63a7\u5bf9\u6297\u4e2d&#xff0c;\u9006\u5411\u5de5\u7a0b\u5e08\u6700\u5e38\u9762\u5bf9\u7684\u4e00\u9053\u96be\u5173&#xff0c;\u83ab\u8fc7\u4e8e\u7535\u5546 App \u6838\u5fc3\u8d44\u4ea7\u6a21\u5757&#xff08;\u5982\u53cc 11 \u79d2\u6740\u8bf7\u6c42\u7b7e\u540d\u751f\u6210\u3001\u9ad8\u5371\u63a5\u53e3\u8bbe\u5907\u6307\u7eb9\u52a0\u5bc6&#xff09;\u7684\u9006\u5411\u8fd8\u539f\u3002\u5f00\u53d1\u56e2\u961f\u4e3a\u4e86\u5bf9\u6297\u9006\u5411&#xff0c;\u901a\u5e38\u4f1a\u5c06\u6838\u5fc3 C\/C \u7b97\u6cd5\u7f16\u8bd1\u8fdb Android Native SO \u5e93&#xff08;\u5982 libsec_sign.so&#xff09;&#xff0c;\u5e76\u5957\u4e0a\u9ad8\u5f3a\u5ea6\u7684\u5546\u4e1a\u52a0\u56fa\u5916\u58f3&#xff1a;\u53cc\u5c42\u63a7\u5236\u6d41\u5e73\u5766\u5316&#xff08;OL","og_url":"https:\/\/www.wsisp.com\/helps\/115655.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-12T13:56:59+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261012135658-6acce72a7d7cc.webp"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/115655.html","url":"https:\/\/www.wsisp.com\/helps\/115655.html","name":"Android SO \u9006\u5411\u5b9e\u6218\uff1a\u57fa\u4e8e Unicorn \u5f15\u64ce\u7684 Native \u7b97\u6cd5\u6a21\u62df\u6267\u884c\u4e0e\u8131\u673a\u89e3\u5bc6 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-12T13:56:59+00:00","dateModified":"2026-10-12T13:56:59+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/115655.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/115655.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/115655.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Android SO \u9006\u5411\u5b9e\u6218\uff1a\u57fa\u4e8e Unicorn \u5f15\u64ce\u7684 Native \u7b97\u6cd5\u6a21\u62df\u6267\u884c\u4e0e\u8131\u673a\u89e3\u5bc6"}]},{"@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\/115655","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=115655"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/115655\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=115655"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=115655"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=115655"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=115655"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}