VAGSuite.EDC15VFileParser.FindSVBLSequenceThree C# (CSharp) Метод

FindSVBLSequenceThree() приватный Метод

private FindSVBLSequenceThree ( byte allBytes, string filename, SymbolCollection newSymbols, List newCodeBlocks ) : bool
allBytes byte
filename string
newSymbols SymbolCollection
newCodeBlocks List
Результат bool
        private bool FindSVBLSequenceThree(byte[] allBytes, string filename, SymbolCollection newSymbols, List<CodeBlock> newCodeBlocks)
        {
            bool found = true;
            bool SVBLFound = false;
            int offset = 0;
            while (found)
            {
                int SVBLAddress = Tools.Instance.findSequence(allBytes, offset, new byte[6] { 0x7F, 0xC3, 0x10, 0x27, 0x10, 0x27}, new byte[6] { 1, 1, 1, 1, 1, 1 });
                if (SVBLAddress > 0)
                {
                    SVBLFound = true;
                    //Console.WriteLine("Alternative SVBL " + SVBLAddress.ToString("X8"));
                    SymbolHelper shsvbl = new SymbolHelper();
                    shsvbl.Category = "Detected maps";
                    shsvbl.Subcategory = "Limiters";
                    shsvbl.Flash_start_address = SVBLAddress + 8;

                    // if value = 0xC3 0x00 -> two more back
                    int[] testValue = Tools.Instance.readdatafromfileasint(filename, (int)shsvbl.Flash_start_address, 1, EDCFileType.EDC15V);
                    if (testValue[0] == 0xC300) shsvbl.Flash_start_address -= 2;

                    shsvbl.Varname = "SVBL Boost limiter [" + DetermineNumberByFlashBank(shsvbl.Flash_start_address, newCodeBlocks) + "]";
                    shsvbl.Length = 2;
                    shsvbl.CodeBlock = DetermineCodeBlockByByAddress(shsvbl.Flash_start_address, newCodeBlocks);
                    newSymbols.Add(shsvbl);
                    offset = SVBLAddress + 1;
                }
                else found = false;
            }
            return SVBLFound;
        }