Example #1
0
 public WzFile(short gameVersion, WzMapleVersionType version)
 {
     Version          = gameVersion;
     MapleVersionType = version;
     _wzIv            = WzTool.GetIvByMapleVersion(version);
     WzDirectory.WzIv = _wzIv;
 }
Example #2
0
 /// <summary>
 /// Open a wz file from a file on the disk
 /// </summary>
 /// <param name="filePath">Path to the wz file</param>
 /// <param name="gameVersion"></param>
 /// <param name="version"></param>
 public WzFile(string filePath, short gameVersion, WzMapleVersionType version)
 {
     Name             = Path.GetFileName(filePath);
     FilePath         = filePath;
     Version          = gameVersion;
     MapleVersionType = version;
     _wzIv            = WzTool.GetIvByMapleVersion(version);
 }
Example #3
0
        public static byte[] GetIvByMapleVersion(WzMapleVersionType ver)
        {
            switch (ver)
            {
            case WzMapleVersionType.Ems:
                return(CryptoConstants.WzMseaiv);

            case WzMapleVersionType.Gms:
                return(CryptoConstants.WzGmsiv);

            case WzMapleVersionType.Bms:
            case WzMapleVersionType.Classic:
            case WzMapleVersionType.Generate:
                return(new byte[4]);

            default:
                throw new ArgumentOutOfRangeException(nameof(ver), ver, null);
            }
        }
Example #4
0
 /// <inheritdoc />
 /// <summary>
 /// Open a wz file from a file on the disk
 /// </summary>
 /// <param name="filePath">Path to the wz file</param>
 /// <param name="version"></param>
 public WzFile(string filePath, WzMapleVersionType version) : this(filePath, -1, version)
 {
 }
Example #5
0
 public static void SaveToDisk(string path, WzMapleVersionType version, List <string> listEntries)
 {
     SaveToDisk(path, WzTool.GetIvByMapleVersion(version), listEntries);
 }
Example #6
0
 /// <summary>
 /// Parses a wz list file on the disk
 /// </summary>
 /// <param name="filePath">Path to the wz file</param>
 /// <param name="version"></param>
 public static List <string> ParseListFile(string filePath, WzMapleVersionType version)
 {
     return(ParseListFile(filePath, WzTool.GetIvByMapleVersion(version)));
 }
Example #7
0
 public WzImage(string name, Stream dataStream, WzMapleVersionType mapleVersion)
 {
     Name   = name;
     Reader = new WzBinaryReader(dataStream, WzTool.GetIvByMapleVersion(mapleVersion));
 }