示例#1
0
        protected HwInfo GetHwConfiguration()
        {
            FwLocation fwLocation = new FwLocation
            {
                Offset = DigitalSectionOffset() + 5,
                Length = 2
            };

            return(HwConfiguration(BitConverter.ToUInt16(Read(fwLocation.Offset, fwLocation.Length), 0)));
        }
示例#2
0
        public virtual Dictionary <Sections, SectionDetails> GetSectionInfo()
        {
            if (Source.Info == null)
            {
                throw new TbtException(TbtStatus.SDK_INTERNAL_ERROR, Resources.NoHWInfo);
            }
            Dictionary <Sections, SectionDetails> dictionary = new Dictionary <Sections, SectionDetails>();

            dictionary[Sections.Digital] = new SectionDetails
            {
                Offset = Source.DigitalSectionOffset()
            };
            dictionary[Sections.Digital].Length = SectionSize16Bit(dictionary[Sections.Digital].Offset);
            FwLocation fwLocation = new FwLocation
            {
                Offset = 117,
                Length = 4
            };
            uint num = BitConverter.ToUInt32(Source.Read(dictionary[Sections.Digital].Offset + fwLocation.Offset, fwLocation.Length), 0);

            dictionary[Sections.ArcParams] = new SectionDetails
            {
                Offset = dictionary[Sections.Digital].Offset + num
            };
            dictionary[Sections.ArcParams].Length = BitConverter.ToUInt32(Source.Read(dictionary[Sections.ArcParams].Offset, 4u), 0) * 4;
            FwLocation fwLocation2 = new FwLocation
            {
                Offset = 199,
                Length = 3
            };

            byte[] array = Source.Read(dictionary[Sections.Digital].Offset + fwLocation2.Offset, fwLocation2.Length);
            Array.Resize(ref array, 4);
            uint num2 = BitConverter.ToUInt32(array, 0);

            dictionary[Sections.Ee2TarDma] = new SectionDetails
            {
                Offset = dictionary[Sections.Digital].Offset + num2
            };
            uint num3 = BitConverter.ToUInt32(Source.Read((uint)(dictionary[Sections.ArcParams].Offset + ((Info.Generation < HwGeneration.JHL7540_7440_7340) ? 268 : 332)), 4u), 0);

            if (Utilities.ValidPointer(num3, 4))
            {
                dictionary[Sections.Pd] = new SectionDetails
                {
                    Offset = num3 + dictionary[Sections.Digital].Offset
                };
            }
            FwLocation fwLocation3 = new FwLocation
            {
                Offset = 270,
                Length = 4
            };
            uint num4 = BitConverter.ToUInt32(Source.Read(dictionary[Sections.Digital].Offset + fwLocation3.Offset, fwLocation3.Length), 0);

            if (num4 == 0)
            {
                throw new TbtException(TbtStatus.SDK_NO_DROM_FOUND);
            }
            dictionary[Sections.DROM] = new SectionDetails
            {
                Offset = dictionary[Sections.Digital].Offset + num4
            };
            dictionary[Sections.DROM].Length = BitConverter.ToUInt32(Source.Read(dictionary[Sections.DROM].Offset, 4u), 0) * 4;
            return(dictionary);
        }
示例#3
0
        public override Dictionary <Sections, SectionDetails> GetSectionInfo()
        {
            Dictionary <Sections, SectionDetails> sectionInfo = base.GetSectionInfo();
            HwGeneration generation = base.Source.Info.Generation;

            if ((uint)(generation - 3) > 3u)
            {
                throw new TbtException(TbtStatus.SDK_UNKNOWN_CHIP);
            }
            FwLocation fwLocation = new FwLocation
            {
                Offset = sectionInfo[Sections.Digital].Offset + 2,
                Length = 1
            };
            SectionReadBit sectionReadBit = (SectionReadBit)base.Source.Read(fwLocation.Offset, fwLocation.Length)[0];

            if (sectionReadBit.HasFlag(SectionReadBit.DRAM))
            {
                var obj = new[]
                {
                    new
                    {
                        name = "CP",
                        flag = SectionReadBit.CP
                    },
                    new
                    {
                        name = "HDPOut",
                        flag = SectionReadBit.DPOUT
                    },
                    new
                    {
                        name = "HDPIn",
                        flag = SectionReadBit.DPIN
                    },
                    new
                    {
                        name = "LC",
                        flag = SectionReadBit.LC
                    },
                    new
                    {
                        name = "ARC",
                        flag = SectionReadBit.ARC
                    },
                    new
                    {
                        name = "IRAM",
                        flag = SectionReadBit.IRAM
                    }
                };
                FwLocation fwLocation2 = new FwLocation
                {
                    Offset = sectionInfo[Sections.Digital].Offset + 3,
                    Length = 2
                };
                uint num   = sectionInfo[Sections.Digital].Offset + BitConverter.ToUInt16(base.Source.Read(fwLocation2.Offset, fwLocation2.Length), 0);
                var  array = obj;
                foreach (var anon in array)
                {
                    if (sectionReadBit.HasFlag(anon.flag))
                    {
                        uint num2 = SectionSize16BitDw(num);
                        num += num2;
                    }
                }
                sectionInfo[Sections.DRAMUCode] = new SectionDetails
                {
                    Offset = num
                };
                sectionInfo[Sections.DRAMUCode].Length = SectionSize16BitDw(sectionInfo[Sections.DRAMUCode].Offset);
            }
            return(sectionInfo);
        }