예제 #1
0
        public FortniteReplay ReadReplay(Stream stream, ParseType parseType = ParseType.Minimal)
        {
            using var archive = new Unreal.Core.BinaryReader(stream);
            var replay = ReadReplay(archive, parseType);

            return(replay);
        }
예제 #2
0
        public FortniteReplay ReadReplay(Stream stream)
        {
            using var archive = new Unreal.Core.BinaryReader(stream);

            Builder = new FortniteReplayBuilder();
            ReadReplay(archive);

            return(Builder.Build(Replay));
        }
예제 #3
0
        public void BinaryReader()
        {
            Random rnd = new();

            Byte[] b = new Byte[1000];
            rnd.NextBytes(b);
            using var ms = new MemoryStream(b);
            var reader = new Unreal.Core.BinaryReader(ms);
        }
        public FortniteReplay ReadReplay(Stream stream)
        {
            using var archive = new Unreal.Core.BinaryReader(stream);
            var replay = ReadReplay(archive);

            GenerateGameInformation();

            return(replay);
        }
예제 #5
0
        public BenchmarkBinaryReader()
        {
            Random rnd = new();

            Byte[] b = new Byte[1000];
            rnd.NextBytes(b);
            var ms = new MemoryStream(b);

            Reader = new Unreal.Core.BinaryReader(ms);
        }
예제 #6
0
        protected override Unreal.Core.BinaryReader Decrypt(FArchive archive, int size)
        {
            if (!this.Replay.Info.Encrypted)
            {
                var decryptedReader = new Unreal.Core.BinaryReader(new MemoryStream(archive.ReadBytes(size)))
                {
                    EngineNetworkVersion = Replay.Header.EngineNetworkVersion,
                    NetworkVersion       = Replay.Header.NetworkVersion,
                    ReplayHeaderFlags    = Replay.Header.Flags,
                    ReplayVersion        = Replay.Info.FileVersion
                };

                return(decryptedReader);
            }

            var encryptedBytes = archive.ReadBytes(size);
            var key            = this.Replay.Info.EncryptionKey;

            using RijndaelManaged rDel = new RijndaelManaged
                  {
                      KeySize = (key.Length * 8),
                      Key     = key,
                      Mode    = CipherMode.ECB,
                      Padding = PaddingMode.PKCS7
                  };

            using ICryptoTransform cTransform = rDel.CreateDecryptor();
            byte[] decryptedArray = cTransform.TransformFinalBlock(encryptedBytes, 0, encryptedBytes.Length);

            var decrypted = new Unreal.Core.BinaryReader(new MemoryStream(decryptedArray))
            {
                EngineNetworkVersion = Replay.Header.EngineNetworkVersion,
                NetworkVersion       = Replay.Header.NetworkVersion,
                ReplayHeaderFlags    = Replay.Header.Flags,
                ReplayVersion        = Replay.Info.FileVersion
            };

            return(decrypted);
        }
 public FortniteReplay ReadReplay(string fileName)
 {
     using var stream  = File.Open(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
     using var archive = new Unreal.Core.BinaryReader(stream);
     return(ReadReplay(stream));
 }