{"id":1144,"date":"2025-12-26T00:11:44","date_gmt":"2025-12-25T16:11:44","guid":{"rendered":"https:\/\/h4ckm310n.com\/?p=1144"},"modified":"2025-12-26T21:03:47","modified_gmt":"2025-12-26T13:03:47","slug":"%e5%88%a0%e9%99%a4ntqq%e4%b8%ad%e9%83%a8%e5%88%86%e7%be%a4%e8%81%8a%e7%9a%84%e5%9b%be%e7%89%87","status":"publish","type":"post","link":"https:\/\/h4ckm310n.com\/?p=1144","title":{"rendered":"\u6e05\u7406\u5b89\u5353NTQQ\u4e2d\u6307\u5b9a\u7fa4\u804a\u7684\u56fe\u7247"},"content":{"rendered":"<p><!--more--><\/p>\n<p>\u5728<a href=\"https:\/\/h4ckm310n.com\/?p=1135\" target=\"_blank\">\u4e0a\u4e00\u7bc7\u6587\u7ae0<\/a>\u4e2d\uff0c\u6211\u6210\u529f\u89e3\u5bc6\u4e86NTQQ\u7684\u804a\u5929\u8bb0\u5f55\u6570\u636e\u5e93\uff08nt_msg.db\uff09\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4f1a\u8bfb\u53d6\u6570\u636e\u5e93\u4e2d\u6307\u5b9a\u7fa4\u804a\u7684\u804a\u5929\u8bb0\u5f55\u4fe1\u606f\uff0c\u4ece\u4e2d\u83b7\u53d6\u6d88\u606f\u4e2d\u7684\u56fe\u7247\u8def\u5f84\uff0c\u5e76\u8fdb\u884c\u5220\u9664\u3002<\/p>\n<p>\u6574\u4f53\u4e0a\uff0c\u4e3b\u8981\u5206\u4e3a\u4e24\u6b65\uff1a\u7b2c\u4e00\u6b65\u662f\u8bfb\u53d6\u6570\u636e\u5e93\uff0c\u89e3\u6790\u5176\u4e2d\u7684\u56fe\u7247\u8def\u5f84\uff0c\u8fd9\u4e00\u6b65\u662f\u5728\u7535\u8111\uff08windows\uff09\u4e0b\u8fdb\u884c\uff1b\u7b2c\u4e00\u6b65\u4f1a\u751f\u6210\u4e00\u4e2ajson\u6587\u4ef6\uff0c\u91cc\u9762\u5305\u542b\u89e3\u6790\u51fa\u6765\u7684\u56fe\u7247\u8def\u5f84\uff0c\u800c\u7b2c\u4e8c\u6b65\u5219\u662f\u5c06\u8fd9\u4e2ajson\u653e\u5165\u624b\u673a\u4e2d\uff0c\u5728\u624b\u673a\u91cc\u8fdb\u884c\u5220\u9664\u3002<\/p>\n<h4>\u6570\u636e\u5e93\u89e3\u7801<\/h4>\n<p>\u5728\u4e0a\u4e00\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u5df2\u7ecf\u89e3\u5bc6\u4e86nt_msg.db\u5e76\u4fdd\u5b58\u4e3a\u4e86\u4e00\u4e2a\u65b0\u7684\u6570\u636e\u5e93\u6587\u4ef6\uff0c\u8fd9\u4e2a\u65b0\u6587\u4ef6\u53ef\u4ee5\u76f4\u63a5\u8bfb\u53d6\uff0c\u4e0d\u9700\u8981\u89e3\u5bc6\u3002<br \/>\n\u7531\u4e8e\u6211\u7684\u76ee\u6807\u662f\u7fa4\u804a\u7684\u804a\u5929\u8bb0\u5f55\uff0c\u6240\u4ee5\u9700\u8981\u8bfb\u53d6\u5176\u4e2d\u7684group_msg_table\u8fd9\u4e2a\u8868\u3002\u4e3b\u8981\u5173\u6ce8\u4e24\u4e2a\u5b57\u6bb5\uff1a40030\u8868\u793a\u7fa4\u53f7\uff0c40800\u8868\u793a\u804a\u5929\u8bb0\u5f55\u5185\u5bb9\u3002<\/p>\n<p>\u6211\u7684\u804a\u5929\u8bb0\u5f55\u6bd4\u8f83\u591a\uff0c\u6240\u4ee5\u8bfb\u53d6\u6240\u6709\u7684\u7fa4\u7684\u804a\u5929\u8bb0\u5f55\u592a\u8017\u65f6\u95f4\u4e86\uff0c\u6211\u53ea\u9700\u8981\u5220\u9664\u5176\u4e2d\u67d0\u51e0\u4e2a\u7fa4\u7684\u804a\u5929\u8bb0\u5f55\u56fe\u7247\u3002<br \/>\nSQL\u8bed\u53e5\u5982\u4e0b\uff0c\u5176\u4e2d\u768412345\u548c23456\u8868\u793a\u6211\u9700\u8981\u8bfb\u53d6\u7684\u7fa4\u804a\uff1a<\/p>\n<pre>SELECT `40800`, `40030` FROM group_msg_table WHERE `40030` IN ('12345', '23456');\r\n<\/pre>\n<p>40800\u8fd9\u4e2a\u5b57\u6bb5\u5b58\u50a8\u7684\u5e76\u4e0d\u662f\u660e\u6587\u7684\u804a\u5929\u8bb0\u5f55\uff0c\u800c\u662f\u4e00\u4e32protobuf\u5b57\u8282\uff0c\u9700\u8981\u4f7f\u7528blackboxprotobuf\u8fd9\u4e2a\u5305\u6765\u8fdb\u884c\u89e3\u7801\uff0c\u89e3\u7801\u7684\u7ed3\u679c\u662f\u4e00\u4e2adict\uff0c\u800c\u8fd9\u91cc\u9762\u53ef\u80fd\u5b58\u5728\u5c42\u5c42\u5d4c\u5957\u7684\u5173\u7cfb\uff0c\u4f8b\u5982dict\u91cc\u9762\u5305\u542blist\uff0clist\u91cc\u9762\u5305\u542bdict\uff0c\u6216\u8005\u5305\u542b\u53e6\u4e00\u4e32protobuf\u5b57\u8282\uff0c\u56e0\u6b64\u53ef\u80fd\u9700\u8981\u4ee5\u9012\u5f52\u7684\u5f62\u5f0f\u8fdb\u884c\u89e3\u7801\u3002\u89e3\u7801\u8fc7\u7a0b\u3001\u5404\u79cd\u5b57\u6bb5\u7684\u542b\u4e49\u3001\u4ee5\u53ca\u904d\u5386\u65b9\u5f0f\u4e3b\u8981\u53c2\u8003\u4e86<a href=\"https:\/\/github.com\/miniyu157\/qq-dump\/blob\/main\/chat_export\/mods\/features\/export_c2c.py\" target=\"_blank\" rel=\"noopener\">qq-dump<\/a>\u548c<a href=\"https:\/\/github.com\/Tealina28\/QQNT_Export\/blob\/main\/exporter\/base_elements.py\" target=\"_blank\" rel=\"noopener\">QQNT_Export<\/a>\u3002<\/p>\n<p>\u5728\u89e3\u7801\u7684\u8fc7\u7a0b\u4e2d\uff0c\u5982\u679c\u9047\u5230\u201cExceeds the limit (4300 digits) for integer string conversion\u201d\u8fd9\u6837\u7684\u62a5\u9519\uff0c\u53ef\u4ee5\u5728\u4ee3\u7801\u9876\u90e8\u52a0\u4e0a\uff1a<\/p>\n<pre>\r\nimport sys\r\nsys.set_int_max_str_digits(0)\r\n<\/pre>\n<p>\u8fd9\u91cc\u53ea\u9700\u8981\u5173\u6ce8\u56fe\u7247\u76f8\u5173\u7684\u5185\u5bb9\uff0c\u6839\u636e<a href=\"https:\/\/docs.aaqwq.top\/view\/message_export.html\" target=\"_blank\" rel=\"noopener\">\u6d88\u606f\u5bfc\u51fa\u8ba1\u5212<\/a>\u548c<a href=\"https:\/\/github.com\/miniyu157\/qq-dump\/blob\/main\/chat_export\/proto_maps.py\" target=\"_blank\" rel=\"noopener\">proto_maps.py<\/a>\uff0c\u6211\u9700\u8981\u627e\u5230\u89e3\u7801\u7ed3\u679c\u4e2d\u768445406\u621645424\u5b57\u6bb5\u3002\u6309\u7406\u8bf4\uff0c45406\u5b57\u6bb5\u5e94\u8be5\u662fbytes\u7c7b\u578b\uff0c\u800c45424\u5b57\u6bb5\u5219\u662fstr\u7c7b\u578b\uff0c\u4e14\u4e24\u8005\u7684\u957f\u5ea6\u90fd\u5e94\u8be5\u662f32\uff0c\u4f46\u4e0d\u77e5\u4e3a\u4f55\u5076\u5c14\u53ef\u80fd\u4f1a\u9047\u5230\u522b\u7684\u60c5\u51b5\uff0c\u4f8b\u5982\u7c7b\u578b\u4e0d\u540c\u6216\u957f\u5ea6\u4e0d\u7b26\u7684\u60c5\u51b5\uff0c\u76ee\u524d\u8fd8\u4e0d\u77e5\u9053\u539f\u56e0\uff0c\u53ea\u80fd\u6682\u4e14\u5ffd\u7565\u8fd9\u4e9b\u3002<\/p>\n<p>\u5bf9\u4e8e45406\u5b57\u6bb5\u7684bytes\uff0c\u5bf9\u5176\u8fdb\u884c.hex().upper()\u64cd\u4f5c\uff0c\u8f6c\u6362\u4e3a\u957f\u5ea632\u7684\u5168\u5927\u5199\u5b57\u7b26\u4e32\uff0c\u800c\u5bf9\u4e8e45424\u7684\u5b57\u7b26\u4e32\uff0c\u4e0d\u9700\u8981\u505a\u5904\u7406\uff0c\u901a\u5e38\u5b83\u672c\u8eab\u5c31\u662f\u4e00\u4e2a\u957f\u5ea632\u7684\u5168\u5927\u5199\u5b57\u7b26\u4e32\u3002\u5b83\u4eec\u7684\u672c\u8d28\u5176\u5b9e\u662fmd5\u5341\u516d\u8fdb\u5236\u5b57\u7b26\u4e32\u3002<\/p>\n<p>\u4e00\u822c\u6765\u8bf4\uff0c\u56fe\u7247\u53ef\u80fd\u5b58\u5728\u4e8e\u4ee5\u4e0b3\u4e2a\u76ee\u5f55\uff1achatthumb\u3001chatimg\u3001chatraw\uff0c\u5206\u522b\u5bf9\u5e94\u7f29\u7565\u56fe\u3001\u538b\u7f29\u540e\u7684\u56fe\u7247\u3001\u539f\u56fe\u3002\u8981\u5f97\u5230\u56fe\u7247\u8def\u5f84\uff0c\u9700\u8981\u8fdb\u884c\u4ee5\u4e0b\u64cd\u4f5c\uff1a<br \/>\n1. \u5c0645424\u6216\u7ecf\u8fc7\u5904\u7406\u540e\u768445406\u5b57\u7b26\u4e32\u548c\u76ee\u5f55\u540d\u62fc\u63a5\u5230\u4e00\u8d77\uff0c\u4f8b\u5982\u201cchatimg:{md5}\u201d\u8fd9\u6837\u7684\u683c\u5f0f\uff1b<br \/>\n2. \u5bf9\u8fd9\u4e2a\u62fc\u63a5\u540e\u7684\u5b57\u7b26\u4e32\u8fdb\u884ccrc64\u8fd0\u7b97\uff0c\u5f97\u5230\u4e00\u4e2a\u5341\u516d\u8fdb\u5236\u5b57\u7b26\u4e32\uff0c\u5e76\u53bb\u9664\u5f00\u5934\u7684\u201c0x\u201d\uff0c\u7136\u540e\u524d\u9762\u52a0\u4e0a\u201cCache_\u201d\uff0c\u8fd9\u5c31\u662f\u6587\u4ef6\u540d\uff1b<br \/>\n3. \u53d62\u7684\u7ed3\u679c\u7684\u540e3\u4e2a\u5b57\u7b26\uff0c\u5f97\u5230\u5b50\u76ee\u5f55\u7684\u540d\u79f0\uff0c\u524d\u9762\u518d\u52a0\u4e0a\u4e0a\u8ff0\u8bf4\u76843\u4e2a\u76ee\u5f55\uff0c\u5373\u53ef\u5f97\u5230\u56fe\u7247\u7684\u8def\u5f84\u3002<br \/>\n\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre>def crc64(s):\r\n    _crc64_table = [0] * 256\r\n    for i in range(256):\r\n        bf = i\r\n        for _ in range(8):\r\n            bf = bf &gt;&gt; 1 ^ -7661587058870466123 if bf &amp; 1 else bf &gt;&gt; 1\r\n        _crc64_table[i] = bf\r\n    v = -1\r\n    for c in s:\r\n        v = _crc64_table[(ord(c) ^ v) &amp; 255] ^ v &gt;&gt; 8\r\n    return v\r\n\r\ndef get_img_path(folder, md5):\r\n    url = f\"{folder}:{md5}\"\r\n    filename = 'Cache_' + hex(crc64(url)).replace('0x', '')\r\n    return os.path.join(f\".\/{folder}\/\", filename[-3:], filename).replace(\"\\\\\", \"\/\")<\/pre>\n<p>\u5c06\u5f97\u5230\u7684\u6240\u6709\u56fe\u7247\u8def\u5f84\uff0c\u6309\u7167\u7fa4\u53f7\u5206\u7ec4\uff0c\u5199\u5165json\uff0c\u683c\u5f0f\u5982\u4e0b\uff1a<\/p>\n<pre>\r\n{\"group_number\", [\"img_path_1\", \"img_path_2\"......]}\r\n<\/pre>\n<h4>\u5220\u9664<\/h4>\n<p>\u6211\u5df2\u7ecf\u89e3\u6790\u597d\u4e86\u56fe\u7247\u8def\u5f84\uff0c\u5e76\u751f\u6210\u4e86\u4e00\u4e2ajson\u3002\u4e0b\u9762\u5c31\u8be5\u628a\u76ee\u6807\u8f6c\u79fb\u56de\u624b\u673a\u4e0a\u4e86\u3002<br \/>\n\u7f16\u5199\u4e00\u4e2a\u65b0\u7684\u811a\u672c\uff0c\u5728\u624b\u673a\u4e0a\u8fd0\u884c\uff0c\u7528\u4e8e\u8bfb\u53d6\u8fd9\u4e2ajson\u6587\u4ef6\uff0c\u5f97\u5230\u91cc\u9762\u7684\u56fe\u7247\u8def\u5f84\uff0c\u5e76\u6267\u884c\u5220\u9664\uff0c\u8fd9\u4e00\u6b65\u5f88\u7b80\u5355\uff0c\u5c31\u4e0d\u591a\u89e3\u91ca\u4e86\u3002<br \/>\n\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u4e0a\u9762\u751f\u6210\u7684\u56fe\u7247\u8def\u5f84\u5e76\u4e0d\u662f\u4e00\u4e2a\u7edd\u5bf9\u8def\u5f84\uff0c\u5b83\u7684\u5f00\u5934\u662fchatthumb\u6216chatimg\u6216chatraw\uff0c\u8fd93\u4e2a\u76ee\u5f55\u5b9e\u9645\u4e0a\u90fd\u5728\u201c\/storage\/emulated\/0\/Android\/data\/com.tencent.mobileqq\/Tencent\/MobileQQ\/chatpic\/\u201d\u91cc\u9762\uff0c\u9700\u8981\u5148\u6267\u884cos.chdir()\u6765\u8fdb\u5165chatpic\u76ee\u5f55\u4e0b\uff0c\u518d\u6267\u884c\u5220\u9664\u3002<\/p>\n<p>\u81f3\u6b64\uff0c\u6240\u6709\u7684\u6b65\u9aa4\u90fd\u5b8c\u6210\u4e86\u3002\u8fd9\u4e2a\u8fc7\u7a0b\u4e2d\u53ef\u80fd\u4f1a\u6709\u9519\u8bef\uff0c\u4f8b\u5982\u8bef\u5220\u6216\u6f0f\u5220\u7684\u60c5\u51b5\uff0c\u4f46\u7531\u4e8e\u6570\u636e\u91cf\u592a\u5927\u4e86\uff0c\u5373\u4f7f\u6709\u95ee\u9898\u4e5f\u96be\u4ee5\u53d1\u73b0\uff0c\u6ca1\u529e\u6cd5\u3002<\/p>\n<h4>\u53c2\u8003<\/h4>\n<p>1. <a href=\"https:\/\/github.com\/Tealina28\/QQNT_Export\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/Tealina28\/QQNT_Export<\/a><br \/>\n2. <a href=\"https:\/\/github.com\/miniyu157\/qq-dump\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/miniyu157\/qq-dump<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"default","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[22,6],"tags":[],"class_list":["post-1144","post","type-post","status-publish","format-standard","hentry","category-android","category-6"],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"h4ckm310n","author_link":"https:\/\/h4ckm310n.com\/?author=1"},"uagb_comment_info":0,"uagb_excerpt":null,"_links":{"self":[{"href":"https:\/\/h4ckm310n.com\/index.php?rest_route=\/wp\/v2\/posts\/1144","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/h4ckm310n.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/h4ckm310n.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/h4ckm310n.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/h4ckm310n.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1144"}],"version-history":[{"count":6,"href":"https:\/\/h4ckm310n.com\/index.php?rest_route=\/wp\/v2\/posts\/1144\/revisions"}],"predecessor-version":[{"id":1150,"href":"https:\/\/h4ckm310n.com\/index.php?rest_route=\/wp\/v2\/posts\/1144\/revisions\/1150"}],"wp:attachment":[{"href":"https:\/\/h4ckm310n.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1144"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/h4ckm310n.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1144"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/h4ckm310n.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1144"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}