コード例 #1
0
        private void StartLoadDeviceInfo()
        {
            try
            {
                Operator = CurrentModel.ExecuteJsonMethodAsString("ReadOperatorName", "OperatorName");                                // 000-NL
                LogFile.Log("Operator: " + Operator);
                ManufacturerModelName = CurrentModel.ExecuteJsonMethodAsString("ReadManufacturerModelName", "ManufacturerModelName"); // RM-821_eu_denmark_251
                LogFile.Log("Manufacturer Model Name: " + ManufacturerModelName);
                ProductCode = CurrentModel.ExecuteJsonMethodAsString("ReadProductCode", "ProductCode");                               // 059Q9D7
                LogFile.Log("Product Code: " + ProductCode);
                Firmware = CurrentModel.ExecuteJsonMethodAsString("ReadSwVersion", "SwVersion");                                      // 3051.40000.1349.0007
                LogFile.Log("Firmware: " + Firmware);

                IMEI = CurrentModel.ExecuteJsonMethodAsString("ReadSerialNumber", "SerialNumber");        // IMEI
                LogFile.Log("IMEI: " + IMEI);
                PublicID = CurrentModel.ExecuteJsonMethodAsBytes("ReadPublicId", "PublicId");             // 0x14 bytes: a5 e5 ...
                LogFile.Log("Public ID: " + Converter.ConvertHexToString(PublicID, " "));
                BluetoothMac = CurrentModel.ExecuteJsonMethodAsBytes("ReadBtId", "BtId");                 // 6 bytes: bc c6 ...
                LogFile.Log("Bluetooth MAC: " + Converter.ConvertHexToString(BluetoothMac, " "));
                WlanMac = CurrentModel.ExecuteJsonMethodAsBytes("ReadWlanMacAddress", "WlanMacAddress1"); // 6 bytes
                LogFile.Log("WLAN MAC: " + Converter.ConvertHexToString(WlanMac, " "));

                bool?ProductionDone = CurrentModel.ExecuteJsonMethodAsBoolean("ReadProductionDoneState", "ProductionDone");
                if (ProductionDone == null)
                {
                    IsBootloaderSecurityEnabled = (CurrentModel.ExecuteJsonMethodAsString("GetSecurityMode", "SecMode").IndexOf("Restricted", StringComparison.OrdinalIgnoreCase) >= 0);
                }
                else
                {
                    IsBootloaderSecurityEnabled = ((CurrentModel.ExecuteJsonMethodAsString("GetSecurityMode", "SecMode").IndexOf("Restricted", StringComparison.OrdinalIgnoreCase) >= 0) && (bool)CurrentModel.ExecuteJsonMethodAsBoolean("ReadProductionDoneState", "ProductionDone"));
                }
                LogFile.Log("Bootloader Security: " + ((bool)IsBootloaderSecurityEnabled ? "Enabled" : "Disabled"));
                IsSimLocked = CurrentModel.ExecuteJsonMethodAsBoolean("ReadSimlockActive", "SimLockActive");
                LogFile.Log("Simlock: " + ((bool)IsSimLocked ? "Active" : "Unlocked"));
            }
            catch { }
        }
コード例 #2
0
        private void StartLoadDeviceInfo()
        {
            //byte[] Imsi = CurrentModel.ExecuteJsonMethodAsBytes("ReadImsi", "Imsi"); // 9 bytes: 08 29 40 40 ...
            //string BatteryLevel = CurrentModel.ExecuteJsonMethodAsString("ReadBatteryLevel", "BatteryLevel");
            //string SystemAsicVersion = CurrentModel.ExecuteJsonMethodAsString("ReadSystemAsicVersion", "SystemAsicVersion"); // 8960 -> Chip SOC version
            //string OperatorName = CurrentModel.ExecuteJsonMethodAsString("ReadOperatorName", "OperatorName"); // 000-DK
            //string ManufacturerModelName = CurrentModel.ExecuteJsonMethodAsString("ReadManufacturerModelName", "ManufacturerModelName"); // RM-821_eu_denmark_251
            //string AkVersion = CurrentModel.ExecuteJsonMethodAsString("ReadAkVersion", "AkVersion"); // 9200.10521
            //string BspVersion = CurrentModel.ExecuteJsonMethodAsString("ReadBspVersion", "BspVersion"); // 3051.40000
            //string ProductCode = CurrentModel.ExecuteJsonMethodAsString("ReadProductCode", "ProductCode"); // 059Q9D7
            //string SecurityMode = CurrentModel.ExecuteJsonMethodAsString("GetSecurityMode", "SecMode"); // Restricted
            //string SerialNumber = CurrentModel.ExecuteJsonMethodAsString("ReadSerialNumber", "SerialNumber"); // 356355051883955 = IMEI
            //string SwVersion = CurrentModel.ExecuteJsonMethodAsString("ReadSwVersion", "SwVersion"); // 3051.40000.1349.0007
            //string ModuleCode = CurrentModel.ExecuteJsonMethodAsString("ReadModuleCode", "ModuleCode"); // 0205137
            //byte[] PublicId = CurrentModel.ExecuteJsonMethodAsBytes("ReadPublicId", "PublicId"); // 0x14 bytes: a5 e5 ...
            //string Psn = CurrentModel.ExecuteJsonMethodAsString("ReadPsn", "Psn"); // CEP737370
            //string HwVersion = CurrentModel.ExecuteJsonMethodAsString("ReadHwVersion", "HWVersion"); // 6504 = 6.5.0.4
            //byte[] BtId = CurrentModel.ExecuteJsonMethodAsBytes("ReadBtId", "BtId"); // 6 bytes: bc c6 ...
            //byte[] WlanMacAddress1 = CurrentModel.ExecuteJsonMethodAsBytes("ReadWlanMacAddress", "WlanMacAddress1"); // 6 bytes
            //byte[] WlanMacAddress2 = CurrentModel.ExecuteJsonMethodAsBytes("ReadWlanMacAddress", "WlanMacAddress2"); // same
            //byte[] WlanMacAddress3 = CurrentModel.ExecuteJsonMethodAsBytes("ReadWlanMacAddress", "WlanMacAddress3"); // same
            //bool SimlockActive = CurrentModel.ExecuteJsonMethodAsBoolean("ReadSimlockActive", "SimLockActive"); // false
            //string Version = CurrentModel.ExecuteJsonMethodAsString("GetVersion", "HelloString"); // Resultvars: HelloString Version BuildDate BuildType
            //string ServiceTag = CurrentModel.ExecuteJsonMethodAsString("ReadServiceTag", "ServiceTag"); // error
            //byte[] RfChipsetVersion = CurrentModel.ExecuteJsonMethodAsBytes("ReadRfChipsetVersion", "RfChipsetVersion"); // error
            //byte[] Meid = CurrentModel.ExecuteJsonMethodAsBytes("ReadMeid", "Meid"); // error
            //string Test = CurrentModel.ExecuteJsonMethodAsString("ReadManufacturingData", ""); -> This method is only possible in Label-mode.

            byte[] AsskMask = new byte[0x10] {
                1, 0, 16, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64
            };
            byte[] Challenge = new byte[0x88];
            Dictionary <string, object> Params = new();

            Params.Add("AsskMask", AsskMask);
            Params.Add("Challenge", Challenge);
            Params.Add("AsicIndex", 0);
            byte[] TerminalResponseBytes = CurrentModel.ExecuteJsonMethodAsBytes("TerminalChallenge", Params, "TerminalResponse");
            if (TerminalResponseBytes != null)
            {
                TerminalResponse TerminalResponse = Terminal.Parse(TerminalResponseBytes, 0);
                if (TerminalResponse != null)
                {
                    PublicID = TerminalResponse.PublicId;
                    LogFile.Log("Public ID: " + Converter.ConvertHexToString(PublicID, " "));
                    RootKeyHash = TerminalResponse.RootKeyHash;
                    LogFile.Log("RootKeyHash: " + Converter.ConvertHexToString(RootKeyHash, " "));
                }
            }

            ManufacturerModelName = CurrentModel.ExecuteJsonMethodAsString("ReadManufacturerModelName", "ManufacturerModelName"); // RM-821_eu_denmark_251
            LogFile.Log("Manufacturer Model Name: " + ManufacturerModelName);
            ProductCode = CurrentModel.ExecuteJsonMethodAsString("ReadProductCode", "ProductCode");                               // 059Q9D7
            LogFile.Log("Product Code: " + ProductCode);
            Firmware = CurrentModel.ExecuteJsonMethodAsString("ReadSwVersion", "SwVersion");                                      // 3051.40000.1349.0007
            LogFile.Log("Firmware: " + Firmware);

            IMEI = CurrentModel.ExecuteJsonMethodAsString("ReadSerialNumber", "SerialNumber");        // IMEI
            LogFile.Log("IMEI: " + IMEI);
            BluetoothMac = CurrentModel.ExecuteJsonMethodAsBytes("ReadBtId", "BtId");                 // 6 bytes: bc c6 ...
            LogFile.Log("Bluetooth MAC: " + Converter.ConvertHexToString(BluetoothMac, " "));
            WlanMac = CurrentModel.ExecuteJsonMethodAsBytes("ReadWlanMacAddress", "WlanMacAddress1"); // 6 bytes
            LogFile.Log("WLAN MAC: " + Converter.ConvertHexToString(WlanMac, " "));

            IsBootloaderSecurityEnabled = (bool)CurrentModel.ExecuteJsonMethodAsBoolean("ReadProductionDoneState", "ProductionDone");
            LogFile.Log("Bootloader Security: " + ((bool)IsBootloaderSecurityEnabled ? "Enabled" : "Disabled"));

            Params = new Dictionary <string, object>
            {
                { "ID", 3534 },
                { "NVData", new byte[] { 0 } }
            };
            CurrentModel.ExecuteJsonMethod("WriteNVData", Params); // Error: 150

            Params = new Dictionary <string, object>
            {
                { "ID", 3534 }
            };
            byte[] NV3534 = CurrentModel.ExecuteJsonMethodAsBytes("ReadNVData", Params, "NVData"); // Error: value not written
        }
コード例 #3
0
        private void StartLoadDeviceInfo()
        {
            try
            {
                Operator = CurrentModel.ExecuteJsonMethodAsString("ReadOperatorName", "OperatorName");                                // 000-NL
                LogFile.Log("Operator: " + Operator);
                ManufacturerModelName = CurrentModel.ExecuteJsonMethodAsString("ReadManufacturerModelName", "ManufacturerModelName"); // RM-821_eu_denmark_251
                LogFile.Log("Manufacturer Model Name: " + ManufacturerModelName);
                ProductCode = CurrentModel.ExecuteJsonMethodAsString("ReadProductCode", "ProductCode");                               // 059Q9D7
                LogFile.Log("Product Code: " + ProductCode);
                Firmware = CurrentModel.ExecuteJsonMethodAsString("ReadSwVersion", "SwVersion");                                      // 3051.40000.1349.0007
                LogFile.Log("Firmware: " + Firmware);
                HWID = CurrentModel.ExecuteJsonMethodAsString("ReadHwVersion", "HWVersion");                                          // 1002
                LogFile.Log("HWID: " + HWID);

                IMEI = CurrentModel.ExecuteJsonMethodAsString("ReadSerialNumber", new System.Collections.Generic.Dictionary <string, object>()
                {
                    { "SubscriptionId", 0 }
                }, "SerialNumber");                                                                                                                                                         // IMEI
                string IMEI2 = CurrentModel.ExecuteJsonMethodAsString("ReadSerialNumber", new System.Collections.Generic.Dictionary <string, object>()
                {
                    { "SubscriptionId", 1 }
                }, "SerialNumber");                                                                                                                                                                 // IMEI 2

                if (!string.IsNullOrEmpty(IMEI2))
                {
                    IMEI += "\n" + IMEI2;
                }

                LogFile.Log("IMEI: " + IMEI);
                PublicID = CurrentModel.ExecuteJsonMethodAsBytes("ReadPublicId", "PublicId");              // 0x14 bytes: a5 e5 ...
                LogFile.Log("Public ID: " + Converter.ConvertHexToString(PublicID, " "));
                BluetoothMac = CurrentModel.ExecuteJsonMethodAsBytes("ReadBtId", "BtId");                  // 6 bytes: bc c6 ...
                LogFile.Log("Bluetooth MAC: " + Converter.ConvertHexToString(BluetoothMac, " "));
                WlanMac1 = CurrentModel.ExecuteJsonMethodAsBytes("ReadWlanMacAddress", "WlanMacAddress1"); // 6 bytes
                LogFile.Log("WLAN MAC 1: " + Converter.ConvertHexToString(WlanMac1, " "));
                WlanMac2 = CurrentModel.ExecuteJsonMethodAsBytes("ReadWlanMacAddress", "WlanMacAddress2"); // 6 bytes
                LogFile.Log("WLAN MAC 2: " + Converter.ConvertHexToString(WlanMac2, " "));
                WlanMac3 = CurrentModel.ExecuteJsonMethodAsBytes("ReadWlanMacAddress", "WlanMacAddress3"); // 6 bytes
                LogFile.Log("WLAN MAC 3: " + Converter.ConvertHexToString(WlanMac3, " "));
                WlanMac4 = CurrentModel.ExecuteJsonMethodAsBytes("ReadWlanMacAddress", "WlanMacAddress4"); // 6 bytes
                LogFile.Log("WLAN MAC 4: " + Converter.ConvertHexToString(WlanMac4, " "));

                bool?ProductionDone = CurrentModel.ExecuteJsonMethodAsBoolean("ReadProductionDoneState", "ProductionDone");
                IsBootloaderSecurityEnabled = ProductionDone == null
                    ? CurrentModel.ExecuteJsonMethodAsString("GetSecurityMode", "SecMode").Contains("Restricted", StringComparison.OrdinalIgnoreCase)
                    : CurrentModel.ExecuteJsonMethodAsString("GetSecurityMode", "SecMode").Contains("Restricted", StringComparison.OrdinalIgnoreCase) && (bool)CurrentModel.ExecuteJsonMethodAsBoolean("ReadProductionDoneState", "ProductionDone");

                LogFile.Log("Bootloader Security: " + ((bool)IsBootloaderSecurityEnabled ? "Enabled" : "Disabled"));
                IsSimLocked = CurrentModel.ExecuteJsonMethodAsBoolean("ReadSimlockActive", "SimLockActive");
                LogFile.Log("Simlock: " + ((bool)IsSimLocked ? "Active" : "Unlocked"));

                string BootPolicy = CurrentModel.ExecuteJsonMethodAsString("GetUefiCertificateStatus", "BootPolicy");
                string Db         = CurrentModel.ExecuteJsonMethodAsString("GetUefiCertificateStatus", "Db");
                string Dbx        = CurrentModel.ExecuteJsonMethodAsString("GetUefiCertificateStatus", "Dbx");
                string Kek        = CurrentModel.ExecuteJsonMethodAsString("GetUefiCertificateStatus", "Kek");
                string Pk         = CurrentModel.ExecuteJsonMethodAsString("GetUefiCertificateStatus", "Pk");

                this.BootPolicy = BootPolicy;
                LogFile.Log("Boot policy: " + BootPolicy);
                this.Db = Db;
                LogFile.Log("DB: " + Db);
                this.Dbx = Dbx;
                LogFile.Log("DBX: " + Dbx);
                this.Kek = Kek;
                LogFile.Log("KEK: " + Kek);
                this.Pk = Pk;
                LogFile.Log("PK: " + Pk);
            }
            catch { }
        }