VAGSuite.EDC15PFileParser.CheckCodeBlock C# (CSharp) Метод

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

private CheckCodeBlock ( int offset, byte allBytes, SymbolCollection newSymbols, List newCodeBlocks ) : int
offset int
allBytes byte
newSymbols SymbolCollection
newCodeBlocks List
Результат int
        private int CheckCodeBlock(int offset, byte[] allBytes, SymbolCollection newSymbols, List<CodeBlock> newCodeBlocks)
        {
            int codeBlockID = 0;
            try
            {
                int endOfTable = Convert.ToInt32(allBytes[offset + 0x01000]) + Convert.ToInt32(allBytes[offset + 0x01001]) * 256 + offset;
                //sth wrong here with File 019AQ (ARL)
                int codeBlockAddress = Convert.ToInt32(allBytes[offset + 0x01002]) + Convert.ToInt32(allBytes[offset + 0x01003]) * 256 + offset;
                if (endOfTable == offset + 0xC3C3) return 0;
                codeBlockID = Convert.ToInt32(allBytes[codeBlockAddress]) + Convert.ToInt32(allBytes[codeBlockAddress + 1]) * 256;
                //Why do we need line obove?
                //codeBlockID = Convert.ToInt32(allBytes[codeBlockAddress]);

                foreach (CodeBlock cb in newCodeBlocks)
                {
                    if (cb.StartAddress <= codeBlockAddress && cb.EndAddress >= codeBlockAddress)
                    {
                        cb.CodeID = codeBlockID;
                        cb.AddressID = codeBlockAddress;
                    }
                }
            }
            catch (Exception)
            {
            }
            return codeBlockID;
        }