示例#1
0
        public static void SaveToDisk(string path, byte[] wzIv, List <string> listEntries)
        {
            var lastIndex = listEntries.Count - 1;
            var lastEntry = listEntries[lastIndex];

            listEntries[lastIndex] = lastEntry.Substring(0, lastEntry.Length - 1) + "/";
            var wzWriter = new WzBinaryWriter(File.Create(path), wzIv);

            foreach (var entry in listEntries)
            {
                wzWriter.Write(entry.Length);
                var encryptedChars = wzWriter.EncryptString(entry + (char)0);
                foreach (var encryptedChar in encryptedChars)
                {
                    wzWriter.Write((short)encryptedChar);
                }
            }

            listEntries[lastIndex] = lastEntry.Substring(0, lastEntry.Length - 1) + "/";
        }
示例#2
0
        public static void SaveToDisk(string path, byte[] WzIv, List <string> listEntries)
        {
            int    lastIndex = listEntries.Count - 1;
            string lastEntry = listEntries[lastIndex];

            listEntries[lastIndex] = lastEntry.Substring(0, lastEntry.Length - 1) + "/";
            WzBinaryWriter wzWriter = new WzBinaryWriter(File.Create(path), WzIv);
            string         s;

            for (int i = 0; i < listEntries.Count; i++)
            {
                s = listEntries[i];
                wzWriter.Write((int)s.Length);
                char[] encryptedChars = wzWriter.EncryptString(s + (char)0);
                for (int j = 0; j < encryptedChars.Length; j++)
                {
                    wzWriter.Write((short)encryptedChars[j]);
                }
            }
            listEntries[lastIndex] = lastEntry.Substring(0, lastEntry.Length - 1) + "/";
        }