private static void ProcessWindow(List <byte[]> bytes, Grammar grammar) { List <byte[]> tmp = new List <byte[]>(); for (int i = 0; i < bytes.Count; i++) { if (bytes[i].Length < MINIMUM_RECORD_SIZE) { continue; } string[] record = BinaryFile.GetRecord(bytes[i]); CYK.CYK cyk = new CYK.CYK(record, grammar); CYKResult result = cyk.Parse(); Field[] fields = CYK.CYK.GetFields(result.Root); //var tmp = fields.Where(r => r.Type == "AddressBookEntry").ToList(); if (fields.Where(r => r.Type == "AddressBookEntry").ToList().Count > 0) { _numResults++; tmp.Add(bytes[i]); //fields = Field.CompressBinaryFields(fields); //string fieldString = ""; //for (int j = 0; j < fields.Length; j++) //{ // fieldString += fields[j].ToString(); //} //Console.WriteLine(fieldString); //foreach (var item in fields.Where(r => r.Type == "AddressBookEntry")) //{ // string byteString = file.GetAscii(i+item.Start, item.Length); // string offset = Convert.ToString(i+item.Start, 16); //} } } }
private static void ProcessWindow(BinaryFile file, Grammar grammar, long startIndex, int i) { _count++; string[] record = file.GetRecord(startIndex, WINDOW_SIZE); CYK.CYK cyk = new CYK.CYK(record, grammar); CYKResult result = cyk.Parse(); Field[] fields = CYK.CYK.GetFields(result.Root); //var tmp = fields.Where(r => r.Type == "AddressBookEntry").ToList(); if (fields.Where(r => r.Type == "AddressBookEntry").ToList().Count > 0) { _numResults++; //fields = Field.CompressBinaryFields(fields); //string fieldString = ""; //for (int j = 0; j < fields.Length; j++) //{ // fieldString += fields[j].ToString(); //} //Console.WriteLine(fieldString); //foreach (var item in fields.Where(r => r.Type == "AddressBookEntry")) //{ // string byteString = file.GetAscii(i+item.Start, item.Length); // string offset = Convert.ToString(i+item.Start, 16); //} } }
private static void ProcessWindow(List<byte[]> bytes, Grammar grammar) { List<byte[]> tmp = new List<byte[]>(); for (int i = 0; i < bytes.Count; i++) { if (bytes[i].Length < MINIMUM_RECORD_SIZE) continue; string[] record = BinaryFile.GetRecord(bytes[i]); CYK.CYK cyk = new CYK.CYK(record, grammar); CYKResult result = cyk.Parse(); Field[] fields = CYK.CYK.GetFields(result.Root); //var tmp = fields.Where(r => r.Type == "AddressBookEntry").ToList(); if (fields.Where(r => r.Type == "AddressBookEntry").ToList().Count > 0) { _numResults++; tmp.Add(bytes[i]); //fields = Field.CompressBinaryFields(fields); //string fieldString = ""; //for (int j = 0; j < fields.Length; j++) //{ // fieldString += fields[j].ToString(); //} //Console.WriteLine(fieldString); //foreach (var item in fields.Where(r => r.Type == "AddressBookEntry")) //{ // string byteString = file.GetAscii(i+item.Start, item.Length); // string offset = Convert.ToString(i+item.Start, 16); //} } } }