コード例 #1
0
ファイル: Utils.cs プロジェクト: prisnelov/writeups
    // Token: 0x0600004D RID: 77 RVA: 0x000092BC File Offset: 0x000074BC
    public static bool checkFlagFormat(string user_input, int hsh, bool checkFormat = true)
    {
        string[] input_parts = new string[1000];
        int      num3        = 0;
        char     c           = '\0';


        if (checkFormat)
        {
            for (; ;)
            {
IL_208:
                uint num = 1276780562U;
                for (; ;)
                {
                    uint num2;
                    switch ((num2 = (num ^ 1938848571U)) % 19U)
                    {
                    case 0U:
                    {
                        num = (GClass1.StringLength(input_parts[num3]) == 4) ? 161800768U : 267634710U;
                        continue;
                    }

                    case 1U:
                    {
                        num = (num3 < input_parts.Length) ? 2066027667U : 372702057U;
                        continue;
                    }

                    case 2U:
                        return(false);

                    case 3U:
                    {
                        num3++;
                        num = 22141646U;
                        continue;
                    }

                    case 4U:
                        num = (num2 * 1818674489U ^ 3927765253U);
                        continue;

                    case 6U:
                    {
                        num3 = 0;
                        num  = (num2 * 615570198U ^ 2476758416U);
                        continue;
                    }

                    case 7U:
                        goto IL_208;

                    case 8U:
                    {
                        c   = GClass1.GetCharAtOffset(user_input, num3);
                        num = 487027905U;
                        continue;
                    }

                    case 9U:
                    {
                        num = ((c < '\u007f') ? 3945937441U : 3956362675U) ^ num2 * 3337894887U;
                        continue;
                    }

                    case 10U:
                    {
                        num = (((c < ' ') ? 2328726507U : 3166744977U) ^ num2 * 414064944U);
                        continue;
                    }

                    case 11U:
                    {
                        num3++;
                        num = 150263027U;
                        continue;
                    }

                    case 12U:
                    {
                        input_parts = GClass1.StringSplit(user_input, new char[]
                            {
                                '-'
                            });
                        num3 = 0;
                        num  = 1642143901U;
                        continue;
                    }

                    case 13U:
                        return(false);

                    case 14U:
                        num = (((GClass1.StringSplit(user_input, new char[]
                        {
                            '-'
                        }).Length == 6) ? 683502988U : 1473095498U) ^ num2 * 1113113859U);
                        continue;

                    case 15U:
                        num = (((GClass1.StringLength(user_input) != 29) ? 650567720U : 925404683U) ^ num2 * 2388823709U);
                        continue;

                    case 16U:
                        num = (num2 * 1193093645U ^ 2466404860U);
                        continue;

                    case 17U:
                        return(false);

                    case 18U:
                    {
                        num = (num3 >= GClass1.StringLength(user_input)) ? 1006143797U : 141482056U;
                        continue;
                    }
                    }
                    goto Block_9;
                }
            }
            Block_9 :;
        }
        return(GClass1.computeHash(user_input, hsh));
    }