Ejemplo n.º 1
0
        public void method_1 <T>(string string_0, T gparam_0) where T : TreeNode
        {
            zzPakNode1 @class = string.IsNullOrEmpty(string_0) ? this : this.method_2(KeyGenerator.smethod_10(string_0));

            if (@class.Nodes.ContainsKey(gparam_0.Text))
            {
                @class.Nodes.RemoveByKey(gparam_0.Text);
            }
            @class.Nodes.Add(gparam_0);
            if (gparam_0 is Interface12)
            {
                TreeNode treeNode = this;
                int      level    = treeNode.Level;
                while (level-- != 0)
                {
                    treeNode = treeNode.Parent;
                }
                zzPakNode2  class2     = treeNode as zzPakNode2;
                Interface12 @interface = class2.method_10(string_0);
                if (@interface == null)
                {
                    class2.list_0.Add(gparam_0 as Interface12);
                    return;
                }
                class2.list_0[class2.list_0.IndexOf(@interface)] = (gparam_0 as Interface12);
            }
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
        public void method_2()
        {
            this.delegate9_0(0, "*.tex.xen");
            TreeNode treeNode = new TreeNode("Data");

            string[] files = Directory.GetFiles(this.string_0.Remove(this.string_0.Length - 1), "*.tex.xen", SearchOption.AllDirectories);
            string[] array = files;
            for (int i = 0; i < array.Length; i++)
            {
                string text = array[i];
                this.method_3(treeNode, new List <string>(text.Substring(this.string_0.Length).Split(new char[]
                {
                    '\\',
                    '/'
                }, StringSplitOptions.RemoveEmptyEntries))).ToolTipText = text;
            }
            this.delegate9_0(1, "*.img.xen");
            files = Directory.GetFiles(this.string_0.Remove(this.string_0.Length - 1), "*.img.xen", SearchOption.AllDirectories);
            string[] array2 = files;
            for (int j = 0; j < array2.Length; j++)
            {
                string text2 = array2[j];
                this.method_3(treeNode, new List <string>(text2.Substring(this.string_0.Length).Split(new char[]
                {
                    '\\',
                    '/'
                }, StringSplitOptions.RemoveEmptyEntries))).ToolTipText = text2;
            }
            int num  = QbSongClass1.smethod_9(".tex");
            int num2 = QbSongClass1.smethod_9(".img");

            files = Directory.GetFiles(this.string_0.Remove(this.string_0.Length - 1), "*.pak.xen", SearchOption.AllDirectories);
            int num3 = 0;

            string[] array3 = files;
            for (int k = 0; k < array3.Length; k++)
            {
                string text3 = array3[k];
                this.delegate9_0(1 + (int)(98.0 * (double)(++num3) / (double)files.Length), KeyGenerator.GetFileName(text3));
                try
                {
                    using (zzPakNode2 @class = File.Exists(text3.Replace(".pak.xen", ".pab.xen")) ? new zzPabNode(text3, text3.Replace(".pak.xen", ".pab.xen"), false) : new zzPakNode2(text3, false))
                    {
                        List <TreeNode> list = new List <TreeNode>();
                        foreach (Interface12 current in @class.list_0)
                        {
                            int num4 = current.imethod_7();
                            if (current.imethod_4() == num || current.imethod_4() == num2)
                            {
                                list.Add(new TreeNode(QbSongClass1.smethod_3(num4) ? KeyGenerator.GetFileName(QbSongClass1.smethod_5(num4)) : KeyGenerator.ValToHex32bit(num4))
                                {
                                    ToolTipText = text3,
                                    Tag         = num4
                                });
                            }
                        }
                        if (list.Count > 0)
                        {
                            this.method_3(treeNode, new List <string>(text3.Substring(this.string_0.Length).Split(new char[]
                            {
                                '\\',
                                '/'
                            }, StringSplitOptions.RemoveEmptyEntries))).Nodes.AddRange(list.ToArray());
                        }
                    }
                }
                catch
                {
                }
                GC.Collect();
            }
            this.delegate8_0(treeNode);
        }