示例#1
0
        public void SwitchTableTest()
        {
            var ok = ModelFactory.GetModel <StfsPackage>(@"..\..\..\..\Resources\compare\deathspank.ok");
            var currentTopTable = ok.GetLevelNHashTable(0, 1);

            ok.SwitchTables();

            for (var i = 0; i < currentTopTable.EntryCount; i++)
            {
                ok.TopTable.Entries[i].CacheEnabled = false;
                BinaryAssert.Assert(currentTopTable.Entries[i], ok.TopTable.Entries[i]);
            }
        }
示例#2
0
        public void ResignTest()
        {
            var file    = File.ReadAllBytes(OrigPath);
            var package = ModelFactory.GetModel <StfsPackage>(file);

            var resigned = ModelFactory.GetModel <StfsPackage>(File.ReadAllBytes(OrigPath));

            resigned.Resign();

            //_package.Save(OutPath);

            //var velocity = ModelFactory.GetModel<StfsPackage>(File.ReadAllBytes(VelocityPath));
            //BinaryAssert.Assert(velocity.Certificate, _package.Certificate);

            //var fluffie = ModelFactory.GetModel<StfsPackage>(File.ReadAllBytes(@"..\..\..\..\Resources\hashcheck\out"));
            //var mysigned = ModelFactory.GetModel<StfsPackage>(File.ReadAllBytes(@"..\..\..\..\Resources\hashcheck\out1"));

            BinaryAssert.Assert(package.Certificate, resigned.Certificate);
        }