Пример #1
0
 // Token: 0x06000380 RID: 896 RVA: 0x000173A8 File Offset: 0x000155A8
 public Class_152(string str_0, bool bool_0)
 {
     if (!string.IsNullOrEmpty(str_0))
     {
         this.field_0 = Class_152.pmethod_499(str_0);
     }
     this.prop_1 = bool_0;
 }
Пример #2
0
        // Token: 0x06000386 RID: 902 RVA: 0x00017684 File Offset: 0x00015884
        private static Class_145 pmethod_499(string str_0)
        {
            if (str_0 == null)
            {
                return(null);
            }
            str_0 = Class_152.lmethod_498(str_0);
            if (str_0.IndexOf(" ") == -1)
            {
                str_0 = "name = " + str_0;
            }
            string[] array = str_0.Trim().Split(new char[]
            {
                ' ',
                '\t'
            });
            if (array.Length < 3)
            {
                throw new ArgumentException(str_0);
            }
            Class_145 class_ = null;
            Stack <Class_152.NClass_0> stack  = new Stack <Class_152.NClass_0>();
            Stack <Class_145>          stack2 = new Stack <Class_145>();

            stack.Push(Class_152.NClass_0.field_4);
            int i = 0;

            while (i < array.Length)
            {
                string text = array[i].ToLower();
                string key;
                if ((key = text) != null)
                {
                    if (Class_217.field_0 == null)
                    {
                        Class_217.field_0 = new Dictionary <string, int>(16)
                        {
                            {
                                "and",
                                0
                            },
                            {
                                "xor",
                                1
                            },
                            {
                                "or",
                                2
                            },
                            {
                                "(",
                                3
                            },
                            {
                                ")",
                                4
                            },
                            {
                                "atime",
                                5
                            },
                            {
                                "ctime",
                                6
                            },
                            {
                                "mtime",
                                7
                            },
                            {
                                "length",
                                8
                            },
                            {
                                "size",
                                9
                            },
                            {
                                "filename",
                                10
                            },
                            {
                                "name",
                                11
                            },
                            {
                                "attrs",
                                12
                            },
                            {
                                "attributes",
                                13
                            },
                            {
                                "type",
                                14
                            },
                            {
                                "",
                                15
                            }
                        };
                    }
                    int num;
                    if (Class_217.field_0.TryGetValue(key, out num))
                    {
                        Class_152.NClass_0 nclass_;
                        switch (num)
                        {
                        case 0:
                        case 1:
                        case 2:
                        {
                            nclass_ = stack.Peek();
                            if (nclass_ != Class_152.NClass_0.field_6)
                            {
                                throw new ArgumentException(string.Join(" ", array, i, array.Length - i));
                            }
                            if (array.Length <= i + 3)
                            {
                                throw new ArgumentException(string.Join(" ", array, i, array.Length - i));
                            }
                            Class_142 class_2 = (Class_142)Enum.Parse(typeof(Class_142), array[i].ToUpper(), true);
                            class_ = new Class_151
                            {
                                field_1 = class_,
                                prop_0  = null,
                                field_0 = class_2
                            };
                            stack.Push(nclass_);
                            stack.Push(Class_152.NClass_0.field_7);
                            stack2.Push(class_);
                            break;
                        }

                        case 3:
                            nclass_ = stack.Peek();
                            if (nclass_ != Class_152.NClass_0.field_4 && nclass_ != Class_152.NClass_0.field_7 && nclass_ != Class_152.NClass_0.field_5)
                            {
                                throw new ArgumentException(string.Join(" ", array, i, array.Length - i));
                            }
                            if (array.Length <= i + 4)
                            {
                                throw new ArgumentException(string.Join(" ", array, i, array.Length - i));
                            }
                            stack.Push(Class_152.NClass_0.field_5);
                            break;

                        case 4:
                            nclass_ = stack.Pop();
                            if (stack.Peek() != Class_152.NClass_0.field_5)
                            {
                                throw new ArgumentException(string.Join(" ", array, i, array.Length - i));
                            }
                            stack.Pop();
                            stack.Push(Class_152.NClass_0.field_6);
                            break;

                        case 5:
                        case 6:
                        case 7:
                        {
                            if (array.Length <= i + 2)
                            {
                                throw new ArgumentException(string.Join(" ", array, i, array.Length - i));
                            }
                            DateTime dateTime;
                            try
                            {
                                dateTime = DateTime.ParseExact(array[i + 2], "yyyy-MM-dd-HH:mm:ss", null);
                            }
                            catch (FormatException)
                            {
                                try
                                {
                                    dateTime = DateTime.ParseExact(array[i + 2], "yyyy/MM/dd-HH:mm:ss", null);
                                }
                                catch (FormatException)
                                {
                                    try
                                    {
                                        dateTime = DateTime.ParseExact(array[i + 2], "yyyy/MM/dd", null);
                                    }
                                    catch (FormatException)
                                    {
                                        try
                                        {
                                            dateTime = DateTime.ParseExact(array[i + 2], "MM/dd/yyyy", null);
                                        }
                                        catch (FormatException)
                                        {
                                            dateTime = DateTime.ParseExact(array[i + 2], "yyyy-MM-dd", null);
                                        }
                                    }
                                }
                            }
                            dateTime = DateTime.SpecifyKind(dateTime, DateTimeKind.Local).ToUniversalTime();
                            class_   = new Class_147
                            {
                                field_1 = (Class_143)Enum.Parse(typeof(Class_143), array[i], true),
                                field_0 = (Class_144)Class_153.Parse(typeof(Class_144), array[i + 1]),
                                field_2 = dateTime
                            };
                            i += 2;
                            stack.Push(Class_152.NClass_0.field_6);
                            break;
                        }

                        case 8:
                        case 9:
                        {
                            if (array.Length <= i + 2)
                            {
                                throw new ArgumentException(string.Join(" ", array, i, array.Length - i));
                            }
                            string text2 = array[i + 2];
                            long   num2;
                            if (text2.ToUpper().EndsWith("K"))
                            {
                                num2 = long.Parse(text2.Substring(0, text2.Length - 1)) * 1024L;
                            }
                            else if (text2.ToUpper().EndsWith("KB"))
                            {
                                num2 = long.Parse(text2.Substring(0, text2.Length - 2)) * 1024L;
                            }
                            else if (text2.ToUpper().EndsWith("M"))
                            {
                                num2 = long.Parse(text2.Substring(0, text2.Length - 1)) * 1024L * 1024L;
                            }
                            else if (text2.ToUpper().EndsWith("MB"))
                            {
                                num2 = long.Parse(text2.Substring(0, text2.Length - 2)) * 1024L * 1024L;
                            }
                            else if (text2.ToUpper().EndsWith("G"))
                            {
                                num2 = long.Parse(text2.Substring(0, text2.Length - 1)) * 1024L * 1024L * 1024L;
                            }
                            else if (text2.ToUpper().EndsWith("GB"))
                            {
                                num2 = long.Parse(text2.Substring(0, text2.Length - 2)) * 1024L * 1024L * 1024L;
                            }
                            else
                            {
                                num2 = long.Parse(array[i + 2]);
                            }
                            class_ = new Class_146
                            {
                                field_1 = num2,
                                field_0 = (Class_144)Class_153.Parse(typeof(Class_144), array[i + 1])
                            };
                            i += 2;
                            stack.Push(Class_152.NClass_0.field_6);
                            break;
                        }

                        case 10:
                        case 11:
                        {
                            if (array.Length <= i + 2)
                            {
                                throw new ArgumentException(string.Join(" ", array, i, array.Length - i));
                            }
                            Class_144 class_3 = (Class_144)Class_153.Parse(typeof(Class_144), array[i + 1]);
                            if (class_3 != Class_144.NotEqualTo && class_3 != Class_144.EqualTo)
                            {
                                throw new ArgumentException(string.Join(" ", array, i, array.Length - i));
                            }
                            string text3 = array[i + 2];
                            if (text3.StartsWith("'") && text3.EndsWith("'"))
                            {
                                text3 = text3.Substring(1, text3.Length - 2).Replace("\u0006", " ");
                            }
                            class_ = new Class_148
                            {
                                prop_0  = text3,
                                field_2 = class_3
                            };
                            i += 2;
                            stack.Push(Class_152.NClass_0.field_6);
                            break;
                        }

                        case 12:
                        case 13:
                        case 14:
                        {
                            if (array.Length <= i + 2)
                            {
                                throw new ArgumentException(string.Join(" ", array, i, array.Length - i));
                            }
                            Class_144 class_4 = (Class_144)Class_153.Parse(typeof(Class_144), array[i + 1]);
                            if (class_4 != Class_144.NotEqualTo && class_4 != Class_144.EqualTo)
                            {
                                throw new ArgumentException(string.Join(" ", array, i, array.Length - i));
                            }
                            class_ = ((text == "type") ? new Class_149
                                {
                                    prop_0 = array[i + 2],
                                    field_1 = class_4
                                } : new Class_150
                                {
                                    prop_0 = array[i + 2],
                                    field_1 = class_4
                                });
                            i += 2;
                            stack.Push(Class_152.NClass_0.field_6);
                            break;
                        }

                        case 15:
                            stack.Push(Class_152.NClass_0.field_8);
                            break;

                        default:
                            goto IL_86F;
                        }
                        nclass_ = stack.Peek();
                        if (nclass_ == Class_152.NClass_0.field_6)
                        {
                            stack.Pop();
                            if (stack.Peek() == Class_152.NClass_0.field_7)
                            {
                                while (stack.Peek() == Class_152.NClass_0.field_7)
                                {
                                    Class_151 class_5 = stack2.Pop() as Class_151;
                                    class_5.prop_0 = class_;
                                    class_         = class_5;
                                    stack.Pop();
                                    nclass_ = stack.Pop();
                                    if (nclass_ != Class_152.NClass_0.field_6)
                                    {
                                        throw new ArgumentException("??");
                                    }
                                }
                            }
                            else
                            {
                                stack.Push(Class_152.NClass_0.field_6);
                            }
                        }
                        if (nclass_ == Class_152.NClass_0.field_8)
                        {
                            stack.Pop();
                        }
                        i++;
                        continue;
                    }
                }
IL_86F:
                throw new ArgumentException("'" + array[i] + "'");
            }
            return(class_);
        }