private bool FindSVBLSequenceTwo(byte[] allBytes, string filename, SymbolCollection newSymbols, List<CodeBlock> newCodeBlocks)
{
//28 04 28 04 28 04 28 04 28 04 FF 03 + 42
bool found = true;
bool SVBLFound = false;
int offset = 0;
while (found)
{
int SVBLAddress = Tools.Instance.findSequence(allBytes, offset, new byte[12] { 0x28, 0x04, 0x28, 0x04, 0x28, 0x04, 0x28, 0x04, 0x28, 0x04, 0xFF, 0x03 }, new byte[12] { 1, 1, 1, 1, 1, 1, 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 + 42;
// 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;
}