コード例 #1
0
 public Cplc ReadCplc()
 {
     byte[] buffer = GetData(FileIdCplc);
     return(Cplc.Parse(buffer));
 }
コード例 #2
0
        public static Cplc Parse(byte[] cplc)
        {
            if (cplc == null)
            {
                throw new NullReferenceException();
            }
            if (cplc.Length != CplcLength)
            {
                throw new InvalidOperationException("CPLC length mismatch");
            }

            BinaryParser parser = new BinaryParser(cplc, ByteEndianess.BigEndian, BitEndianess.Msb);
            Cplc         output = new Cplc();

            /*
             * 5 ROM identifiers (10 bytes), each consisting of 4 digits coded on 2 bytes:
             */

            // -  IC Fabricator (2B)
            output.ICFabricator = parser.ReadUInt16();

            // -  IC Type (2B)
            output.ICType = parser.ReadUInt16();

            // -  Operating System Provider Identifier (2B)
            output.OSProviderId = parser.ReadUInt16();

            // -  Operating System Release Date (2B)
            output.OSReleaseDate = parser.ReadUInt16();

            // -  Operating System Release Level (2B)
            output.OSReleaseLevel = parser.ReadUInt16();

            /*
             * EEPROM Identifiers contain chip, card, pre-perso & personalizer info., in the given order :
             */

            // -  Chip Identifiers:
            // -  IC Fabrication Date (2B)
            output.ICFabricationDate = parser.ReadUInt16();

            // -  IC Serial Number (4B)
            output.ICSerialNo = parser.ReadUInt32();

            // -  IC Batch Identifier (2B)
            output.ICBatchId = parser.ReadUInt16();

            // -  Card identifiers :
            // -  IC Module Fabricator  (2B)
            output.ICModuleFabricator = parser.ReadUInt16();

            // -  IC Module Packaging Date      (2B)
            output.ICModulePackagingDate = parser.ReadUInt16();

            // -  ICC Manufacturer      (2B)
            output.ICCManufacturer = parser.ReadUInt16();

            // -  IC Embedding date     (2B)
            output.ICEmbeddingDate = parser.ReadUInt16();

            // -  Pre-personalization identifiers :
            // -  Pre-personalizer Identifier (2B)
            output.PrePersoId = parser.ReadUInt16();

            // -  Pre-personalization Date (2B)
            output.PrePersoDate = parser.ReadUInt16();

            // -  Pre-personalization Equipment (4B)
            output.PrePersoEquipment = parser.ReadUInt16();

            // -  Personalization identifiers :
            // -  Personalizer Identifier (2B)
            output.PersoId = parser.ReadUInt16();

            // -  Personalization Date (2B)
            output.PersoDate = parser.ReadUInt16();

            // -  Personalization Equipment (4B)
            output.PersoEquipment = parser.ReadUInt16();

            return(output);
        }