{"id":629,"date":"2018-11-09T00:25:30","date_gmt":"2018-11-08T16:25:30","guid":{"rendered":"https:\/\/flandre-scarlet.moe\/blog\/?p=629"},"modified":"2019-05-14T01:01:03","modified_gmt":"2019-05-13T17:01:03","slug":"yu-ris-%e5%b0%81%e5%8c%85%e5%88%86%e6%9e%90","status":"publish","type":"post","link":"https:\/\/flandre-scarlet.moe\/blog\/629\/","title":{"rendered":"YU-RIS \u5c01\u5305\u5206\u6790"},"content":{"rendered":"<p>\u8fd9\u4e24\u5929\u641e\u4e86\u4e00\u4e0b yu-ris \u7684 ypf \u5c01\u5305\uff0c\u8fd9\u91cc\u505a\u4e2a\u7b80\u5355\u7684\u8bb0\u5f55\u3002<\/p>\n<p><p>ypf \u4e3b\u8981\u7528\u4e86 zlib \u8fdb\u884c\u538b\u7f29\u5904\u7406\u3002\u5305\u5934\u91cc\u6709\u6587\u4ef6\u6570\u91cf\u548c\u6570\u636e\u533a\u8d77\u59cb\u5730\u5740\u7b49\u4fe1\u606f\u3002\u6587\u4ef6\u7d22\u5f15\u8868\u91cc\u5305\u542b\u4e86\u6587\u4ef6\u7684\u504f\u79fb\u3001\u538b\u7f29\u540e\u957f\u5ea6\u548c\u539f\u59cb\u957f\u5ea6\u7b49\u57fa\u672c\u4fe1\u606f\uff0c\u6587\u4ef6\u540d\u5219\u662f\u7ecf\u8fc7\u53d6\u53cd\u540e\u5b58\u50a8\u7684\u3002\u6587\u4ef6\u7d22\u5f15\u8868\u975e\u5b9a\u957f\u3002<\/p>\n<p><!--more--><\/p>\n<h3>ypf \u5c01\u5305<\/h3>\n<p>\u5c01\u5305\u7684\u7ed3\u6784\u5982\u4e0b\uff1a<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\nstruct YpfHeader {\r\n    uint32_t mMagic;\r\n    uint32_t mVersionTmp;    \/\/ \u5e94\u8be5\u662f\u7248\u672c\u53f7\u4e4b\u7c7b\u7684\r\n    uint32_t mFileCount;\r\n    uint32_t mDataStart;\r\n    uint8_t  mZero&#x5B;16];\r\n};\r\nstruct YpfEntry {\r\n    uint32_t unknown;\r\n    uint8_t name_length;     \/\/ \u8981\u89e3\u7801\r\n    uint8_t name&#x5B;1];         \/\/ \u8981\u89e3\u7801\r\n    uint8_t filetype;\r\n    uint8_t zlib_compress_flag;\r\n    uint32_t original_length;\r\n    uint32_t compressd_length;\r\n    uint32_t offset;\r\n    uint32_t unknwon;      \/\/ \u4f30\u8ba1\u662f crc \u4e4b\u7c7b\u7684\r\n};\r\n<\/pre>\n<\/p>\n<p>\u76ee\u524d\u624b\u5934\u4e0a\u4e24\u6b3e\u6e38\u620f\u7684 YpfHeader::mVersionTmp \u5b57\u6bb5\u4e0d\u540c\uff0c\u5e76\u4e14 YpfEntry \u4e2d\u4e5f\u6709\uff08\u5fae\u5c0f\u7684\uff09\u5dee\u5f02\uff0c\u7248\u53f7\u5927\u7684 YpfEntry \u7ed3\u6784\u4e2d\u591a\u4e86\u4e00\u4e2a\u5168\u96f6\u7684 uint32_t\u3002<\/p>\n<p>\u6587\u4ef6\u540d\u524d\u9762\u6709\u4e00\u4e2a\u6307\u793a\u957f\u5ea6\u7684\u5b57\u8282\uff0c\u4f46\u662f\u9700\u8981\u7ecf\u8fc7\u8fd0\u7b97\u624d\u80fd\u5f97\u5230\u771f\u5b9e\u7684\u6587\u4ef6\u540d\u957f\u5ea6\u3002\u4e3a\u7b80\u4fbf\u8d77\u89c1\uff0c\u53ef\u4ee5\u5728\u89e3\u7801\u8fc7\u7a0b\u4e2d\u8bc6\u522b\u6587\u4ef6\u6269\u5c55\u540d\u4e4b\u524d\u7684 &#8216;.&#8217;\uff0c\u7136\u540e\u52a0\u4e0a\u6700\u540e 3 \u4e2a\u5b57\u7b26\u7684\u6269\u5c55\u540d\u5c31\u5f97\u5230\u5b8c\u6574\u6587\u4ef6\u540d\u4e86\u3002<\/p>\n<p>\u6839\u636e\u7d22\u5f15\u8868\u4e2d\u7684\u504f\u79fb\u957f\u5ea6\u63d0\u901f\u6570\u636e\u5e76\u89e3\u538b\u5373\u53ef\u89e3\u51fa\u539f\u59cb\u6587\u4ef6\u3002<\/p>\n<h3>ycg \u6587\u4ef6<\/h3>\n<p>ycg \u662f\u7ecf zlib \u538b\u7f29\u540e\u7684\u56fe\u50cf\u3002\u5176\u4e2d\u5934 0x38 \u4e2a\u5b57\u8282\u8bb0\u5f55\u4e86\u6587\u4ef6\u4fe1\u606f\uff0c\u7ed3\u6784\u5982\u4e0b\uff1a<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\nstruct YcgHeader {\r\n    uint32_t mMagic;\r\n    uint32_t mWidth;\r\n    uint32_t mHeight;\r\n    uint32_t mBpp;\r\n    uint32_t mUnkonwn&#x5B;4];\r\n    uint32_t mPart1PlainLength;\r\n    uint32_t mPart1PackedLength;\r\n    uint32_t mMaybeImgPosition&#x5B;2];\r\n    uint32_t mPart2PlainLength;\r\n    uint32_t mPart2PackedLength;\r\n};\r\n<\/pre>\n<p>\u8fd9\u4e24\u90e8\u5206\u5c31\u5bf9\u5e94\u7740\u4e0a\u4e0b\u534a\u5f20\u56fe\u50cf\uff0c\u5bf9\u4e24\u90e8\u5206\u5206\u522b\u89e3\u538b\u540e\u76f4\u63a5\u62fc\u63a5\uff0c\u6700\u540e\u518d\u8865\u4e0a bmp \u6587\u4ef6\u5934\u5373\u53ef\u3002<\/p>\n<h3>ybn \u6587\u4ef6<\/h3>\n<p>\u7ecf\u8fc7\u7f16\u8bd1\u540e\u7684\u811a\u672c\u6587\u4ef6\uff0c\u5e26\u6709 YSTB \u6807\u5fd7\u3002\u4f7f\u7528\u5f02\u6216\u89e3\u7801\uff0ckey \u8981\u5728 exe \u6587\u4ef6\u4e2d\u627e\uff0c\u641c\u7d22\u5b57\u7b26\u4e32 &#8220;ysbin\\yst%05d.ybn&#8221; \u5373\u53ef\u5feb\u901f\u7a7a\u964d\u5230\u76ee\u6807\u9644\u8fd1\u3002\u6bcf\u4e2a\u6e38\u620f\u7684 key \u5e94\u8be5\u90fd\u4e0d\u76f8\u540c\uff0c\u6bd5\u7adf\u53ef\u4ee5\u81ea\u5b9a\u4e49\u3002<\/p>\n<p><a href=\"https:\/\/i.imgur.com\/lKydatO.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/flandre-scarlet.moe\/blog\/wp-content\/uploads\/2018\/11\/ypf\u5c01\u5305.png\" alt=\"\u811a\u672c\u622a\u56fe\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8fd9\u4e24\u5929\u641e\u4e86\u4e00\u4e0b yu-ris \u7684 ypf \u5c01\u5305\uff0c\u8fd9\u91cc\u505a\u4e2a\u7b80\u5355\u7684\u8bb0\u5f55\u3002 ypf \u4e3b\u8981\u7528\u4e86 zlib \u8fdb\u884c\u538b\u7f29\u5904\u7406&#8230; <\/p>\n<div class=\"read-more navbutton\"><a href=\"https:\/\/flandre-scarlet.moe\/blog\/629\/\">\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":[48,67,68,66,65],"class_list":["post-629","post","type-post","status-publish","format-standard","hentry","category-unpacking","category-reverse-engineering","tag-galgame","tag-ybn","tag-ycg","tag-ypf","tag-yu-ris"],"_links":{"self":[{"href":"https:\/\/flandre-scarlet.moe\/blog\/wp-json\/wp\/v2\/posts\/629","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=629"}],"version-history":[{"count":0,"href":"https:\/\/flandre-scarlet.moe\/blog\/wp-json\/wp\/v2\/posts\/629\/revisions"}],"wp:attachment":[{"href":"https:\/\/flandre-scarlet.moe\/blog\/wp-json\/wp\/v2\/media?parent=629"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/flandre-scarlet.moe\/blog\/wp-json\/wp\/v2\/categories?post=629"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/flandre-scarlet.moe\/blog\/wp-json\/wp\/v2\/tags?post=629"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}