{"id":1095,"date":"2022-11-18T00:05:23","date_gmt":"2022-11-17T16:05:23","guid":{"rendered":"https:\/\/blog.langsasec.cn\/?p=1095"},"modified":"2022-11-18T00:08:19","modified_gmt":"2022-11-17T16:08:19","slug":"reserve_edusrc","status":"publish","type":"post","link":"https:\/\/blog.langsasec.cn\/index.php\/2022\/11\/18\/reserve_edusrc\/","title":{"rendered":"\u4ece\u624b\u6b20\u5220\u9664\u6e90\u4ee3\u7801\u5230\u53cd\u7f16\u8bd1exe\u627e\u56de"},"content":{"rendered":"<h2><span class=\"ez-toc-section\" id=\"%e5%89%8d%e8%a8%80\"><\/span>\u524d\u8a00<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u4e4b\u524d\u53d1\u7684EDU\u67e5\u8be2\u8f85\u52a9\u5de5\u5177\uff0c\u53ea\u7528Pyinstaller\u6253\u5305\u4e86exe\uff0c\u6709MAC\u7684\u5c0f\u4f19\u4f34\u60f3\u8981\u8fd0\u884c\uff0c\u4f46\u662f\u6211\u89c9\u5f97\u5c4e\u5c71\u4ee3\u7801\u6ca1\u5fc5\u8981\u5f00\u6e90\uff0c\u5728\u67d0\u4e00\u5929\u6211\u5c06\u9879\u76ee\u6e90\u7801\u6c38\u4e45\u5220\u9664\uff0c\u6062\u590d\u4e4b\u540e\u4e71\u7801\uff0c\u6240\u4ee5\u6ca1\u529e\u6cd5\u6ee1\u8db3\u5c0f\u4f19\u4f34\u7684\u9700\u6c42\u3002\u540e\u9762\u60f3\u7740\u627e\u4e2a\u673a\u4f1a\u80fd\u4e0d\u80fd\u53cd\u7f16\u8bd1\u4e00\u4e0b\uff0c\u53cd\u6b63\u4ee3\u7801\u8d85\u7b80\u5355\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"%e9%a1%b9%e7%9b%ae%e4%bb%8b%e7%bb%8d\"><\/span>\u9879\u76ee\u4ecb\u7ecd<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"%e9%a1%b9%e7%9b%ae%e5%9c%b0%e5%9d%80\"><\/span>\u9879\u76ee\u5730\u5740<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<blockquote>\n<p><a href=\"https:\/\/github.com\/langsasec\/edusrc\">https:\/\/github.com\/langsasec\/edusrc<\/a><\/p>\n<\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/i0.hdslb.com\/bfs\/album\/7835aebacb585f4993254174a51bd8fa7afbc138.png\" alt=\"image-20221117234238848\" title=\"\u4ece\u624b\u6b20\u5220\u9664\u6e90\u4ee3\u7801\u5230\u53cd\u7f16\u8bd1exe\u627e\u56de\u63d2\u56fe\" \/><\/p>\n<p>\u8fd9\u662f\u4e4b\u524d\u95f2\u7684\u6ca1\u4e8b\u7528Flask\u5f00\u53d1\u7684\u4e00\u4e2a\u8d85\u8f7b\u91cf\u7684\u7f51\u7ad9\uff0c\u4e3b\u8981\u65b9\u4fbf\u7528\u4e8eEDU_SRC\u67e5\u8be2\u5177\u4f53\u5b66\u6821\u548c\u4fe1\u606f\u641c\u96c6\u7528\uff0c\u6700\u5f00\u59cb\u662f\u5305\u542bSqlite\u6570\u636e\u5e93\u6587\u4ef6\u7684\uff0c\u540e\u6765\u89c9\u5f97\u5c31\u4e24\u5f20\u8868\uff0c\u7d22\u6027\u628a\u6570\u636e\u67e5\u51fa\u6765\u653e\u5230Python\u5217\u8868\u91cc\u66f4\u65b9\u4fbf\u3002\u6700\u540e\u53ea\u6709\u4e00\u4e2a\u540e\u7aef\u6587\u4ef6main.py\u548c\u9759\u6001\u8d44\u6e90\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"%e5%87%86%e5%a4%87%e5%b7%a5%e4%bd%9c\"><\/span>\u51c6\u5907\u5de5\u4f5c<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"%e6%89%80%e7%94%a8%e8%bd%af%e4%bb%b6\"><\/span>\u6240\u7528\u8f6f\u4ef6<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u73af\u5883\uff1aPython3<\/p>\n<ol>\n<li>edusrc.exe(\u5df2\u7528Pyinstaller\u6253\u5305\u597dFlask\u7684exe)<\/li>\n<li>X-ways(16\u8fdb\u5236\u7f16\u8f91\u5668\u5373\u53ef\uff0c\u6211\u7528\u7684X-ways\uff0cwindows\u7528WinHex\uff0cMac\u7528010 editor)<\/li>\n<li>reverse_pyexe(pyinstaller\u6253\u5305\u7684exe\u9006\u5411\u8fd8\u539f\u9879\u76ee)<\/li>\n<li>Pyc\u53cd\u7f16\u8bd1\u5de5\u5177(\u5728\u7ebf\u6216uncompyle6\u7b49\u5176\u4ed6\u65b9\u6cd5)<\/li>\n<\/ol>\n<h2><span class=\"ez-toc-section\" id=\"edusrcexe%e2%86%92mainpyc\"><\/span>edusrc.exe\u2192main.pyc<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"%e6%89%a7%e8%a1%8c%e5%91%bd%e4%bb%a4\"><\/span>\u6267\u884c\u547d\u4ee4<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u5c06\u9700\u8981\u53cd\u7f16\u8bd1\u7684<code>exe<\/code>\u548c<code>pyinstxtractor.py<\/code>\u653e\u5230\u540c\u4e00\u4e2a\u76ee\u5f55\u4e0b\u76f4\u63a5\u8fd0\u884c<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/i0.hdslb.com\/bfs\/album\/83ff9660aeea4847f42083fa16ee89de18bddf29.png\" alt=\"image-20221117220830287\" title=\"\u4ece\u624b\u6b20\u5220\u9664\u6e90\u4ee3\u7801\u5230\u53cd\u7f16\u8bd1exe\u627e\u56de\u63d2\u56fe1\" \/><\/p>\n<pre class=\"prettyprint linenums\" ><code class=\"language-sh\">python pyinstxtractor.py edusrc.exe<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/i0.hdslb.com\/bfs\/album\/6dff15a25c0fa4c5dc75c08014cced4d534bf798.png\" alt=\"image-20221117222110116\" title=\"\u4ece\u624b\u6b20\u5220\u9664\u6e90\u4ee3\u7801\u5230\u53cd\u7f16\u8bd1exe\u627e\u56de\u63d2\u56fe2\" \/><\/p>\n<p>\u751f\u6210edusrc.exe_extracted\u6587\u4ef6\u5939<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/i0.hdslb.com\/bfs\/album\/8e67cd3ad30ac215a144de7e61be843e7e12f2c9.png\" alt=\"image-20221117221133702\" title=\"\u4ece\u624b\u6b20\u5220\u9664\u6e90\u4ee3\u7801\u5230\u53cd\u7f16\u8bd1exe\u627e\u56de\u63d2\u56fe3\" \/><\/p>\n<p>\u5305\u542b\u7684\u9759\u6001\u8d44\u6e90\u5df2\u7ecf\u53cd\u7f16\u8bd1\u51fa\u6765<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/i0.hdslb.com\/bfs\/album\/4957471b141d3e90d7c3bd6c32d68711d46fd1e6.png\" alt=\"image-20221117221642035\" title=\"\u4ece\u624b\u6b20\u5220\u9664\u6e90\u4ee3\u7801\u5230\u53cd\u7f16\u8bd1exe\u627e\u56de\u63d2\u56fe4\" \/><\/p>\n<h3><span class=\"ez-toc-section\" id=\"%e5%8d%81%e5%85%ad%e8%bf%9b%e5%88%b6%e6%9e%84%e9%80%a0mainpyc\"><\/span>\u5341\u516d\u8fdb\u5236\u6784\u9020main.pyc<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<h4><span class=\"ez-toc-section\" id=\"%e5%8e%9f%e7%90%86\"><\/span>\u539f\u7406<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p><code>pyinstaller<\/code>\u5728\u6253\u5305\u7684\u65f6\u5019\uff0c\u4f1a\u5c06pyc\u6587\u4ef6\u7684\u524d<code>8<\/code>\u4e2a\u5b57\u8282\u6e05\u9664\uff0c\u6240\u4ee5\u540e\u671f\u9700\u8981\u81ea\u5df1\u6dfb\u52a0\u4e0a\u53bb\uff0c\u524d\u56db\u4e2a\u5b57\u8282\u4e3a<code>python<\/code>\u7f16\u8bd1\u7684\u7248\u672c\uff0c\u540e\u56db\u4e2a\u5b57\u8282\u4e3a\u65f6\u95f4\u6233\u3002\uff08\u56db\u4e2a\u5b57\u8282\u7684<code>magic number<\/code>\u3001\u56db\u4e2a\u5b57\u8282\u7684<code>timestamp<\/code>\uff09<br \/>\n\u6240\u4ee5\u5728\u8fd9\u91cc\u53ef\u4ee5\u901a\u8fc7<code>struct<\/code>\u6587\u4ef6\u6765\u83b7\u53d6\u5176\u4e2d\u7684\u4fe1\u606f\u3002<\/p>\n<h4><span class=\"ez-toc-section\" id=\"%e5%bc%80%e5%b9%b2\"><\/span>\u5f00\u5e72<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>\u627e\u5230\u5982\u4e0b\u4e24\u4e2a\u6587\u4ef6\uff1amain\u548cstruct<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/i0.hdslb.com\/bfs\/album\/aec9aff90cb4199fe82c1acecef550efbf6768ac.png\" alt=\"image-20221117221811664\" title=\"\u4ece\u624b\u6b20\u5220\u9664\u6e90\u4ee3\u7801\u5230\u53cd\u7f16\u8bd1exe\u627e\u56de\u63d2\u56fe5\" \/><\/p>\n<p>\u752816\u8fdb\u5236\u7f16\u8f91\u5668\u6253\u5f00\u8fd9\u4e24\u4e2a\u6587\u4ef6\uff0c\u5e76\u65b0\u5efa\u4e00\u4e2amain.pyc\uff0c\u5171\u540c\u6253\u5f00\uff0c\u6211\u8fd9\u91cc\u7528X-ways\u4ee3\u66ff\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/i0.hdslb.com\/bfs\/album\/ef52792d2fea0ea060d35a67f0288d319516cb5b.png\" alt=\"image-20221117223339450\" title=\"\u4ece\u624b\u6b20\u5220\u9664\u6e90\u4ee3\u7801\u5230\u53cd\u7f16\u8bd1exe\u627e\u56de\u63d2\u56fe6\" \/><\/p>\n<p><strong>main.pyc=struct\u7b2c\u4e00\u884c+main<\/strong><\/p>\n<p>struct<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/i0.hdslb.com\/bfs\/album\/f75249cf47b1a46e78ed27536de303494e08f0b1.png\" alt=\"image-20221117223513401\" title=\"\u4ece\u624b\u6b20\u5220\u9664\u6e90\u4ee3\u7801\u5230\u53cd\u7f16\u8bd1exe\u627e\u56de\u63d2\u56fe7\" \/><\/p>\n<p>main<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/i0.hdslb.com\/bfs\/album\/f92301c401d2c303d79fe0d4c96a80f622d5f9ef.png\" alt=\"image-20221117223602881\" title=\"\u4ece\u624b\u6b20\u5220\u9664\u6e90\u4ee3\u7801\u5230\u53cd\u7f16\u8bd1exe\u627e\u56de\u63d2\u56fe8\" \/><\/p>\n<p>main.pyc<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/i0.hdslb.com\/bfs\/album\/0522b49dfe5450bd3833fd8b538b2ea1593b63fc.png\" alt=\"image-20221117223704367\" title=\"\u4ece\u624b\u6b20\u5220\u9664\u6e90\u4ee3\u7801\u5230\u53cd\u7f16\u8bd1exe\u627e\u56de\u63d2\u56fe9\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"mainpyc%e2%86%92mainpy\"><\/span>main.pyc\u2192main.py<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u65b9\u6cd5\u4e00\uff1auncompyle6<\/p>\n<p><a href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzI1ODM1MjUxMQ==&amp;mid=2247490032&amp;idx=1&amp;sn=a07d1e85881b483c998e9438c23fa568&amp;chksm=ea082de0dd7fa4f60045816c27924cd49225f54c90491f0e7b72b3062f052e73d813737a7710#rd\">\u5de5\u5177\u63a8\u8350\u2014\u2014\u53c8\u6709\u4e09\u4e2aBurp\u63d2\u4ef6<\/a><\/p>\n<pre class=\"prettyprint linenums\" ><code>pip3 install uncompyle6\nuncompyle6 main.pyc<\/code><\/pre>\n<p>\u6211\u672c\u5730\u662fPython3.10\uff0c\u6240\u4ee5\u4e0d\u652f\u6301\uff0c\u5982\u679c\u8981\u7528\u8fd9\u4e2a\u5c3d\u91cf\u7528Python3.8<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/i0.hdslb.com\/bfs\/album\/4226f331aa2c949653cb50e6a57e0382066b46ca.png\" alt=\"image-20221117224147467\" title=\"\u4ece\u624b\u6b20\u5220\u9664\u6e90\u4ee3\u7801\u5230\u53cd\u7f16\u8bd1exe\u627e\u56de\u63d2\u56fe10\" \/><\/p>\n<p>\u65b9\u6cd5\u4e8c\uff1a\u5728\u7ebfpyc\u53cd\u7f16\u8bd1<\/p>\n<p>\u5730\u5740\uff1a<a href=\"https:\/\/tool.lu\/pyc\">https:\/\/tool.lu\/pyc<\/a><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/i0.hdslb.com\/bfs\/album\/f6cc209385e65bb942fe9a941c617aad0fb4e895.png\" alt=\"image-20221117224513652\" title=\"\u4ece\u624b\u6b20\u5220\u9664\u6e90\u4ee3\u7801\u5230\u53cd\u7f16\u8bd1exe\u627e\u56de\u63d2\u56fe11\" \/><\/p>\n<p>\u6210\u529f\u62ff\u5230main.py\u6e90\u7801<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/i0.hdslb.com\/bfs\/album\/35bfbc34b1fc496d0b837f51f130aa0e56aac152.png\" alt=\"image-20221117224734204\" title=\"\u4ece\u624b\u6b20\u5220\u9664\u6e90\u4ee3\u7801\u5230\u53cd\u7f16\u8bd1exe\u627e\u56de\u63d2\u56fe12\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"%e4%b8%80%e4%ba%9b%e9%97%ae%e9%a2%98\"><\/span>\u4e00\u4e9b\u95ee\u9898<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ol>\n<li>\n<p>\u76f4\u63a5\u53cd\u7f16\u8bd1\u51fa\u6765\u7684\u4ee3\u7801\u53ef\u80fd\u4f1a\u548c\u6700\u5f00\u59cb\u81ea\u5df1\u5199\u7684\u6709\u4e00\u90e8\u5206\u51fa\u5165\u3002<\/p>\n<\/li>\n<li>\n<p>\u90e8\u5206\u4ee3\u7801\u56e0\u4e3a\u903b\u8f91\u95ee\u9898\u53ef\u80fd\u51fa\u73b0Bug\uff0c\u7ecf\u8fc7\u6211\u7684\u8c03\u8bd5\u5df2\u89e3\u51b3\u3002<\/p>\n<p>\u4f8b\u5982\uff1a<\/p>\n<p>Flask\u4e2d\u7684app\u8def\u7531\u88c5\u9970\u5668\u4ee3\u7801\u88ab\u4fee\u6539\u4f7f\u5f97\u7a0b\u5e8f\u65e0\u6cd5\u8fd0\u884c\u3002<\/p>\n<p>Flask\u4e2d\u7684\u6e32\u67d3\u6a21\u5757<code>render_template<\/code>\u7684\u53c2\u6570\u683c\u5f0f\u4e5f\u88ab\u4fee\u6539<\/p>\n<\/li>\n<li>\n<p>\u53cd\u7f16\u8bd1\u540e\u9700\u8981\u505a\u5c11\u91cf\u7684\u8c03\u8bd5\u624d\u80fd\u6b63\u5e38\u8fd0\u884c\uff0c\u4ee3\u7801\u91cf\u5de8\u5927\u65f6\u4f30\u8ba1\u4f1a\u5f88\u5934\u75bc\u3002<\/p>\n<\/li>\n<\/ol>\n<h2><span class=\"ez-toc-section\" id=\"reference\"><\/span>Reference<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<blockquote>\n<p><a href=\"https:\/\/github.com\/MrWQ\/reverse_pyinstaller\">https:\/\/github.com\/MrWQ\/reverse_pyinstaller<\/a><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u8a00 \u4e4b\u524d\u53d1\u7684EDU\u67e5\u8be2\u8f85\u52a9\u5de5\u5177\uff0c\u53ea\u7528Pyinstaller\u6253\u5305\u4e86exe\uff0c\u6709MAC\u7684\u5c0f\u4f19\u4f34\u60f3\u8981\u8fd0\u884c\uff0c\u4f46\u662f\u6211\u89c9\u5f97 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36,48],"tags":[],"class_list":["post-1095","post","type-post","status-publish","format-standard","hentry","category-tools","category-48"],"_links":{"self":[{"href":"https:\/\/blog.langsasec.cn\/index.php\/wp-json\/wp\/v2\/posts\/1095","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.langsasec.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.langsasec.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.langsasec.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.langsasec.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1095"}],"version-history":[{"count":2,"href":"https:\/\/blog.langsasec.cn\/index.php\/wp-json\/wp\/v2\/posts\/1095\/revisions"}],"predecessor-version":[{"id":1098,"href":"https:\/\/blog.langsasec.cn\/index.php\/wp-json\/wp\/v2\/posts\/1095\/revisions\/1098"}],"wp:attachment":[{"href":"https:\/\/blog.langsasec.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1095"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.langsasec.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1095"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.langsasec.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1095"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}