From 753063ccd150406e470cf535d2b4ef99afdcc3bf Mon Sep 17 00:00:00 2001 From: Ludibrium <403352148@qq.com> Date: Tue, 8 Jan 2019 11:39:07 +0800 Subject: [PATCH] Bug Fix. --- Rich6Extractor/Form1.cs | 1 + Rich6Extractor/Rich6Viewer.cs | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Rich6Extractor/Form1.cs b/Rich6Extractor/Form1.cs index 840404b..eed42e9 100644 --- a/Rich6Extractor/Form1.cs +++ b/Rich6Extractor/Form1.cs @@ -26,6 +26,7 @@ private void ToolStripMenuItem1_Click(object sender, EventArgs e) { textBox1.Clear(); textBox2.Clear(); + treeView1.Nodes.Clear(); var f = new OpenFileDialog(); f.Filter = ".pck文件|*.pck"; f.ShowDialog(); diff --git a/Rich6Extractor/Rich6Viewer.cs b/Rich6Extractor/Rich6Viewer.cs index 9c584e1..9395ba1 100644 --- a/Rich6Extractor/Rich6Viewer.cs +++ b/Rich6Extractor/Rich6Viewer.cs @@ -20,6 +20,7 @@ public class Rich6Viewer public int begin; public int stride = 0x108; int sizeLen; + int fileNum; public Rich6Viewer(string path,int RichVersion) { @@ -28,10 +29,12 @@ public Rich6Viewer(string path,int RichVersion) case 6: sizeLen = 4; begin = 9; + fileNum = 2143; break; case 7: sizeLen = 4; begin = 8; + fileNum = 3671; break; default: throw new ArgumentException("No Support Rich Version."); @@ -51,7 +54,7 @@ public Rich6Viewer(string path,int RichVersion) public void ReadAll() { var encoding = Encoding.GetEncoding(936); - for (int temp_begin = begin; temp_begin < 0x8a200; temp_begin += stride) + for (int temp_begin = begin; temp_begin < 0x108*fileNum; temp_begin += stride) { int len = 0; while (mv.ReadByte(temp_begin + len) != 0) len++;