コード例 #1
0
        public static PkgFile Hash2File(string hashString)
        {
            Calculation.Hash2FileHelper0 hash2FileHelper = new Calculation.Hash2FileHelper0();
            hashString = hashString.Replace(" ", "");
            uint num = Helpers.InvertUint32(Convert.ToUInt32(hashString, 0x10));

            hash2FileHelper.PackageId = Calculation.CalcPackageId(num);
            Calculation.CalcFilenumber(num);
            List <PkgListEntry> list = Form1.RecvPkgListEntries();
            int num2 = list.FindIndex(new Predicate <PkgListEntry>(hash2FileHelper.Hash2File0));

            if (num2 == -1)
            {
                num = Helpers.InvertUint32(num);
                hash2FileHelper.PackageId = Calculation.CalcPackageId(num);
                num2 = list.FindIndex(new Predicate <PkgListEntry>(hash2FileHelper.Hash2File1));
            }
            PkgListEntry pkgListEntry = list[num2];
            string       text         = Form1.RecD2PkgDir();

            string.Concat(new string[]
            {
                text,
                pkgListEntry.Basename,
                "_",
                pkgListEntry.PatchId.ToString(""),
                ".pkg"
            });
            return(new PkgFile(num));
        }
コード例 #2
0
        private void GetPkgFile(uint filehashIn)
        {
            PkgFile.GetPkgFileHelper0 getPkgFileHelper = new PkgFile.GetPkgFileHelper0
            {
                PackageId = Calculation.CalcPackageId(filehashIn)
            };
            List <PkgListEntry> list  = Form1.RecvPkgListEntries();
            int          index        = list.FindIndex(new Predicate <PkgListEntry>(getPkgFileHelper.GetPkgFile0));
            PkgListEntry pkgListEntry = list[index];
            string       text         = Form1.RecD2PkgDir();

            this.Pkg = string.Concat(new string[]
            {
                text,
                pkgListEntry.Basename,
                "_",
                pkgListEntry.PatchId.ToString(""),
                ".pkg"
            });
        }
コード例 #3
0
        public static uint getHash_OLD(string filename)
        {
            uint num    = Convert.ToUInt32(filename.Substring(0, 4), 0x10);
            uint num2   = Convert.ToUInt32(filename.Substring(5, 4), 0x10);
            uint num3   = 0x80000000U;
            uint num4   = 0x81FFF000U;
            uint result = 0U;

            while (num3 <= num4)
            {
                uint num5 = Calculation.CalcPackageId(num3 + num2);
                uint num6 = Calculation.CalcFilenumber(num3 + num2);
                if (num5 == num & num6 == num2)
                {
                    result = num3 + num2;
                    if (num >= 0x500U)
                    {
                        break;
                    }
                }
                num3 += 0x1000U;
            }
            return(result);
        }
コード例 #4
0
        public static PkgFile Hash2File(uint hash)
        {
            Calculation.HashToFileHelper1 hashToFileHelper = new Calculation.HashToFileHelper1
            {
                PackageId = Calculation.CalcPackageId(hash)
            };
            bool flag = hashToFileHelper.PackageId == 0x513U;

            if (flag)
            {
                hashToFileHelper.PackageId = 0x913U;
            }
            Calculation.CalcFilenumber(hash);
            List <PkgListEntry> list = Form1.RecvPkgListEntries();
            int  num   = list.FindIndex(new Predicate <PkgListEntry>(hashToFileHelper.HashToFile0));
            bool flag2 = num == -1;

            if (flag2)
            {
                hash = Helpers.InvertUint32(hash);
                hashToFileHelper.PackageId = Calculation.CalcPackageId(hash);
                num = list.FindIndex(new Predicate <PkgListEntry>(hashToFileHelper.Hash2File1));
            }
            PkgListEntry pkgListEntry = list[num];
            string       text         = Form1.RecD2PkgDir();

            string.Concat(new string[]
            {
                text,
                pkgListEntry.Basename,
                "_",
                pkgListEntry.PatchId.ToString(""),
                ".pkg"
            });
            return(new PkgFile(hash));
        }