示例#1
0
        /// <summary>
        /// You do not need a project file for this kind of scan
        /// </summary>
        /// <param name="byteStream"></param>
        public DataBlockVerification Scan(byte[] byteStream)
        {
            IScanContext scanContext = TestFramework.CreateScanContext(_project);
            IDataBlock   dataBlock   = ScanDataBlock(byteStream, scanContext);

            Assert.IsNotNull(dataBlock);

            // Data block detected, perform a rescan for the results
            IScanContext rescanContext = TestFramework.CreateScanContext(_project);

            rescanContext.Detectors = dataBlock.Detectors;
            var detectedByteStream = new byte[dataBlock.Length];

            Array.Copy(byteStream, dataBlock.StartOffset, detectedByteStream, 0, detectedByteStream.Length);
            ScanDataBlock(detectedByteStream, rescanContext);
            Assert.IsNotNull(rescanContext.Results);

            return(new DataBlockVerification(dataBlock, rescanContext.Results, "using " + _videoDetector.Name + " detected datablock within memory buffer of size " + byteStream.Length + "." + TestFramework.GetDescriptionText(rescanContext.Results)));
        }