{"id":539,"date":"2018-08-16T01:11:25","date_gmt":"2018-08-15T17:11:25","guid":{"rendered":"https:\/\/flandre-scarlet.moe\/blog\/?p=539"},"modified":"2019-05-14T00:21:28","modified_gmt":"2019-05-13T16:21:28","slug":"ddsystem-%e6%b8%b8%e6%88%8f%e5%b0%81%e5%8c%85%e5%88%86%e6%9e%90","status":"publish","type":"post","link":"https:\/\/flandre-scarlet.moe\/blog\/539\/","title":{"rendered":"DDSystem \u6e38\u620f\u5c01\u5305\u5206\u6790"},"content":{"rendered":"<p>\u6e38\u620f\uff1a\u4ecf\u862d\u897f\u5c11\u5973<br \/>\n\u5382\u5bb6\uff1aPIL<\/p>\n<p>\u8fd9\u4e2a\u5c01\u5305\u6ca1\u6709\u7ecf\u8fc7\u538b\u7f29\u3001\u52a0\u5bc6\u5904\u7406\uff0c\u800c\u4e14\u4e3b\u7a0b\u5e8f\u4e5f\u6ca1\u4f5c\u4efb\u4f55\u53cd\u8c03\u8bd5\u7684\u5904\u7406\uff0c\u9006\u8d77\u6765\u76f8\u5f53\u8f7b\u677e\u3002\u3002\u3002<br \/>\n<!--more--><\/p>\n<p>\u5c01\u5305\u7684\u76f8\u5173\u7ed3\u6784\u5982\u4e0b\uff0c2 \u548c 3 \u7684 entry \u5373\u5bf9\u5e94 DDP2 \u548c DDP3 \u7684\u5c01\u5305\uff0cDDP3 \u4e2d\u7684\u7d22\u5f15\u4f7f\u7528\u4e86\u4e8c\u7ea7\u7ed3\u6784\u3002<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\nstruct Header\r\n{\r\n    enum {\r\n        MAGIC_2 = 0x32504444,\t\/\/ DDP2\r\n        MAGIC_3 = 0x33504444,\t\/\/ DDP3\r\n    };\r\n    uint32_t Magic;\r\n    uint32_t EntryCount;   \/\/ DDP3 \u4e2d\u6307 Entry3_L1 \u7684\u6570\u91cf\r\n    uint32_t DataOffset;   \/\/ \u8d77\u59cb\u6570\u636e\u7684\u504f\u79fb\r\n    uint8_t  Revsered&#x5B;20];\r\n};\r\n\r\nstruct Entry2\r\n{\r\n    uint32_t Offset;\r\n    uint32_t PlainSize;    \/\/ \u5b9e\u9645\u5927\u5c0f\r\n    uint32_t PackedSize;   \/\/ \u538b\u7f29\u540e\u5927\u5c0f\r\n    uint32_t Revsered;\r\n};\r\n\r\nstruct Entry3_L1\r\n{\r\n    uint32_t BlockSize;    \/\/ \u5757\u5927\u5c0f\r\n    uint32_t BlockOffset;  \/\/ \u5757\u504f\u79fb\r\n};\r\n\r\n#pragma pack(push, 1)\r\nstruct Entry3_L2_Header\r\n{\r\n    uint8_t  Size;         \/\/ \u7d22\u5f15\u5927\u5c0f\r\n    uint32_t Offset;\r\n    uint32_t PlainSize;\r\n    uint32_t PackedSize;\r\n    uint8_t  Revsered&#x5B;4];\r\n    \/\/ followed by char* NameWithoutSuffix;\r\n};\r\n#pragma pack(pop)\r\n<\/pre>\n<p>\u5c31\u8fd9\u4e2a\u6e38\u620f\u6765\u770b\uff0cDDP2 \u5c01\u5305\u7684\u5185\u5bb9\u90fd\u662f\u7ecf\u8fc7\u538b\u7f29\u7684\uff0c\u4e24\u4e2a\u5b57\u6bb5\u7684\u5927\u5c0f\u4e0d\u4e00\u81f4\uff1b\u800c DDP3 \u4e2d\u4e0d\u662f\u6240\u6709\u6587\u4ef6\u90fd\u7ecf\u8fc7\u538b\u7f29\uff0c\u672a\u538b\u7f29\u6587\u4ef6\u7684 PackedSize \u5b57\u6bb5\u4e3a 0\u3002\u53e6\u5916 DDP3 \u7684\u7d22\u5f15\u4e2d\u5e26\u6709 C \u98ce\u683c\u5b57\u7b26\u4e32\u7684\u6587\u4ef6\u540d\uff0cDDP2 \u4e2d\u5219\u6ca1\u6709\u3002<img decoding=\"async\" src=\"https:\/\/flandre-scarlet.moe\/blog\/wp-content\/uploads\/2018\/08\/ddsystem-1.png\" alt=\"\u5c01\u5305\" \/>\u6a59\u8272\u90e8\u5206\u5373\u4e3a\u7d22\u5f15\u90e8\u5206\uff0c\u6309\u7167\u5927\u5c0f\u662f 16 \u5b57\u8282\u4e00\u4e2a\u7d22\u5f15\u3002<\/p>\n<p>\u538b\u7f29\u4f3c\u4e4e\u662f\u91c7\u7528\u4e86\u81ea\u6709\u7684\u538b\u7f29\u7b97\u6cd5\uff08\u5f31\u6e23\uff0c\u8ba4\u4e0d\u51fa\u6765\u4ec0\u4e48\u7b97\u6cd5_(:\u0437\u300d\u2220)_\uff09\uff0c\u603b\u4e4b\u7528 ida \u6574\u4e2a\u62bd\u51fa\u6765\u4e86\uff0c\u628a\u6ca1\u6709\u7684\u4ee3\u7801\u5220\u6389\uff0c\u91cd\u5efa\u4e00\u4e0b\u5165\u53e3\u5c31\u80fd\u7528\u4e86www<\/p>\n<p>\u811a\u672c\u6587\u4ef6\u8fd8\u591a\u4e86\u4e00\u6b65\u52a0\u5bc6\u7684\u64cd\u4f5c\uff0c\u5c31\u662f\u751f\u6210\u4e00\u4e2a key \u7b80\u5355\u5f02\u6216\u4e00\u4e0b\u3002\u8fd8\u539f\u540e\u7684\u811a\u672c\uff1a<img decoding=\"async\" src=\"https:\/\/flandre-scarlet.moe\/blog\/wp-content\/uploads\/2018\/08\/ddsystem-2.png\" alt=\"\u811a\u672c\" \/><\/p>\n<p>\u8fd9\u6837\u4e00\u6765\u5404\u79cd\u8d44\u6e90\u5c31\u5168\u90e8\u62c6\u51fa\u6765\u4e86w<\/p>\n<p><a href=\"https:\/\/github.com\/Kerisa\/ExtractGames\/tree\/master\/DDSystem\" rel=\"noopener noreferrer\" target=\"_blank\">\u5c01\u5305\u89e3\u6790\u4ee3\u7801<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6e38\u620f\uff1a\u4ecf\u862d\u897f\u5c11\u5973 \u5382\u5bb6\uff1aPIL \u8fd9\u4e2a\u5c01\u5305\u6ca1\u6709\u7ecf\u8fc7\u538b\u7f29\u3001\u52a0\u5bc6\u5904\u7406\uff0c\u800c\u4e14\u4e3b\u7a0b\u5e8f\u4e5f\u6ca1\u4f5c\u4efb\u4f55\u53cd\u8c03\u8bd5\u7684\u5904\u7406\uff0c\u9006\u8d77\u6765\u76f8\u5f53\u8f7b&#8230; <\/p>\n<div class=\"read-more navbutton\"><a href=\"https:\/\/flandre-scarlet.moe\/blog\/539\/\">\u9605\u8bfb\u66f4\u591a<i class=\"fa fa-angle-double-right\"><\/i><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,31],"tags":[50,48,51,49],"class_list":["post-539","post","type-post","status-publish","format-standard","hentry","category-unpacking","category-reverse-engineering","tag-ddsystem","tag-galgame","tag-pil","tag-49"],"_links":{"self":[{"href":"https:\/\/flandre-scarlet.moe\/blog\/wp-json\/wp\/v2\/posts\/539","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/flandre-scarlet.moe\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/flandre-scarlet.moe\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/flandre-scarlet.moe\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/flandre-scarlet.moe\/blog\/wp-json\/wp\/v2\/comments?post=539"}],"version-history":[{"count":0,"href":"https:\/\/flandre-scarlet.moe\/blog\/wp-json\/wp\/v2\/posts\/539\/revisions"}],"wp:attachment":[{"href":"https:\/\/flandre-scarlet.moe\/blog\/wp-json\/wp\/v2\/media?parent=539"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/flandre-scarlet.moe\/blog\/wp-json\/wp\/v2\/categories?post=539"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/flandre-scarlet.moe\/blog\/wp-json\/wp\/v2\/tags?post=539"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}