public override void vmethod_13(Stream26 stream26_0) { this.int_0 = stream26_0.ReadInt(); int num = stream26_0.ReadInt(); int num2 = stream26_0.ReadInt(); if (num != 0) { AbstractTreeNode1 @class = this.vmethod_12(stream26_0.ReadIntAt(num, true)); base.Nodes.Add(@class); @class.method_4(stream26_0); } if (num2 != 0) { AbstractTreeNode1 class2 = (base.Parent is StructureHeaderNode) ? (base.Parent as StructureHeaderNode).method_11(stream26_0.ReadIntAt(num2)) : this.vmethod_12(stream26_0.ReadIntAt(num2, true)); base.method_1().Nodes.Add(class2); class2.method_4(stream26_0); } }
public override void vmethod_14(Stream26 stream26_0) { byte[] array = new byte[4]; array[1] = (this.vmethod_7() ? (byte)32 : (byte)4); array[2] = 3; stream26_0.WriteByteArray(array, false); stream26_0.WriteInt(this.int_0); stream26_0.WriteInt(this.int_1); if (base.Nodes.Count != 0) { stream26_0.WriteInt((int)stream26_0.Position + 8); stream26_0.WriteInt(0); stream26_0.WriteString(this.method_7()); stream26_0.WriteByte2(0); stream26_0.WriteNBytes(0, AbstractTreeNode1.smethod_0(stream26_0.Position)); return; } stream26_0.WriteNBytes(0, 8); }
public override void vmethod_14(Stream26 stream26_0) { if (this.vmethod_8()) { byte[] array = new byte[4]; array[1] = 1; array[2] = 4; stream26_0.WriteByteArray(array, false); } else { byte[] array2 = new byte[4]; array2[1] = (this.vmethod_7() ? (byte)132 : (byte)9); stream26_0.WriteByteArray(array2, false); } stream26_0.WriteInt(this.int_0); int int_ = (int)stream26_0.Position + 4; if (base.Nodes.Count != 0) { stream26_0.WriteInt((int)stream26_0.Position + 8); stream26_0.WriteInt(0); stream26_0.WriteString(this.method_8(), stream26_0._reverseEndianness); stream26_0.WriteNBytes(0, 2); stream26_0.WriteNBytes(0, AbstractTreeNode1.smethod_0(stream26_0.Position)); } else { stream26_0.WriteInt(0); } int num = (int)stream26_0.Position; if (base.method_1().Nodes.IndexOf(this) < base.method_1().Nodes.Count - 1) { stream26_0.WriteIntAt(int_, num); } else { stream26_0.WriteIntAt(int_, 0); } stream26_0.Position = (long)num; }
public override void vmethod_14(Stream26 stream260) { if (vmethod_8()) { var array = new byte[4]; array[1] = 1; array[2] = 4; stream260.WriteByteArray(array, false); } else { var array2 = new byte[4]; array2[1] = (vmethod_7() ? (byte)132 : (byte)9); stream260.WriteByteArray(array2, false); } stream260.WriteInt(Int0); var int_ = (int)stream260.Position + 4; if (Nodes.Count != 0) { stream260.WriteInt((int)stream260.Position + 8); stream260.WriteInt(0); stream260.WriteString(method_8(), stream260.ReverseEndianness); stream260.WriteNBytes(0, 2); stream260.WriteNBytes(0, smethod_0(stream260.Position)); } else { stream260.WriteInt(0); } var num = (int)stream260.Position; if (method_1().Nodes.IndexOf(this) < method_1().Nodes.Count - 1) { stream260.WriteIntAt(int_, num); } else { stream260.WriteIntAt(int_, 0); } stream260.Position = num; }
public override void vmethod_13(Stream26 stream260) { Int0 = stream260.ReadInt(); var num = stream260.ReadInt(); var num2 = stream260.ReadInt(); if (num != 0) { Nodes.Add(new UnicodeValueNode(stream260.ReadUnicodeStringAt(num))); stream260.Position += smethod_0(stream260.Position); } if (num2 != 0) { var @class = (Parent is StructureHeaderNode) ? (Parent as StructureHeaderNode).method_11(stream260.ReadIntAt(num2)) : vmethod_12(stream260.ReadIntAt(num2, true)); method_1().Nodes.Add(@class); @class.method_4(stream260); } }
public override void vmethod_14(Stream26 stream260) { var array = new byte[4]; array[1] = (vmethod_7() ? (byte)32 : (byte)4); array[2] = 3; stream260.WriteByteArray(array, false); stream260.WriteInt(Int0); stream260.WriteInt(Int1); if (Nodes.Count != 0) { stream260.WriteInt((int)stream260.Position + 8); stream260.WriteInt(0); stream260.WriteString(method_7()); stream260.WriteByte2(0); stream260.WriteNBytes(0, smethod_0(stream260.Position)); return; } stream260.WriteNBytes(0, 8); }
public override void vmethod_14(Stream26 stream26_0) { byte[] array = new byte[4]; array[1] = 1; array[2] = this.vmethod_15(); stream26_0.WriteByteArray(array, false); stream26_0.WriteInt(base.Nodes.Count); if (base.Nodes.Count == 0) { return; } if (base.Nodes.Count > 1) { stream26_0.WriteInt((int)stream26_0.Position + 4); } foreach (AbstractTreeNode2 @class in base.Nodes) { stream26_0.WriteByteArray(@class.vmethod_8()); } }
public void method_1(string string_0) { using (Stream26 stream = new Stream26(File.Create(string_0 + "\\s000.d"))) { this.vmethod_1(stream); stream.WriteByte2(0); using (Stream26 stream2 = new Stream26(File.Create(string_0 + "\\toc.dat"))) { stream2.WriteInt(0); stream2.WriteByte2(4); stream2.WriteByte2(0); stream2.WriteByte2(0); stream2.WriteByte2(0); stream2.WriteUInt(3724414393u); stream2.WriteString("GH3Progress"); stream2.WriteNBytes(0, 7); stream2.WriteByte2(48); stream2.WriteByte2(0); stream2.WriteInt((int)stream.Length); stream.Position = 0L; stream2.WriteInt(KeyGenerator.GetQbKey(stream, true)); stream2.WriteNBytes(0, 40); stream2.WriteByte2(Convert.ToByte(DateTime.Now.Minute)); stream2.WriteByte2(0); stream2.WriteShort((short)DateTime.Now.Year); stream2.WriteByte2(Convert.ToByte(DateTime.Now.Second)); stream2.WriteByte2(Convert.ToByte(DateTime.Now.Month - 1)); stream2.WriteByte2(Convert.ToByte(DateTime.Now.Day)); stream2.WriteByte2(Convert.ToByte(DateTime.Now.Hour)); stream2.WriteNBytes(0, 15120); stream2.WriteInt(756937245); stream2.WriteNBytes(0, 12); stream2.Position = 4L; int num = KeyGenerator.GetQbKey(stream2, true); stream2.Position = 0L; stream2.WriteInt(num); stream.Position = stream.Length; stream.WriteNBytes(0, 5242880 - (int)stream.Length); } } }
public void method_16(string string_2) { Stream26 stream = this.method_17(); if (this.stream26_0 != null && this.string_0 == string_2) { this.stream26_0.Close(); } KeyGenerator.smethod_9(string_2, stream.ReadEverything()); stream.Dispose(); if (this.stream26_0 != null && this.string_0 == string_2) { if (this.class318_0 != null && this.class318_0 != this) { this.class318_0.vmethod_1(); } this.Dispose(); this.method_4(); GC.Collect(); } }
public override void vmethod_13(Stream26 stream260) { Int0 = stream260.ReadInt(); var num = stream260.ReadInt(); var num2 = stream260.ReadInt(); if (num != 0) { var @class = vmethod_12(stream260.ReadIntAt(num, true)); Nodes.Add(@class); @class.method_4(stream260); } if (num2 != 0) { var class2 = (Parent is StructureHeaderNode) ? (Parent as StructureHeaderNode).method_11(stream260.ReadIntAt(num2)) : vmethod_12(stream260.ReadIntAt(num2, true)); method_1().Nodes.Add(class2); class2.method_4(stream260); } }
public virtual void vmethod_0(Stream26 stream26_0) { this.byte_0 = stream26_0.ReadByte2(); if (this.byte_0 != 10) { throw new Exception(string.Concat(new object[] { "Unknown : ", this.byte_0, " at position : ", stream26_0.Position })); } this.int_0 = new int[] { stream26_0.ReadInt() }; while (stream26_0.Length > stream26_0.Position) { int num = (int)stream26_0.ReadByte2(); if (num == 10) { stream26_0.Position -= 1L; Class324 @class = new Class324(); @class.vmethod_0(stream26_0); this.list_0.Add(@class); } else { if (num == 0) { break; } stream26_0.Position -= 1L; zzStreamClass325 class2 = new zzStreamClass325(); class2.vmethod_0(stream26_0); this.list_0.Add(class2); } } }
public override void vmethod_14(Stream26 stream26_0) { this.vmethod_9(true); byte[] array = new byte[4]; array[1] = (this.vmethod_7() ? (byte)32 : (byte)4); array[2] = 28; stream26_0.WriteByteArray(array, false); stream26_0.WriteInt(this.int_0); stream26_0.WriteInt(this.int_1); if (base.Nodes.Count != 0) { stream26_0.WriteInt(this.method_8()); if (this.method_7() != null) { this.vmethod_10()[this.method_8()] = this.method_7(); } } else { stream26_0.WriteInt(0); } stream26_0.WriteInt(0); }
public void Initialize() { if (_fileName != null) { _fileStream = new Stream26(File.Open(_fileName, FileMode.Open, FileAccess.Read, FileShare.Read), true); } var num = 1; var num2 = _fileStream.ReadUShort(); var num3 = 0; if (num2 == 0xFACE) // Hey man he was in my face { _unkFlag0 = false; num = _fileStream.ReadShortAt(6); num3 = _fileStream.ReadInt(); } else if (num2 != 2600) // Appears to be flags at the beginning of certain types of texture metadata? { throw new Exception(); } while (num-- != 0) { TextureList.Add( new TextureMetadata( _fileStream.ReadShortAt(num3 + 2), _fileStream.ReadInt(), _fileStream.ReadShort(), _fileStream.ReadShort(), _fileStream.ReadShort(), _fileStream.ReadByteAt(num3 + 20), _fileStream.ReadShort(), _fileStream.ReadIntAt(num3 + 28), _fileStream.ReadInt())); num3 += 40; } _fileStream.ReverseEndianness = false; }
public void Initialize() { if (this._fileName != null) { this._fileStream = new Stream26(File.Open(this._fileName, FileMode.Open, FileAccess.Read, FileShare.Read), true); } int num = 1; ushort num2 = this._fileStream.ReadUShort(); int num3 = 0; if (num2 == 0xFACE) // Hey man he was in my face { this._unkFlag0 = false; num = (int)this._fileStream.ReadShortAt(6); num3 = this._fileStream.ReadInt(); } else if (num2 != 2600) { throw new Exception(); } while (num-- != 0) { this.textureList.Add( new TextureMetadata( this._fileStream.ReadShortAt(num3 + 2), this._fileStream.ReadInt(), this._fileStream.ReadShort(), this._fileStream.ReadShort(), this._fileStream.ReadShort(), this._fileStream.ReadByteAt(num3 + 20), this._fileStream.ReadShort(), this._fileStream.ReadIntAt(num3 + 28), this._fileStream.ReadInt())); num3 += 40; } this._fileStream._reverseEndianness = false; }
public override void vmethod_14(Stream26 stream260) { if (vmethod_8()) { var array = new byte[4]; array[1] = 1; array[2] = (byte)(vmethod_15() - 128); stream260.WriteByteArray(array, false); } else { var array2 = new byte[4]; array2[1] = vmethod_15(); stream260.WriteByteArray(array2, false); } stream260.WriteInt(Int0); stream260.WriteInt((Nodes.Count != 0) ? ((int)stream260.Position + 8) : 0); var int_ = (int)stream260.Position; stream260.WriteInt(0); foreach (AbstractTreeNode1 @class in Nodes) { @class.vmethod_14(stream260); } var num = (int)stream260.Position; if (method_1().Nodes.IndexOf(this) < method_1().Nodes.Count - 1) { stream260.WriteIntAt(int_, num); } else { stream260.WriteIntAt(int_, 0); } stream260.Position = num; }
public override void vmethod_13(Stream26 stream26_0) { int num = stream26_0.ReadInt(); if (num == 0) { return; } if (num > 1) { stream26_0.Position = (long)stream26_0.ReadInt(); } if (this is FloatArrayNode) { for (int i = 0; i < num; i++) { base.Nodes.Add(new FloatValueNode(stream26_0.ReadFloat())); } return; } if (this is IntegerArrayNode) { for (int j = 0; j < num; j++) { base.Nodes.Add(new IntegerValueNode(stream26_0.ReadInt())); } return; } if (this is TagArray || this is FileTagArrayNode) { for (int k = 0; k < num; k++) { base.Nodes.Add(new TagValueNode(stream26_0.ReadInt())); } } }
public override void vmethod_13(Stream26 stream260) { var num = stream260.ReadInt(); if (num == 0) { return; } if (num > 1) { stream260.Position = stream260.ReadInt(); } if (this is FloatArrayNode) { for (var i = 0; i < num; i++) { Nodes.Add(new FloatValueNode(stream260.ReadFloat())); } return; } if (this is IntegerArrayNode) { for (var j = 0; j < num; j++) { Nodes.Add(new IntegerValueNode(stream260.ReadInt())); } return; } if (this is TagArray || this is FileTagArrayNode) { for (var k = 0; k < num; k++) { Nodes.Add(new TagValueNode(stream260.ReadInt())); } } }
public override void vmethod_14(Stream26 stream260) { vmethod_9(true); var array = new byte[4]; array[1] = (vmethod_7() ? (byte)32 : (byte)4); array[2] = 28; stream260.WriteByteArray(array, false); stream260.WriteInt(Int0); stream260.WriteInt(Int1); if (Nodes.Count != 0) { stream260.WriteInt(method_8()); if (method_7() != null) { vmethod_10()[method_8()] = method_7(); } } else { stream260.WriteInt(0); } stream260.WriteInt(0); }
public override void vmethod_14(Stream26 stream26_0) { if (this.vmethod_8()) { byte[] array = new byte[4]; array[1] = 1; array[2] = (byte)(this.vmethod_15() - 128); stream26_0.WriteByteArray(array, false); } else { byte[] array2 = new byte[4]; array2[1] = this.vmethod_15(); stream26_0.WriteByteArray(array2, false); } stream26_0.WriteInt(this.int_0); stream26_0.WriteInt((base.Nodes.Count != 0) ? ((int)stream26_0.Position + 8) : 0); int int_ = (int)stream26_0.Position; stream26_0.WriteInt(0); foreach (AbstractTreeNode1 @class in base.Nodes) { @class.vmethod_14(stream26_0); } int num = (int)stream26_0.Position; if (base.method_1().Nodes.IndexOf(this) < base.method_1().Nodes.Count - 1) { stream26_0.WriteIntAt(int_, num); } else { stream26_0.WriteIntAt(int_, 0); } stream26_0.Position = (long)num; }
public override void vmethod_13(Stream26 stream26_0) { this.int_0 = stream26_0.ReadInt(); if (this is FloatStructureNode) { base.Nodes.Add(new FloatValueNode(stream26_0.ReadFloat())); } else if (this is IntegerStructureNode) { base.Nodes.Add(new IntegerValueNode(stream26_0.ReadInt())); } else if (this is TagStructureNode || this is FileTagStructureNode) { base.Nodes.Add(new TagValueNode(stream26_0.ReadInt())); } int num = stream26_0.ReadInt(); if (num != 0) { AbstractTreeNode1 @class = (base.Parent is StructureHeaderNode) ? (base.Parent as StructureHeaderNode).method_11(stream26_0.ReadIntAt(num)) : this.vmethod_12(stream26_0.ReadIntAt(num, true)); base.method_1().Nodes.Add(@class); @class.method_4(stream26_0); } }
private void method_19() { if (String1 != null) { Class3180 = new ZzPakNode2(String1, false); } using (var stream = new Stream26(File.Open(String0, FileMode.Open, FileAccess.Read, FileShare.Read))) { var num = 0; var num2 = (int)stream.Length; if (num2 == 0) { throw new Exception("Pak File is empty!"); } var int_ = stream.ReadInt(); stream.ReverseEndianness = (Bool2 = (!QbSongClass1.ContainsKey(int_) || !QbSongClass1.GetDictString(int_).StartsWith("."))); Bool3 = (stream.ReadInt() < stream.Length); var @enum = (Enum35)stream.ReadIntAt(28); Bool1 = ((@enum & Enum35.Flag3) == Enum35.Flag0); Int0 = stream.ReadIntAt(Bool1 ? 12 : 16, Bool2 && (@enum & Enum35.Flag4) == Enum35.Flag0 && (@enum & Enum35.Flag5) == Enum35.Flag0); while (true) { var enum2 = (Enum35)stream.ReadIntAt(num + 28, false); var bool_ = Bool2 && (enum2 & Enum35.Flag4) == Enum35.Flag0 && (enum2 & Enum35.Flag5) == Enum35.Flag0; var num3 = stream.ReadIntAt(num, bool_); if (QbSongClass1.ContainsKey(num3) && (QbSongClass1.GetDictString(num3).Equals(".last") || QbSongClass1.GetDictString(num3).Equals("last"))) { break; } var num4 = stream.ReadInt(bool_); if (!Bool3) { num4 = num4 - num2 + num; } if (num4 < 0) { num4 = 0; } var int2 = stream.ReadInt(bool_); var num5 = stream.ReadIntAt(num + (Bool1 ? 16 : 12), bool_); var num6 = stream.ReadIntAt(num + 20, bool_); var int3 = stream.ReadInt(bool_); stream.Position += 4L; if ((enum2 & Enum35.Flag3) != Enum35.Flag0) { Bool1 = false; var text = Stream260.ReadString(160); var num7 = text.IndexOf('\0'); if (num7 >= 0) { text = text.Substring(0, num7); } if (QbSongClass1.ContainsKey(num3) && !QbSongClass1.GetDictString(num3).EndsWith(".qb.ngc") && !QbSongClass1.GetDictString(num3).EndsWith(".qb.ps2")) { if (!Bool2) { if (num5 == KeyGenerator.GetQbKey(text = text.Replace("/", "\\").Replace(".ps2", ""), true)) { QbSongClass1.AddKeyToDictionary(text); } else if (num5 == KeyGenerator.GetQbKey( text = text.Replace("/", "\\").Replace(".qb", ""), true)) { QbSongClass1.AddKeyToDictionary(text); } } else if (num5 == KeyGenerator.GetQbKey(text = text.Replace("/", "\\").Replace(".ngc", ""), true)) { QbSongClass1.AddKeyToDictionary(text); } else if (num5 == KeyGenerator.GetQbKey(text = text.Replace("/", "\\").Replace(".qb", ""), true)) { QbSongClass1.AddKeyToDictionary(text); } } else { var text2 = "abcdefghijklmnopqrstuvwxyz"; for (var i = 0; i < text2.Length; i++) { var c = text2[i]; if (num5 == KeyGenerator.GetQbKey(c + text, true)) { QbSongClass1.AddKeyToDictionary(c + text); } } } if (num6 == KeyGenerator.GetQbKey(text = KeyGenerator.GetFileNameNoExt(text), true)) { QbSongClass1.AddKeyToDictionary(text); } } TreeNode treeNode; if (QbSongClass1.ContainsKey(num3) && QbSongClass1.GetDictString(num3).EndsWith("qb")) { treeNode = new Class309(num3, num4, int2, num5, num6, int3, enum2); } else if (QbSongClass1.ContainsKey(num3) && QbSongClass1.GetDictString(num3).Contains("qs")) { treeNode = new Class328(num3, num4, int2, num5, num6, int3, enum2); } else { treeNode = new ZzCocoaNode12(num3, num4, int2, num5, num6, int3, enum2); } if (QbSongClass1.ContainsKey(num5)) { method_1(QbSongClass1.GetDictString(num5), treeNode); } else { method_5(num5, (INterface12)treeNode); } num += (((enum2 & Enum35.Flag3) != Enum35.Flag0) ? 192 : 32); } } Stream260 = new Stream26(File.Open(String2, FileMode.Open, FileAccess.Read, FileShare.Read)); if (Stream260.Length == 0L) { throw new Exception("Pab File is empty!"); } }
public TexFile(byte[] byte_0) { this._fileStream = new Stream26(byte_0, true); this.Initialize(); }
private void method_4() { if (Stream260 == null) { Stream260 = new Stream26(File.Open(String0, FileMode.Open, FileAccess.Read, FileShare.Read)); } Class3180 = ((String1 != null) ? new ZzPakNode2(String1, false) : this); if (Stream260.Length == 0L) { throw new Exception("Pak File is empty!"); } var num = 0; var num2 = Stream260.ReadInt(); Stream260.ReverseEndianness = (Bool2 = (!QbSongClass1.ContainsKey(num2) || !QbSongClass1.GetDictString(num2).StartsWith("."))); var @enum = (Enum35)Stream260.ReadIntAt(28); Bool1 = ((@enum & Enum35.Flag3) == Enum35.Flag0); Int0 = Stream260.ReadIntAt(Bool1 ? 12 : 16, Bool2 && (@enum & Enum35.Flag4) == Enum35.Flag0 && (@enum & Enum35.Flag5) == Enum35.Flag0); if (Bool4 && String0 != null) { var text = KeyGenerator.GetFileName(String0); if (text.Contains("_song")) { QbSongClass1.GenerateSongTrackStuff(text.Substring(0, text.LastIndexOf("_song.pak")).ToLower()); } else if (!Bool1) { QbSongClass1.GenerateSongTrackStuff(text.Substring(0, text.LastIndexOf(".pak")).ToLower()); } } while (true) { var enum2 = (Enum35)Stream260.ReadIntAt(num + 28); var flag = Bool2 && (enum2 & Enum35.Flag4) == Enum35.Flag0 && (enum2 & Enum35.Flag5) == Enum35.Flag0; var int_ = Stream260.ReadIntAt(num, flag); if (QbSongClass1.ContainsKey(int_)) { if (QbSongClass1.GetDictString(int_).Equals(".last")) { return; } if (QbSongClass1.GetDictString(int_).Equals("last")) { break; } } var int2 = Stream260.ReadInt(flag) + num; var int3 = Stream260.ReadInt(flag); var num3 = Stream260.ReadIntAt(num + (Bool1 ? 16 : 12), flag); var num4 = Stream260.ReadIntAt(num + 20, flag); var int4 = Stream260.ReadInt(flag); Stream260.Position += 4L; if ((enum2 & Enum35.Flag3) != Enum35.Flag0) { Bool1 = false; var text2 = Stream260.ReadString(160); var num5 = text2.IndexOf('\0'); if (num5 >= 0) { text2 = text2.Substring(0, num5); } if (QbSongClass1.ContainsKey(int_) && !QbSongClass1.GetDictString(int_).EndsWith(".qb.ngc") && !QbSongClass1.GetDictString(int_).EndsWith(".qb.ps2")) { if (!Bool2) { if (num3 == KeyGenerator.GetQbKey(text2 = text2.Replace("/", "\\").Replace(".ps2", ""), true)) { QbSongClass1.AddKeyToDictionary(text2); } else if (num3 == KeyGenerator.GetQbKey(text2 = text2.Replace("/", "\\").Replace(".qb", ""), true)) { QbSongClass1.AddKeyToDictionary(text2); } } else if (num3 == KeyGenerator.GetQbKey(text2 = text2.Replace("/", "\\").Replace(".ngc", ""), true)) { QbSongClass1.AddKeyToDictionary(text2); } else if (num3 == KeyGenerator.GetQbKey(text2 = text2.Replace("/", "\\").Replace(".qb", ""), true)) { QbSongClass1.AddKeyToDictionary(text2); } } else { var text3 = "abcdefghijklmnopqrstuvwxyz"; for (var i = 0; i < text3.Length; i++) { var c = text3[i]; if (num3 == KeyGenerator.GetQbKey(c + text2, true)) { QbSongClass1.AddKeyToDictionary(c + text2); } } } if (num4 == KeyGenerator.GetQbKey(text2 = KeyGenerator.GetFileNameNoExt(text2), true)) { QbSongClass1.AddKeyToDictionary(text2); } } TreeNode treeNode; if (QbSongClass1.ContainsKey(int_) && QbSongClass1.GetDictString(int_).Contains("qb")) { treeNode = new Class309(int_, int2, int3, num3, num4, int4, enum2); } else if (QbSongClass1.ContainsKey(int_) && QbSongClass1.GetDictString(int_).Contains("qs")) { treeNode = new Class328(int_, int2, int3, num3, num4, int4, enum2); } else { treeNode = new ZzCocoaNode12(int_, int2, int3, num3, num4, int4, enum2); } if (Bool4) { if (QbSongClass1.ContainsKey(num3)) { method_1(QbSongClass1.GetDictString(num3), treeNode); } else { method_5(num3, (INterface12)treeNode); } } else { List0.Add((INterface12)treeNode); } num += (((enum2 & Enum35.Flag3) != Enum35.Flag0) ? 192 : 32); } }
private void method_19() { if (this.string_1 != null) { this.class318_0 = new zzPakNode2(this.string_1, false); } using (Stream26 stream = new Stream26(File.Open(this.string_0, FileMode.Open, FileAccess.Read, FileShare.Read))) { int num = 0; int num2 = (int)stream.Length; if (num2 == 0) { throw new Exception("Pak File is empty!"); } int int_ = stream.ReadInt(); stream._reverseEndianness = (this.bool_2 = (!QbSongClass1.smethod_3(int_) || !QbSongClass1.smethod_5(int_).StartsWith("."))); this.bool_3 = ((long)stream.ReadInt() < stream.Length); Enum35 @enum = (Enum35)stream.ReadIntAt(28); this.bool_1 = ((@enum & Enum35.flag_3) == Enum35.flag_0); this.int_0 = stream.ReadIntAt(this.bool_1 ? 12 : 16, this.bool_2 && (@enum & Enum35.flag_4) == Enum35.flag_0 && (@enum & Enum35.flag_5) == Enum35.flag_0); while (true) { Enum35 enum2 = (Enum35)stream.ReadIntAt(num + 28, false); bool bool_ = this.bool_2 && (enum2 & Enum35.flag_4) == Enum35.flag_0 && (enum2 & Enum35.flag_5) == Enum35.flag_0; int num3 = stream.ReadIntAt(num, bool_); if (QbSongClass1.smethod_3(num3) && (QbSongClass1.smethod_5(num3).Equals(".last") || QbSongClass1.smethod_5(num3).Equals("last"))) { break; } int num4 = stream.ReadInt(bool_); if (!this.bool_3) { num4 = num4 - num2 + num; } if (num4 < 0) { num4 = 0; } int int_2 = stream.ReadInt(bool_); int num5 = stream.ReadIntAt(num + (this.bool_1 ? 16 : 12), bool_); int num6 = stream.ReadIntAt(num + 20, bool_); int int_3 = stream.ReadInt(bool_); stream.Position += 4L; if ((enum2 & Enum35.flag_3) != Enum35.flag_0) { this.bool_1 = false; string text = this.stream26_0.ReadString(160); int num7 = text.IndexOf('\0'); if (num7 >= 0) { text = text.Substring(0, num7); } if (QbSongClass1.smethod_3(num3) && !QbSongClass1.smethod_5(num3).EndsWith(".qb.ngc") && !QbSongClass1.smethod_5(num3).EndsWith(".qb.ps2")) { if (!this.bool_2) { if (num5 == KeyGenerator.GetQbKey(text = text.Replace("/", "\\").Replace(".ps2", ""), true)) { QbSongClass1.smethod_9(text); } else if (num5 == KeyGenerator.GetQbKey(text = text.Replace("/", "\\").Replace(".qb", ""), true)) { QbSongClass1.smethod_9(text); } } else if (num5 == KeyGenerator.GetQbKey(text = text.Replace("/", "\\").Replace(".ngc", ""), true)) { QbSongClass1.smethod_9(text); } else if (num5 == KeyGenerator.GetQbKey(text = text.Replace("/", "\\").Replace(".qb", ""), true)) { QbSongClass1.smethod_9(text); } } else { string text2 = "abcdefghijklmnopqrstuvwxyz"; for (int i = 0; i < text2.Length; i++) { char c = text2[i]; if (num5 == KeyGenerator.GetQbKey(c + text, true)) { QbSongClass1.smethod_9(c + text); } } } if (num6 == KeyGenerator.GetQbKey(text = KeyGenerator.GetFileNameNoExt(text), true)) { QbSongClass1.smethod_9(text); } } TreeNode treeNode; if (QbSongClass1.smethod_3(num3) && QbSongClass1.smethod_5(num3).EndsWith("qb")) { treeNode = new Class309(num3, num4, int_2, num5, num6, int_3, enum2); } else if (QbSongClass1.smethod_3(num3) && QbSongClass1.smethod_5(num3).Contains("qs")) { treeNode = new Class328(num3, num4, int_2, num5, num6, int_3, enum2); } else { treeNode = new zzCocoaNode12(num3, num4, int_2, num5, num6, int_3, enum2); } if (QbSongClass1.smethod_3(num5)) { base.method_1 <TreeNode>(QbSongClass1.smethod_5(num5), treeNode); } else { base.method_5(num5, (Interface12)treeNode); } num += (((enum2 & Enum35.flag_3) != Enum35.flag_0) ? 192 : 32); } } this.stream26_0 = new Stream26(File.Open(this.string_2, FileMode.Open, FileAccess.Read, FileShare.Read)); if (this.stream26_0.Length == 0L) { throw new Exception("Pab File is empty!"); } }
public ZzGenericNode1(string string0, Stream26 stream260) { Text = KeyGenerator.GetFileName(string0); stream260.Position = 28L; method_4(stream260); }
public void method_4(Stream26 stream260) { vmethod_13(stream260); vmethod_0(); }
public abstract void vmethod_14(Stream26 stream260);
public void method_18(Stream26 stream26_1, Stream26 stream26_2) { int num = 0; foreach (Interface12 current in this.list_0) { num += (((current.imethod_14() & Enum35.flag_3) == Enum35.flag_0 || !QbSongClass1.smethod_3(current.imethod_7())) ? 32 : 192); } if (this.bool_1) { num = (num + 32 + 4095 & -4096); } else { num += (this.bool_2 ? 64 : 48); } int num2 = 0; List <Interface12> list = new List <Interface12>(); foreach (Interface12 current2 in this.list_0) { if (current2 is Class309 && (current2 as Class309).vmethod_8()) { string string_ = current2.imethod_9().Replace(".qb", ".qs"); if (!this.class318_0.method_6(string_)) { if (!current2.imethod_18()) { list.Add(new Class328(string_, (current2 as Class309).vmethod_10())); } else { list.Add(new Class328(string_)); } } else { Interface12 @interface = this.class318_0.method_10(string_); if (@interface.imethod_18() || ((Class328)@interface).dictionary_0 != (current2 as Class309).vmethod_10()) { ((Class328)@interface).dictionary_0 = (current2 as Class309).vmethod_10(); } } } } if (list.Count != 0) { this.class318_0.list_0.AddRange(list); } int num4; foreach (Interface12 current3 in this.list_0) { bool flag = this.bool_2 && (current3.imethod_14() & Enum35.flag_4) == Enum35.flag_0 && (current3.imethod_14() & Enum35.flag_5) == Enum35.flag_0; int num3 = current3.imethod_7(); if (current3.imethod_4() != 0) { stream26_1.WriteInt(current3.imethod_4(), flag); } else { string text = QbSongClass1.smethod_5(num3); if (!this.bool_1 && !text.EndsWith(".qb.ngc") && !text.EndsWith(".qb.ps2")) { stream26_1.WriteInt(1270999134, flag); } else if (text.Contains(".qb")) { stream26_1.WriteUInt(2817852868u, flag); } else { stream26_1.WriteInt(1952304453, flag); } } if (this is zzPabNode && this.bool_3) { stream26_1.WriteInt((int)stream26_2.Length, flag); } else { stream26_1.WriteInt(num - num2 + (int)stream26_2.Length, flag); } stream26_1.WriteInt(current3.imethod_2(), flag); if (this.bool_1) { stream26_1.WriteInt(this.int_0, flag); } stream26_1.WriteInt(num3, flag); if (!this.bool_1) { stream26_1.WriteInt(this.int_0, flag); } stream26_1.WriteInt(current3.imethod_10(), flag); stream26_1.WriteInt(current3.imethod_12(), flag); stream26_1.WriteInt((int)current3.imethod_14(), false); bool flag2 = false; if ((current3.imethod_14() & Enum35.flag_3) != Enum35.flag_0 && QbSongClass1.smethod_3(num3)) { flag2 = true; string text2 = QbSongClass1.smethod_5(num3); if (!current3.imethod_6().EndsWith(".qb.ngc") && !current3.imethod_6().EndsWith(".qb.ps2")) { if (this.bool_1) { text2 = text2.Replace("\\", "/"); } else if (!this.bool_2) { text2 = text2.Replace("\\", "/") + (current3.imethod_6().EndsWith(".qb") ? "" : ".qb") + ".ps2"; } else { text2 = text2.Replace("\\", "/") + (current3.imethod_6().EndsWith(".qb") ? "" : ".qb") + ".ngc"; } } else { text2 = text2.Substring(1); } stream26_1.WriteString(text2); stream26_1.WriteNBytes(0, 160 - text2.Length); } stream26_2.WriteByteArray(this.method_14(current3)); num4 = ((this.bool_2 || this.bool_1) ? zzPakNode2.smethod_0(stream26_2.Length, 5) : zzPakNode2.smethod_0(stream26_2.Length, 4)); stream26_2.WriteNBytes(0, num4); num2 += (flag2 ? 192 : 32); } stream26_1.WriteUInt(this.bool_1 ? 749989691u : 3039057503u); if (this is zzPabNode && this.bool_3) { stream26_1.WriteInt((int)stream26_2.Length); } else { stream26_1.WriteInt(num - num2 + (int)stream26_2.Length); } stream26_1.WriteInt(4); if (this.bool_1) { stream26_1.WriteInt(this.int_0); stream26_1.WriteUInt(2306521930u); stream26_1.WriteInt(1794739921); stream26_1.WriteNBytes(0, 8); } else { stream26_1.WriteNBytes(0, 4); stream26_1.WriteInt(this.int_0); stream26_1.WriteNBytes(0, 12); } num4 = (this.bool_1 ? zzPakNode2.smethod_0(stream26_1.Length, 12) : (this.bool_2 ? 32 : 16)); stream26_1.WriteNBytes(0, num4); stream26_2.WriteNBytes(171, 4); stream26_2.WriteNBytes(0, 12); num4 = (this.bool_1 ? zzPakNode2.smethod_0(stream26_2.Length, 12) : ((int)stream26_2.Length % (this.bool_2 ? 32 : 16))); stream26_2.WriteNBytes(171, num4); }
public TexFile(byte[] byte0) { _fileStream = new Stream26(byte0, true); Initialize(); }
private void method_4() { if (this.stream26_0 == null) { this.stream26_0 = new Stream26(File.Open(this.string_0, FileMode.Open, FileAccess.Read, FileShare.Read)); } this.class318_0 = ((this.string_1 != null) ? new zzPakNode2(this.string_1, false) : this); if (this.stream26_0.Length == 0L) { throw new Exception("Pak File is empty!"); } int num = 0; int num2 = this.stream26_0.ReadInt(); this.stream26_0._reverseEndianness = (this.bool_2 = (!QbSongClass1.smethod_3(num2) || !QbSongClass1.smethod_5(num2).StartsWith("."))); Enum35 @enum = (Enum35)this.stream26_0.ReadIntAt(28); this.bool_1 = ((@enum & Enum35.flag_3) == Enum35.flag_0); this.int_0 = this.stream26_0.ReadIntAt(this.bool_1 ? 12 : 16, this.bool_2 && (@enum & Enum35.flag_4) == Enum35.flag_0 && (@enum & Enum35.flag_5) == Enum35.flag_0); if (this.bool_4 && this.string_0 != null) { string text = KeyGenerator.GetFileName(this.string_0); if (text.Contains("_song")) { QbSongClass1.smethod_10(text.Substring(0, text.LastIndexOf("_song.pak")).ToLower()); } else if (!this.bool_1) { QbSongClass1.smethod_10(text.Substring(0, text.LastIndexOf(".pak")).ToLower()); } } while (true) { Enum35 enum2 = (Enum35)this.stream26_0.ReadIntAt(num + 28); bool flag = this.bool_2 && (enum2 & Enum35.flag_4) == Enum35.flag_0 && (enum2 & Enum35.flag_5) == Enum35.flag_0; int int_ = this.stream26_0.ReadIntAt(num, flag); if (QbSongClass1.smethod_3(int_)) { if (QbSongClass1.smethod_5(int_).Equals(".last")) { return; } if (QbSongClass1.smethod_5(int_).Equals("last")) { break; } } int int_2 = this.stream26_0.ReadInt(flag) + num; int int_3 = this.stream26_0.ReadInt(flag); int num3 = this.stream26_0.ReadIntAt(num + (this.bool_1 ? 16 : 12), flag); int num4 = this.stream26_0.ReadIntAt(num + 20, flag); int int_4 = this.stream26_0.ReadInt(flag); this.stream26_0.Position += 4L; if ((enum2 & Enum35.flag_3) != Enum35.flag_0) { this.bool_1 = false; string text2 = this.stream26_0.ReadString(160); int num5 = text2.IndexOf('\0'); if (num5 >= 0) { text2 = text2.Substring(0, num5); } if (QbSongClass1.smethod_3(int_) && !QbSongClass1.smethod_5(int_).EndsWith(".qb.ngc") && !QbSongClass1.smethod_5(int_).EndsWith(".qb.ps2")) { if (!this.bool_2) { if (num3 == KeyGenerator.GetQbKey(text2 = text2.Replace("/", "\\").Replace(".ps2", ""), true)) { QbSongClass1.smethod_9(text2); } else if (num3 == KeyGenerator.GetQbKey(text2 = text2.Replace("/", "\\").Replace(".qb", ""), true)) { QbSongClass1.smethod_9(text2); } } else if (num3 == KeyGenerator.GetQbKey(text2 = text2.Replace("/", "\\").Replace(".ngc", ""), true)) { QbSongClass1.smethod_9(text2); } else if (num3 == KeyGenerator.GetQbKey(text2 = text2.Replace("/", "\\").Replace(".qb", ""), true)) { QbSongClass1.smethod_9(text2); } } else { string text3 = "abcdefghijklmnopqrstuvwxyz"; for (int i = 0; i < text3.Length; i++) { char c = text3[i]; if (num3 == KeyGenerator.GetQbKey(c + text2, true)) { QbSongClass1.smethod_9(c + text2); } } } if (num4 == KeyGenerator.GetQbKey(text2 = KeyGenerator.GetFileNameNoExt(text2), true)) { QbSongClass1.smethod_9(text2); } } TreeNode treeNode; if (QbSongClass1.smethod_3(int_) && QbSongClass1.smethod_5(int_).Contains("qb")) { treeNode = new Class309(int_, int_2, int_3, num3, num4, int_4, enum2); } else if (QbSongClass1.smethod_3(int_) && QbSongClass1.smethod_5(int_).Contains("qs")) { treeNode = new Class328(int_, int_2, int_3, num3, num4, int_4, enum2); } else { treeNode = new zzCocoaNode12(int_, int_2, int_3, num3, num4, int_4, enum2); } if (this.bool_4) { if (QbSongClass1.smethod_3(num3)) { base.method_1 <TreeNode>(QbSongClass1.smethod_5(num3), treeNode); } else { this.method_5(num3, (Interface12)treeNode); } } else { this.list_0.Add((Interface12)treeNode); } num += (((enum2 & Enum35.flag_3) != Enum35.flag_0) ? 192 : 32); } }