Beispiel #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("CFManzana by iSn0wra1n");

            iDevice dev = new iDevice();

            /* Reads various device settings. Values can be
             *
             * ActivationPublicKey
             * ActivationState
             * ActivationStateAcknowledged
             * ActivityURL
             * BasebandBootloaderVersion
             * BasebandSerialNumber
             * BasebandStatus
             * BasebandVersion
             * BluetoothAddress
             * BuildVersion
             * CPUArchitecture
             * DeviceCertificate
             * DeviceClass
             * DeviceColor
             * DeviceName
             * DevicePublicKey
             * DieID
             * FirmwareVersion
             * HardwareModel
             * HardwarePlatform
             * HostAttached
             * IMLockdownEverRegisteredKey
             * IntegratedCircuitCardIdentity
             * InternationalMobileEquipmentIdentity
             * InternationalMobileSubscriberIdentity
             * iTunesHasConnected
             * MLBSerialNumber
             * MobileSubscriberCountryCode
             * MobileSubscriberNetworkCode
             * ModelNumber
             * PartitionType
             * PasswordProtected
             * PhoneNumber
             * ProductionSOC
             * ProductType
             * ProductVersion
             * ProtocolVersion
             * ProximitySensorCalibration
             * RegionInfo
             * SBLockdownEverRegisteredKey
             * SerialNumber
             * SIMStatus
             * SoftwareBehavior
             * SoftwareBundleVersion
             * SupportedDeviceFamilies
             * TelephonyCapability
             * TimeIntervalSince1970
             * TimeZone
             * TimeZoneOffsetFromUTC
             * TrustedHostAttached
             * UniqueChipID
             * UniqueDeviceID
             * UseActivityURL
             * UseRaptorCerts
             * Uses24HourClock
             * WeDelivered
             * WiFiAddress
             * */
            Console.WriteLine("\nDevice Name: " + dev.CopyValue("DeviceName"));
            Console.WriteLine("Device iOS Version: " + dev.CopyValue("ProductVersion"));
            System.Threading.Thread.Sleep(-1);
        }
Beispiel #2
0
        private void activate_btn_Click(object sender, EventArgs e)
        {
            if (Interface.Device == null)
            {
                Interface = new iDevice();
            }
            if (Interface.Device == null)
            {
                lblStatus.Text = "No device connected";
                return;
            }
            if (Interface.CopyValue("ActivationState") != "Unactivated")
            {
                lblStatus.Text = "Device already Activated!";
                return;
            }
            grpCache.Enabled       = false;
            activate_btn.Enabled   = false;
            deactivate_btn.Enabled = false;
            cache_btn.Enabled      = false;
            string response = null;

            lblStatus.Text = "";
            bool useCache = false;

            if (activationdata.Checked == true)
            {
opendialog:
                Open.DefaultExt = "iData";
                Open.Filter     = "Activation Data|*.iData";
                Open.ShowDialog();
                if (Open.FileName == "")
                {
                    MessageBox.Show("Please select a location!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    goto opendialog;
                }
                useCache = true;
            }

            #region Step 1: Get Wildcard ticket
            if (IsConnected() == false)
            {
                lblStatus.Text = "No Internet connection available";
                goto Cleanup;
            }
            lblStatus.Text = "Getting Wildcard ticket from Apple";
            if (useCache == true)
            {
                ThreadStart starter = delegate
                {
                    SslTcpClient.RunClient("albert.apple.com", Albert_Apple_Stuff(Open.FileName), ref response);
                };
                Thread albertThread = new Thread(starter);
                albertThread.Start();
                while (albertThread.IsAlive == true)
                {
                    Application.DoEvents();
                }
            }
            else
            {
                ThreadStart starter = delegate
                {
                    SslTcpClient.RunClient("albert.apple.com", Albert_Apple_Stuff(null), ref response);
                };
                Thread albertThread = new Thread(starter);
                albertThread.Start();
                while (albertThread.IsAlive == true)
                {
                    Application.DoEvents();
                }
            }
            if (response.Contains("ack-received") == true)
            {
                lblStatus.Text = "Invalid response received from Apple";
                goto Cleanup;
            }
            if (response == "" || response == null)
            {
                lblStatus.Text = "No response returned from Apple";
                goto Cleanup;
            }
            #endregion
            #region Step 2: Grab necessary information from Wildcard ticket
            lblStatus.Text = "Grabbing information from the Wildcard ticket";
            IntPtr[] wct = GrabTheData(response);
            #endregion
            #region Step 3: Send Wildcard ticket to the iDevice
            string[] keys = { "AccountTokenCertificate", "AccountToken", "FairPlayKeyData", "DeviceCertificate", "AccountTokenSignature" };
            lblStatus.Text = ("Sending Wildcard ticket to device");
            int status = Interface.Activate(new CFDictionary(keys, wct));
            lblStatus.Text = ("Wildcard ticket sent to device");
            #endregion
            #region Step 4: Check if activation was successful
            if (status != 0)
            {
                lblStatus.Text = "Device could not be activated!";
            }
            else
            {
                lblStatus.Text = "Device successfully activated!";
            }
            #endregion
Cleanup:
            activate_btn.Enabled   = true;
            deactivate_btn.Enabled = true;
            cache_btn.Enabled      = true;
            grpCache.Enabled       = true;
            Open.FileName          = "";
        }