示例#1
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] = this.vmethod_16();
     stream26_0.WriteByteArray(array, false);
     stream26_0.WriteInt(this.int_0);
     stream26_0.WriteInt(this.int_1);
     if (base.Nodes.Count != 0)
     {
         IEnumerator enumerator = base.Nodes.GetEnumerator();
         try
         {
             while (enumerator.MoveNext())
             {
                 AbstractTreeNode2 @class = (AbstractTreeNode2)enumerator.Current;
                 stream26_0.WriteByteArray(@class.vmethod_8());
             }
             goto IL_97;
         }
         finally
         {
             IDisposable disposable = enumerator as IDisposable;
             if (disposable != null)
             {
                 disposable.Dispose();
             }
         }
     }
     stream26_0.WriteInt(0);
     IL_97:
     stream26_0.WriteInt(0);
 }
示例#2
0
 public override void vmethod_13(Stream26 stream26_0)
 {
     int num = stream26_0.ReadInt();
     if (num == 0)
     {
         return;
     }
     int[] array = new int[num];
     if (num > 1)
     {
         stream26_0.Position = (long)stream26_0.ReadInt();
         for (int i = 0; i < num; i++)
         {
             array[i] = stream26_0.ReadInt();
         }
     }
     else
     {
         array[0] = stream26_0.ReadInt();
     }
     int[] array2 = array;
     for (int j = 0; j < array2.Length; j++)
     {
         int int_ = array2[j];
         AbstractTreeNode1 @class = this.vmethod_12(stream26_0.ReadIntAt(int_, true));
         base.Nodes.Add(@class);
         @class.method_4(stream26_0);
     }
 }
示例#3
0
 public override void vmethod_13(Stream26 stream26_0)
 {
     this.int_0 = stream26_0.ReadInt();
     this.int_1 = stream26_0.ReadInt();
     base.Nodes.Add(new TextValueNode(stream26_0.ReadInt(), this.vmethod_10()));
     stream26_0.ReadInt();
 }
示例#4
0
 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);
     }
     int int_ = (int)stream26_0.Position;
     List<int> list = new List<int>(base.Nodes.Count);
     stream26_0.WriteNBytes(0, 4 * base.Nodes.Count);
     foreach (AbstractTreeNode1 @class in base.Nodes)
     {
         list.Add((int)stream26_0.Position);
         @class.vmethod_14(stream26_0);
     }
     int num = (int)stream26_0.Position;
     stream26_0.WriteEnumerableIntsAt(int_, list);
     stream26_0.Position = (long)num;
 }
示例#5
0
 public override void vmethod_14(Stream26 stream26_0)
 {
     this.vmethod_9(true);
     byte[] array = new byte[4];
     array[1] = 1;
     array[2] = 28;
     stream26_0.WriteByteArray(array, false);
     stream26_0.WriteInt(this.int_0);
     if (base.Nodes.Count != 0)
     {
         stream26_0.WriteInt(this.method_9());
         if (this.method_8() != null)
         {
             this.vmethod_10()[this.method_9()] = this.method_8();
         }
     }
     else
     {
         stream26_0.WriteInt(0);
     }
     if (base.method_1().Nodes.IndexOf(this) < base.method_1().Nodes.Count - 1)
     {
         stream26_0.WriteInt((int)stream26_0.Position + 4);
         return;
     }
     stream26_0.WriteInt(0);
 }
示例#6
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;
 }
示例#7
0
 public void Dispose()
 {
     this._fileStream.Close();
     this._fileStream.Dispose();
     this._fileStream = null;
     this.textureList.Clear();
 }
示例#8
0
 public override void vmethod_13(Stream26 stream26_0)
 {
     this.int_0 = stream26_0.ReadInt();
     base.Nodes.Add(new TextValueNode(stream26_0.ReadInt(), this.vmethod_10()));
     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);
     }
 }
示例#9
0
 public override void vmethod_13(Stream26 stream26_0)
 {
     this.int_0 = stream26_0.ReadInt();
     this.int_1 = stream26_0.ReadInt();
     int num = stream26_0.ReadInt();
     stream26_0.ReadInt();
     if (num != 0)
     {
         base.Nodes.Add(new UnicodeValueNode(stream26_0.ReadUnicodeStringAt(num)));
         stream26_0.Position += (long)AbstractTreeNode1.smethod_0(stream26_0.Position);
     }
 }
示例#10
0
 public override void vmethod_13(Stream26 stream26_0)
 {
     this.int_0 = stream26_0.ReadInt();
     this.int_1 = stream26_0.ReadInt();
     int num = stream26_0.ReadInt();
     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);
     }
 }
示例#11
0
 public override void vmethod_13(Stream26 stream26_0)
 {
     this.int_0 = stream26_0.ReadInt();
     this.int_1 = stream26_0.ReadInt();
     int num = stream26_0.ReadInt();
     stream26_0.ReadInt();
     if (num != 0)
     {
         stream26_0.Position = (long)num;
         QbScriptNode @class = new QbScriptNode();
         base.Nodes.Add(@class);
         @class.method_4(stream26_0);
     }
 }
示例#12
0
 public override void vmethod_14(Stream26 stream26_0)
 {
     byte[] array = new byte[4];
     array[1] = (byte)(this.vmethod_7() ? 32 : 4);
     array[2] = 7;
     stream26_0.WriteByteArray(array, false);
     stream26_0.WriteInt(this.int_0);
     stream26_0.WriteInt(this.int_1);
     stream26_0.WriteInt((base.Nodes.Count != 0) ? ((int)stream26_0.Position + 8) : 0);
     stream26_0.WriteInt(0);
     foreach (AbstractTreeNode1 @class in base.Nodes)
     {
         @class.vmethod_14(stream26_0);
     }
 }
示例#13
0
 public override void vmethod_0(Stream26 stream26_0)
 {
     this.byte_0 = stream26_0.ReadByte2();
     this.int_0 = new int[]
     {
         stream26_0.ReadInt()
     };
     byte byte_ = this.byte_0;
     switch (byte_)
     {
     case 1:
         this.object_0 = stream26_0.ReadInt();
         return;
     case 2:
         this.object_0 = stream26_0.ReadFloat();
         return;
     case 3:
         break;
     case 4:
         this.object_0 = stream26_0.ReadUnicodeString();
         return;
     default:
         switch (byte_)
         {
         case 13:
             this.int_0 = new int[]
             {
                 this.int_0[0],
                 stream26_0.ReadInt()
             };
             return;
         case 14:
         case 16:
             this.object_0 = stream26_0.ReadByte2();
             return;
         case 15:
             break;
         case 17:
             this.object_0 = stream26_0.ReadShort();
             break;
         default:
             return;
         }
         break;
     }
 }
示例#14
0
 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)
     {
         base.Nodes.Add(new AsciiValueNode(stream26_0.ReadAsciiStringAt(num)));
         stream26_0.Position += (long)AbstractTreeNode1.smethod_0(stream26_0.Position);
     }
     if (num2 != 0)
     {
         AbstractTreeNode1 @class = (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(@class);
         @class.method_4(stream26_0);
     }
 }
示例#15
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);
     if (base.Nodes.Count != 0)
     {
         IEnumerator enumerator = base.Nodes.GetEnumerator();
         try
         {
             while (enumerator.MoveNext())
             {
                 AbstractTreeNode2 @class = (AbstractTreeNode2)enumerator.Current;
                 stream26_0.WriteByteArray(@class.vmethod_8());
             }
             goto IL_AA;
         }
         finally
         {
             IDisposable disposable = enumerator as IDisposable;
             if (disposable != null)
             {
                 disposable.Dispose();
             }
         }
     }
     stream26_0.WriteInt(0);
     IL_AA:
     if (base.method_1().Nodes.IndexOf(this) < base.method_1().Nodes.Count - 1)
     {
         stream26_0.WriteInt((int)stream26_0.Position + 4);
         return;
     }
     stream26_0.WriteInt(0);
 }
示例#16
0
 public override void vmethod_13(Stream26 stream26_0)
 {
     this.int_0 = stream26_0.ReadInt();
     this.int_1 = stream26_0.ReadInt();
     if (this is FloatRootNode)
     {
         base.Nodes.Add(new FloatValueNode(stream26_0.ReadFloat()));
     }
     else if (this is IntegerRootNode)
     {
         base.Nodes.Add(new IntegerValueNode(stream26_0.ReadInt()));
     }
     else if (this is TagRootNode || this is FileTagRootNode)
     {
         base.Nodes.Add(new TagValueNode(stream26_0.ReadInt()));
     }
     stream26_0.ReadInt();
 }
示例#17
0
 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);
     }
 }
示例#18
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);
 }
示例#19
0
 public override void vmethod_1(Stream26 stream26_0)
 {
     stream26_0.WriteByte2(this.byte_0);
     stream26_0.WriteInt(this.int_0[0]);
     byte byte_ = this.byte_0;
     switch (byte_)
     {
     case 1:
         stream26_0.WriteInt((int)this.object_0);
         return;
     case 2:
         stream26_0.WriteFloat((float)this.object_0);
         return;
     case 3:
         break;
     case 4:
         stream26_0.WriteString((string)this.object_0, false);
         stream26_0.WriteByte2(0);
         stream26_0.WriteByte2(0);
         return;
     default:
         switch (byte_)
         {
         case 13:
             stream26_0.WriteInt(this.int_0[1]);
             return;
         case 14:
         case 16:
             stream26_0.WriteByte2((byte)this.object_0);
             return;
         case 15:
             break;
         case 17:
             stream26_0.WriteShort((short)this.object_0);
             break;
         default:
             return;
         }
         break;
     }
 }
示例#20
0
 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);
         }
     }
 }
示例#21
0
 public override void vmethod_14(Stream26 stream26_0)
 {
     if (this.vmethod_8())
     {
         byte[] array = new byte[4];
         array[1] = 1;
         array[2] = 3;
         stream26_0.WriteByteArray(array, false);
     }
     else
     {
         byte[] array2 = new byte[4];
         array2[1] = (byte)(this.vmethod_7() ? 131 : 7);
         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.WriteByte2(0);
         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;
 }
示例#22
0
 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);
 }
示例#23
0
 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);
     }
 }
示例#24
0
 public void method_20(string string_3, string string_4)
 {
     Stream26 stream = new Stream26(this.bool_2);
     Stream26 stream2 = new Stream26();
     base.method_18(stream, stream2);
     if (this.stream26_0 != null && this.string_0 == string_3 && this.string_2 == string_4)
     {
         this.stream26_0.Close();
     }
     KeyGenerator.smethod_9(string_4, stream2.ReadEverything());
     KeyGenerator.smethod_9(string_3, stream.ReadEverything());
     stream.Dispose();
     stream2.Dispose();
     if (this.stream26_0 != null && this.string_0 == string_3 && this.string_2 == string_4)
     {
         if (this.class318_0 != null && this.class318_0 != this)
         {
             this.class318_0.vmethod_1();
         }
         base.Dispose();
         this.method_19();
         GC.Collect();
     }
 }
示例#25
0
 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;
 }
示例#26
0
 public TexFile(byte[] byte_0)
 {
     this._fileStream = new Stream26(byte_0, true);
     this.Initialize();
 }
示例#27
0
        public Stream26 ToStream()
        {
            Stream26 stream = new Stream26(true);
            int textureCount = this.TextureCount();
            int textureMetaDataOffset = 0;
            if (!this._unkFlag0)
            {
                stream.WriteUInt(0xFACECAA7); //meow
                stream.WriteShort(284);
                stream.WriteShort((short)textureCount);
                stream.WriteInt(0);
                stream.WriteInt(0);
                stream.WriteInt(-1);

                int num3 = 2;
                while ((double)textureCount / Math.Pow(2.0, (double)(num3 - 2)) > 1.0)
                {
                    num3++;
                }
                num3--;
                stream.WriteInt(num3); //logarithm of textureCount?..
                stream.WriteInt(28);
                stream.WriteNBytes(0xEF, (int)(Math.Pow(2.0, (double)num3) * 12.0 + 28.0));

                textureMetaDataOffset = (int)stream.Position;
                stream.WriteIntAt(8, textureMetaDataOffset);
                stream.WriteInt(textureMetaDataOffset + textureCount * 44);
                stream.Position = (long)textureMetaDataOffset;
            }
            stream.WriteNBytes(0, 40 * textureCount);
            for (int i = 0; i < textureCount; i++)
            {
                TextureMetadata tex = this.textureList[i];
                byte[] array = this.method_2(i);
                stream.WriteShortAt(textureMetaDataOffset + 40 * i, 2600);
                stream.WriteShort(tex.unkShort0);
                stream.WriteInt(tex.unkInt);
                stream.WriteShort(tex.Width);
                stream.WriteShort(tex.Height);
                stream.WriteShort(tex.unkShort3);
                stream.WriteShort(tex.Width);
                stream.WriteShort(tex.Height);
                stream.WriteShort(tex.unkShort3);
                stream.WriteByte2(tex.MipMapCount);
                stream.WriteShort(tex.unkShort4);
                stream.WriteNBytes(0, 5);
                stream.WriteInt((int)stream.Length);
                stream.WriteInt(array.Length);
                stream.WriteInt(0);
                stream.WriteByteArrayAt((int)stream.Length, array, false);
            }
            return stream;
        }
示例#28
0
 public zzGenericNode1(string string_0, Stream26 stream26_0, Dictionary<int, string> dictionary_1)
 {
     base.Text = KeyGenerator.GetFileName(string_0);
     if (dictionary_1 != null)
     {
         this.dictionary_0 = dictionary_1;
         this.bool_2 = true;
     }
     stream26_0.Position = 28L;
     base.method_4(stream26_0);
 }
示例#29
0
 public zzGenericNode1(string string_0, Stream26 stream26_0)
 {
     base.Text = KeyGenerator.GetFileName(string_0);
     stream26_0.Position = 28L;
     base.method_4(stream26_0);
 }
示例#30
0
 public override void vmethod_14(Stream26 stream26_0)
 {
     stream26_0._reverseEndianness = this.vmethod_7();
     foreach (AbstractTreeNode1 @class in base.Nodes)
     {
         @class.vmethod_14(stream26_0);
     }
 }