{"id":16,"date":"2026-04-14T15:12:00","date_gmt":"2026-04-14T07:12:00","guid":{"rendered":"https:\/\/www.seekinthevortex.cn\/?p=16"},"modified":"2026-04-14T15:12:00","modified_gmt":"2026-04-14T07:12:00","slug":"2025-blackhat-ctf","status":"publish","type":"post","link":"https:\/\/www.seekinthevortex.cn\/index.php\/2026\/04\/14\/2025-blackhat-ctf\/","title":{"rendered":"2025 BlackHat CTF"},"content":{"rendered":"<h1>V1m<\/h1>\n<h2>\u7a0b\u5e8f\u5206\u6790<\/h2>\n<pre><code class=\"language-cpp\">__pid_t sub_5555555552B1()\n{\n    _QWORD *v0; \/\/ rax\n    __int64 v1; \/\/ rax\n    __int64 v2; \/\/ rax\n    __pid_t result; \/\/ eax\n    char s_1[13]; \/\/ [rsp+3h] [rbp-18Dh] BYREF\n    char s[8]; \/\/ [rsp+10h] [rbp-180h] BYREF\n    unsigned __int64 v6; \/\/ [rsp+18h] [rbp-178h]\n    unsigned __int64 v7; \/\/ [rsp+20h] [rbp-170h]\n    _QWORD input[6]; \/\/ [rsp+30h] [rbp-160h] BYREF\n    char v9; \/\/ [rsp+60h] [rbp-130h]\n    _BYTE reg[48]; \/\/ [rsp+70h] [rbp-120h] BYREF\n    __int64 v11; \/\/ [rsp+A0h] [rbp-F0h]\n    __int64 v12; \/\/ [rsp+A8h] [rbp-E8h]\n    __int64 v13; \/\/ [rsp+F0h] [rbp-A0h]\n    int stat_loc; \/\/ [rsp+154h] [rbp-3Ch] BYREF\n    void (__fastcall *v15)(_QWORD); \/\/ [rsp+158h] [rbp-38h]\n    void (__fastcall *v16)(_QWORD); \/\/ [rsp+160h] [rbp-30h]\n    unsigned __int64 v17; \/\/ [rsp+168h] [rbp-28h]\n    __pid_t pid; \/\/ [rsp+174h] [rbp-1Ch]\n    __int64 v19; \/\/ [rsp+178h] [rbp-18h]\n    _QWORD *v20; \/\/ [rsp+180h] [rbp-10h]\n    int j; \/\/ [rsp+188h] [rbp-8h]\n    int i; \/\/ [rsp+18Ch] [rbp-4h]\n\n    memset(input, 0, sizeof(input));\n    v9 = 0;\n    v20 = input;\n    \/\/ enter the secret key\n    *s = 0xF1EDB9EBFCEDF7DCLL;\n    v6 = 0xEDFCEBFAFCEAB9FCLL;\n    v7 = 0x99B9A3B9E0FCF2B9LL;\n    for ( i = 0; i &lt;= 23; ++i )\n        s[i] ^= 0x99u;\n    puts(s);\n    __isoc23_scanf(&quot;%49s&quot;, input);\n\n    \/\/ \u8fd9\u91cc\u5e94\u8be5\u662f\u53cd\u8c03\u8bd5\n    v19 = seccomp_init(0x7FFF0000LL);\n    \/\/ \u5982\u679c\u6709syscall 300,\u5219\u89e6\u53d1\u5f02\u5e38,\u4f20\u56deSIGSYS\u4fe1\u53f7\n    seccomp_rule_add(v19, 0x30000LL, 0x12CLL, 0LL);\n    seccomp_load(v19);\n    pid = fork();\n    if ( !pid )\n    {\n        \/\/ \u5b50\u8fdb\u7a0b\n        \/\/ \u5206\u914d\u4e86\u4e00\u6bb5\u5185\u5b58,\u7528\u4e8e\u5b58\u653eshellcode\n        v0 = mmap(0LL, 0xD50uLL, 7, 34, -1, 0LL);\n        v16 = v0;\n        *v0 = shellcode[0];\n        v0[425] = shellcode[425];\n        qmemcpy(\n            ((v0 + 1) &amp; 0xFFFFFFFFFFFFFFF8LL),\n            (shellcode - (v0 - ((v0 + 1) &amp; 0xFFFFFFFFFFFFFFF8LL))),\n            8LL * (((v0 - ((v0 + 8) &amp; 0xFFFFFFF8) + 3408) &amp; 0xFFFFFFF8) &gt;&gt; 3));\n        \/\/ \u8bbe\u7f6e\u53ef\u4ee5trace\u81ea\u8eab\n        ptrace(PTRACE_TRACEME, 0LL, 0LL, 0LL);\n        v15 = v16;\n        \/\/ \u8c03\u7528\u7a0b\u5e8f,\u4f20\u5165input\u53c2\u6570\n        v16(input);\n        exit(0);\n    }\n    \/\/ \u7236\u8fdb\u7a0b,\u6301\u7eed\u76d1\u6d4b\u5b50\u8fdb\u7a0b\u72b6\u6001\n    while ( 1 )\n    {\n        result = waitpid(pid, &amp;stat_loc, 0);    \/\/ \u7b49\u5f85\u5b50\u8fdb\u7a0b\u4f20\u56de\u4fe1\u53f7\n        if ( result == -1 )\n            break;\n        switch ( stat_loc &gt;&gt; 8 )\n        {\n            case 4:                             \/\/ 4\uff1a\u5927\u6982\u7387\u662f SIGILL\uff08\u975e\u6cd5\u6307\u4ee4\uff09\n                ptrace(PTRACE_GETREGS, pid, 0LL, reg);\n                v1 = ptrace(PTRACE_PEEKTEXT, pid, v13, 0LL);\n                LOWORD(v1) = 0;\n                v17 = v1 | 0x9090;\n                ptrace(PTRACE_POKETEXT, pid, v13, v1 | 0x9090);\n                ptrace(PTRACE_GETREGS, pid, 0LL, reg);\n                \/\/ a * b\n                v11 = multiple(v11, v12);\n                ptrace(PTRACE_SETREGS, pid, 0LL, reg);\n                break;\n            case 8:                             \/\/ 8\uff1aSIGFPE\uff08\u7b97\u672f\u5f02\u5e38\uff09\n                \/\/ \u83b7\u53d6\u5bc4\u5b58\u5668\u503c\n                ptrace(PTRACE_GETREGS, pid, 0LL, reg);\n                \/\/ a ^ b\n                v11 = xor(v11, v12);\n                \/\/ \u4f20\u56de\u5bc4\u5b58\u5668\u503c\n                ptrace(PTRACE_SETREGS, pid, 0LL, reg);\n                v17 = ptrace(PTRACE_PEEKTEXT, pid, v13, 0LL) &amp; 0xFFFFFFFFFF000000LL | 0x909090;\n                ptrace(PTRACE_POKETEXT, pid, v13, v17);\n                break;\n            case 31:                            \/\/ 31\uff1aSIGSYS\uff08\u975e\u6cd5\u7cfb\u7edf\u8c03\u7528\uff09\u4e4b\u7c7b\n                ptrace(PTRACE_GETREGS, pid, 0LL, reg);\n                v2 = ptrace(PTRACE_PEEKTEXT, pid, v13, 0LL);\n                LOWORD(v2) = 0;\n                v17 = v2 | 0x9090;\n                check_if_right(reg[16]);\n            default:\n                if ( (stat_loc &amp; 0x7F) == 0 || stat_loc &gt;&gt; 8 == 17 )\n                {\n                    *s_1 = 0xCEB9EABEEDF8F1CDLL;\n                    *&amp;s_1[5] = 0x99FDEBF0FCCEB9EALL;\n                    for ( j = 0; j &lt;= 12; ++j )\n                        s_1[j] ^= 0x99u;\n                    puts(s_1);\n                }\n                break;\n        }\n        ptrace(PTRACE_CONT, pid, 0LL, 0LL);\n    }\n    return result;\n}\n<\/code><\/pre>\n<p>\u8ffd\u8e2a\u5b57\u7b26\u4e32\u6211\u4eec\u53ef\u4ee5\u627e\u5230\u8fd9\u4e2a\u51fd\u6570,\u521d\u6b65\u5206\u6790\u8fd9\u5c31\u662f\u4e00\u4e2a\u7236\u5b50\u8fdb\u7a0b\u8c03\u8bd5\u6267\u884cshellcode\u7684\u903b\u8f91,\u7236\u8fdb\u7a0b\u6355\u83b7\u4e86\u5f88\u591a\u4fe1\u53f7\u5e76\u8fdb\u884c\u5904\u7406,\u5b50\u8fdb\u7a0b\u4e2d\u5206\u914d\u4e86\u4e00\u6bb5\u6570\u636e,\u731c\u6d4b\u662f\u6267\u884c\u7684\u7a0b\u5e8f,\u6211\u4eec\u53ef\u4ee5\u5148\u5c06\u91cc\u9762\u7684\u6570\u636edump\u51fa\u6765\u8fdb\u884c\u5206\u6790.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cloud-map-bed-1351541725.cos.ap-nanjing.myqcloud.com\/pic\/20251203184938.png\" alt=\"image.png|800\"><\/p>\n<p>\u5206\u6790\u4e00\u4e0b\u8fd9\u91cc\u7684\u6c47\u7f16\u4ee3\u7801,\u53ef\u4ee5\u53d1\u73b0\u51e0\u4e2a\u90e8\u5206\u6bd4\u8f83\u6709\u610f\u601d.<\/p>\n<pre><code class=\"language-cpp\">idiv rcx\n...\n...\nud2\n<\/code><\/pre>\n<p>\u6211\u4eec\u5148\u4e0d\u6025\u7740\u4e0b\u7ed3\u8bba,\u5148\u52a8\u8c03\u4e00\u4e0b\u7236\u8fdb\u7a0b\u6765\u770b\u4e00\u4e0b<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cloud-map-bed-1351541725.cos.ap-nanjing.myqcloud.com\/pic\/20251203185430.png\" alt=\"image.png|600\"><\/p>\n<p>\u5355\u6b65\u8ddf\u8e2a\u4f1a\u5148\u8fdb\u5165case8\u4e2d,\u8fd9\u91cc\u6709\u4e00\u4e2aptrace\u51fd\u6570,\u901a\u8fc7\u67e5\u8be2\u53ef\u4ee5\u77e5\u9053\u8fd9\u4e2a\u51fd\u6570\u4f1a\u8fd4\u56de\u5b50\u8fdb\u7a0b\u5f53\u524d\u7684\u5bc4\u5b58\u5668\u503c<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cloud-map-bed-1351541725.cos.ap-nanjing.myqcloud.com\/pic\/20251203185639.png\" alt=\"image.png|600\"><\/p>\n<p>\u8ddf\u8e2a\u4e00\u4e0breg\u8fd4\u56de\u7684\u503c.\u6211\u4eec\u53c8\u53ef\u4ee5\u77e5\u9053\u8fd9\u4e2a\u51fd\u6570\u8fd4\u56de\u7684\u5bc4\u5b58\u5668\u80af\u5b9a\u662f\u6309\u7167\u4e00\u4e2a\u7279\u5b9a\u7684\u987a\u5e8f\u6392\u5217\u7684.\u6309\u7167\u8fd9\u4e2a\u987a\u5e8f(\u5176\u5b9e\u5c31\u662f\u7ed3\u6784\u4f53),\u6211\u4eec\u5c31\u53ef\u4ee5\u6062\u590d\u51fa\u6bcf\u4e00\u4e2a\u503c\u5bf9\u5e94\u7684\u5bc4\u5b58\u5668\u540d\u79f0,\u7136\u540e\u6211\u4eec\u518d\u5bf9\u5e94\u4e4b\u524d\u5f97\u5230\u7684shellcode\u5c31\u53ef\u4ee5\u660e\u767d\u4e4b\u524d\u7684shellcode\u5728\u505a\u4ec0\u4e48\u4e86.<\/p>\n<pre><code class=\"language-cpp\">struct user_regs_struct {\n    unsigned long r15;\n    unsigned long r14;\n    unsigned long r13;\n    unsigned long r12;\n    unsigned long rbp;\n    unsigned long rbx;\n    unsigned long r11;\n    unsigned long r10;\n    unsigned long r9;\n    unsigned long r8;\n    unsigned long rax;\n    unsigned long rcx;\n    unsigned long rdx;\n    unsigned long rsi;\n    unsigned long rdi;\n    unsigned long orig_rax;\n    unsigned long rip;\n    unsigned long cs;\n    unsigned long eflags;\n    unsigned long rsp;\n    unsigned long ss;\n    unsigned long fs_base;\n    unsigned long gs_base;\n    unsigned long ds;\n    unsigned long es;\n    unsigned long fs;\n    unsigned long gs;\n};\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cloud-map-bed-1351541725.cos.ap-nanjing.myqcloud.com\/pic\/20251203190155.png\" alt=\"image.png|600\"><\/p>\n<p>\u6211\u8fd9\u91cc\u53ea\u91cd\u70b9\u6807\u6ce8\u51e0\u4e2a\u6bd4\u8f83\u91cd\u8981\u7684\u5bc4\u5b58\u5668,\u56e0\u4e3a\u8fd9\u51e0\u4e2a\u5bc4\u5b58\u5668\u5728shellcode\u4e2d\u8fd0\u7b97\u6bd4\u8f83\u91cd\u8981.\u63a5\u4e0b\u6765\u518d\u56de\u6765\u5206\u6790shellcode<\/p>\n<pre><code class=\"language-cpp\">seg000:0000000000000000\nseg000:0000000000000000                         sub_0           proc near\nseg000:0000000000000000 49 89 F9                                mov     r9, rdi\nseg000:0000000000000003 4D 31 E4                                xor     r12, r12\nseg000:0000000000000006 4D 31 ED                                xor     r13, r13\nseg000:0000000000000009 49 BC 1A 73 04 FE 00 00                 mov     r12, 0FE04731Ah\nseg000:0000000000000009 00 00\nseg000:0000000000000013 4D 31 DB                                xor     r11, r11\nseg000:0000000000000016 45 8A 19                                mov     r11b, [r9]\nseg000:0000000000000019 49 C7 C2 39 05 00 00                    mov     r10, 539h\nseg000:0000000000000020 48 31 C0                                xor     rax, rax\nseg000:0000000000000023 48 31 FF                                xor     rdi, rdi\nseg000:0000000000000026 48 F7 F9                                idiv    rcx\nseg000:0000000000000029 49 BA C5 9D 1C 81 00 00                 mov     r10, 811C9DC5h\nseg000:0000000000000029 00 00\nseg000:0000000000000033 48 31 C0                                xor     rax, rax\nseg000:0000000000000036 48 31 FF                                xor     rdi, rdi\nseg000:0000000000000039 48 F7 F9                                idiv    rcx\nseg000:000000000000003C 49 C7 C2 93 01 00 01                    mov     r10, 1000193h\nseg000:0000000000000043                         \u6545\u610f\u89e6\u53d1SIGILL\nseg000:0000000000000043 0F 0B                                   ud2\nseg000:0000000000000043                         sub_0           endp\nseg000:0000000000000043\nseg000:0000000000000045\nseg000:0000000000000045                         ; =============== S U B R O U T I N E =======================================\nseg000:0000000000000045\nseg000:0000000000000045                         ; Attributes: noreturn\nseg000:0000000000000045\nseg000:0000000000000045                         BUG_w           proc near\nseg000:0000000000000045 49 FF C1                                inc     r9                 ; \u6307\u9488\u52a01,\u53d6\u5230\u4e0b\u4e00\u4e2achar\nseg000:0000000000000048 4D 31 E3                                xor     r11, r12           ; \u5c06r12\u5e38\u91cf\u548c\u503c\u5f02\u6216\nseg000:000000000000004B 4D 09 DD                                or      r13, r11           ; \u5c06r12\u6dfb\u52a0\u5230\u6700\u540e\nseg000:000000000000004E 49 BC 5C 63 04 F4 00 00                 mov     r12, 0F404635Ch\nseg000:000000000000004E 00 00\nseg000:0000000000000058 4D 31 DB                                xor     r11, r11\nseg000:000000000000005B 45 8A 19                                mov     r11b, [r9]\nseg000:000000000000005E 49 C7 C2 39 05 00 00                    mov     r10, 539h\nseg000:0000000000000065 48 31 C0                                xor     rax, rax\nseg000:0000000000000068 48 31 FF                                xor     rdi, rdi\nseg000:000000000000006B 48 F7 F9                                idiv    rcx\nseg000:000000000000006E 49 BA C5 9D 1C 81 00 00                 mov     r10, 811C9DC5h\nseg000:000000000000006E 00 00\nseg000:0000000000000078 48 31 C0                                xor     rax, rax\nseg000:000000000000007B 48 31 FF                                xor     rdi, rdi\nseg000:000000000000007E 48 F7 F9                                idiv    rcx\nseg000:0000000000000081 49 C7 C2 93 01 00 01                    mov     r10, 1000193h\nseg000:0000000000000088 0F 0B                                   ud2\n<\/code><\/pre>\n<p>idiv\u548cud2\u5206\u522b\u89e6\u53d1SIGFPE\u548cSIGILL\u4fe1\u53f7,\u5c06\u63a7\u5236\u6743\u9012\u4ea4\u7d66\u7236\u8fdb\u7a0b,\u7236\u8fdb\u7a0b\u5206\u522b\u5904\u7406\u8fd9\u4e24\u4e2a\u4fe1\u53f7,\u4fee\u6539r11d(input[i])\u5bc4\u5b58\u5668\u7684\u503c.<br \/>\n\u5177\u4f53\u7684\u64cd\u4f5c\u662f\u5c06r11\u548cr10\u901a\u8fc7\u81ea\u5b9a\u4e49\u7684\u7b97\u6cd5\u8ba1\u7b97,\u6700\u540e\u5c06\u7ed3\u679c\u548c\u5e38\u91cfr12 xor\u540e\u548cr13\u7684\u503cor\u8fd0\u7b97.<\/p>\n<p>\u90a3\u4e48\u7a0b\u5e8f\u5728\u54ea\u91cc\u5224\u65ad\u8f93\u5165\u662f\u5426\u6b63\u786e\u5462?\u6211\u4eec\u56de\u5230\u4e3b\u51fd\u6570<\/p>\n<pre><code class=\"language-cpp\">\/\/ \u5982\u679c\u6709syscall 300,\u5219\u89e6\u53d1\u5f02\u5e38,\u4f20\u56deSIGSYS\u4fe1\u53f7\nseccomp_rule_add(v19, 0x30000LL, 0x12CLL, 0LL);\nseccomp_load(v19);\n<\/code><\/pre>\n<p>\u5728\u7a0b\u5e8f\u7684\u5f00\u5934\u81ea\u5df1\u5b9a\u4e49\u4e86\u4e00\u4e2a\u89c4\u5219,\u5728syscall 300\u7684\u65f6\u5019,\u4f1a\u89e6\u53d1\u4e00\u4e2aSIGSYS\u4fe1\u53f7.<\/p>\n<pre><code class=\"language-cpp\">case 31:                            \/\/ 31\uff1aSIGSYS\uff08\u975e\u6cd5\u7cfb\u7edf\u8c03\u7528\uff09\u4e4b\u7c7b\n\tptrace(PTRACE_GETREGS, pid, 0LL, reg);\n\tv2 = ptrace(PTRACE_PEEKTEXT, pid, v13, 0LL);\n\tLOWORD(v2) = 0;\n\tv17 = v2 | 0x9090;\n\tcheck_if_right(reg[16]);\n<\/code><\/pre>\n<pre><code class=\"language-cpp\">void __fastcall __noreturn check_if_right(int reg)\n{\n    char s_1[14]; \/\/ [rsp+1Bh] [rbp-25h] BYREF\n    char s[15]; \/\/ [rsp+29h] [rbp-17h] BYREF\n    int i; \/\/ [rsp+38h] [rbp-8h]\n    int j; \/\/ [rsp+3Ch] [rbp-4h]\n\n    if ( reg )\n    {\n        \/\/ worng key\n        *s_1 = 0xFCD2B9FEF7F6EBCELL;\n        *&amp;s_1[6] = 0x99B9B1A3B9E0FCD2LL;\n        for ( i = 0; i &lt;= 13; ++i )\n            s_1[i] ^= 0x99u;\n        puts(s_1);\n    }\n    else\n    {\n        \/\/ right key\n        *s = 0xB9EDFAFCEBEBF6DALL;\n        *&amp;s[7] = 0x99DDA3B9E0FCD2B9LL;\n        for ( j = 0; j &lt;= 14; ++j )\n            s[j] ^= 0x99u;\n        puts(s);\n    }\n    exit(0);\n}\n<\/code><\/pre>\n<p>\u5f88\u660e\u663e\u4e86,\u8fd9\u91cc\u5c31\u662f\u6700\u540e\u7684\u5224\u65ad,\u53ea\u4e0d\u8fc7\u52a0\u5bc6\u4e86log\u8f93\u51fa\u7684\u4fe1\u606f.\u901a\u8fc7\u52a8\u8c03\u53d1\u73b0\u8fd9\u91cc\u4f20\u5165\u7684r13\u7684\u4f4e\u4e24\u4e2a\u5b57\u8282.<\/p>\n<p>\u7efc\u4e0a,\u4e5f\u5c31\u662f\u8bf4\u53ea\u6709\u6bcf\u4e00\u8f6eshellcode\u8fd0\u884c\u6700\u540e\u5f97\u5230\u7684\u7ed3\u679cxor\u7acb\u5373\u6570\u90fd\u662f0,\u624d\u80fd\u901a\u8fc7\u5224\u65ad,\u6240\u4ee5\u6211\u4eec\u5c31\u53ef\u4ee5\u7f16\u5199\u89e3\u5bc6\u811a\u672c\u4e86.<\/p>\n<h2>\u89e3\u5bc6\u811a\u672c<\/h2>\n<p>\u5982\u679c\u8981\u8ba1\u7b97\u7684\u8bdd\u6211\u4eec\u9700\u8981\u8ba1\u7b97\u4e58\u6cd5\u7684\u9006\u5143,\u6211\u4eec\u76f4\u63a5\u91c7\u7528\u7206\u7834\u7684\u65b9\u6cd5<\/p>\n<pre><code class=\"language-python\">targets = [\n    0xfe04731a, 0xf404635c, 0xfa046cce, 0xd0042ab0, \n    0xdd043f27, 0xdb043c01, 0xe5044bbf, 0xc7041c85, \n    0xeb045531, 0xd90438db, 0xd0042ab0, 0xdf04424d, \n    0xd3042f69, 0xd1042c43, 0xd90438db, 0xe3044899, \n    0xc8041e18, 0xd3042f69, 0xe3044899, 0xc8041e18, \n    0xd40430fc, 0xd90438db, 0xe3044899, 0xd0042ab0, \n    0xdd043f27, 0xd2042dd6, 0xd8043748, 0xe3044899, \n    0xd3042f69, 0xda043a6e, 0xe3044899, 0xee0459ea, \n    0xd90438db, 0xca04213e, 0xd90438db, 0xce04278a, \n    0xcf04291d, 0xd90438db, 0xe3044899, 0xf9046b3b, \n    0xd2042dd6, 0xdb043c01, 0xd504328f, 0xd2042dd6, \n    0xd90438db, 0xd90438db, 0xce04278a, 0xcf04291d, \n    0xc1041313\n]\n\ndef Fbyte(x: int) -&gt; int:\n    &quot;&quot;&quot;\n    \u5bf9\u5e94 shellcode + ptrace \u5f02\u5e38\u90a3\u5957\uff1a\n    - 32 \u4f4d h = x\n    - h ^= 0x539\n    - h ^= 0x811C9DC5\n    - h *= 0x1000193\n    \u8fd4\u56de\u6700\u4f4e 1 \u5b57\u8282\n    &quot;&quot;&quot;\n    h = x &amp; 0xFFFFFFFF\n    h ^= 0x539\n    h ^= 0x811C9DC5\n    h = (h * 0x1000193) &amp; 0xFFFFFFFF  # 32-bit wrap\n    return h &amp; 0xFF\n\n# \u9884\u8ba1\u7b97 Fbyte \u7684\u9006\u6620\u5c04\uff1avalue -&gt; \u53ef\u80fd\u7684\u539f\u59cb\u5b57\u8282\uff08\u4e00\u822c\u53ea\u6709\u4e00\u4e2a\u89e3\uff09\ninv_map = {}\nfor b in range(256):\n    y = Fbyte(b)\n    inv_map.setdefault(y, []).append(b)\n\n# \u9010\u4f4d\u8fd8\u539f\u8f93\u5165\nres_bytes = []\nfor i, t in enumerate(targets):\n    low = t &amp; 0xFF               # \u53ea\u770b r12 \u7684\u6700\u4f4e\u5b57\u8282\n    candidates = inv_map.get(low, [])\n    if not candidates:\n        raise ValueError(f&quot;Position {i}: no byte maps to {low:#x}&quot;)\n    if len(candidates) &gt; 1:\n        print(f&quot;[!] Position {i} \u591a\u89e3: {candidates}&quot;)\n    res_bytes.append(candidates[0])\n\nflag_bytes = bytes(res_bytes)\ntry:\n    flag_str = flag_bytes.decode('utf-8')\nexcept UnicodeDecodeError:\n    flag_str = flag_bytes.decode('latin1')\n\nprint(&quot;bytes :&quot;, flag_bytes)\nprint(&quot;string:&quot;, flag_str)\n\n# string: BHFlagY{Welcome_to_the_land_of_Reverse_Engineers}\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>V1m \u7a0b\u5e8f\u5206\u6790 __pid_t sub_5555555552B1() { _QWORD *v0; \/\/ ra [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-16","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.seekinthevortex.cn\/index.php\/wp-json\/wp\/v2\/posts\/16","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.seekinthevortex.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.seekinthevortex.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.seekinthevortex.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.seekinthevortex.cn\/index.php\/wp-json\/wp\/v2\/comments?post=16"}],"version-history":[{"count":1,"href":"https:\/\/www.seekinthevortex.cn\/index.php\/wp-json\/wp\/v2\/posts\/16\/revisions"}],"predecessor-version":[{"id":17,"href":"https:\/\/www.seekinthevortex.cn\/index.php\/wp-json\/wp\/v2\/posts\/16\/revisions\/17"}],"wp:attachment":[{"href":"https:\/\/www.seekinthevortex.cn\/index.php\/wp-json\/wp\/v2\/media?parent=16"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.seekinthevortex.cn\/index.php\/wp-json\/wp\/v2\/categories?post=16"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.seekinthevortex.cn\/index.php\/wp-json\/wp\/v2\/tags?post=16"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}