Esempio n. 1
0
        void OnApply(BlamLib.BlamVersion v)
        {
            Exception exception = null;

            CheApeInterface.UnlockToolsBase unlocker = null;

            switch (v)
            {
            case BlamLib.BlamVersion.Halo1_CE:
                try                                             { unlocker = new CheApeInterface.UnlockH1(txtPathOutput.Text, txtPathGuerilla.Text, txtPathTool.Text, txtPathSapien.Text); }
                catch (Exception ex)    { exception = ex; }
                break;

            case BlamLib.BlamVersion.Halo2_PC:
                try                                             { unlocker = new CheApeInterface.UnlockH2(txtPathOutput.Text, txtPathGuerilla.Text, txtPathTool.Text, txtPathSapien.Text); }
                catch (Exception ex)    { exception = ex; }
                break;

            default: MessageBox.Show(this, string.Format("the quarter ({0}) isn't under any of the cups you f****n cheater i kill you", cbEngineVersion.SelectedText),
                                     "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (unlocker != null)             // If the unlocker api was initialized OK, run the unlocking operations
            {
                try
                {
                    unlocker.Unlock(false);
                    unlocker.Close();
                }
                catch (Exception ex)    { exception = ex; }
            }

            if (exception != null)
            {
                OnApplyException(v, exception);
            }

            string msg = exception == null ?
                         "CheApe successfully applied!" :
                         "There was an error while trying to apply CheApe. Validate that you selected copies of the original tools and try again.";

            if (unlocker.EncounteredInvalidExe)
            {
                OnApplyMsg(true, "CheApe couldn't be applied to some or all of the exes. Check the debug log for more details");
            }
            else
            {
                OnApplyMsg(exception != null, msg);
            }
        }
Esempio n. 2
0
		void OnApply(BlamLib.BlamVersion v)
		{
			Exception exception = null;
			CheApeInterface.UnlockToolsBase unlocker = null;

			switch(v)
			{
				case BlamLib.BlamVersion.Halo1_CE:
					try						{ unlocker = new CheApeInterface.UnlockH1(txtPathOutput.Text, txtPathGuerilla.Text, txtPathTool.Text, txtPathSapien.Text); }
					catch (Exception ex)	{ exception = ex; }
					break;

				case BlamLib.BlamVersion.Halo2_PC:
					try						{ unlocker = new CheApeInterface.UnlockH2(txtPathOutput.Text, txtPathGuerilla.Text, txtPathTool.Text, txtPathSapien.Text); }
					catch (Exception ex)	{ exception = ex; }
					break;

				default: MessageBox.Show(this, string.Format("the quarter ({0}) isn't under any of the cups you f****n cheater i kill you", cbEngineVersion.SelectedText),
							"Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
					return;
			}

			if (unlocker != null) // If the unlocker api was initialized OK, run the unlocking operations
			{
				try
				{
					unlocker.Unlock(false);
					unlocker.Close();
				}
				catch (Exception ex)	{ exception = ex; }
			}

			if (exception != null)
				OnApplyException(v, exception);

			string msg = exception == null ? 
				"CheApe successfully applied!" :
				"There was an error while trying to apply CheApe. Validate that you selected copies of the original tools and try again.";

			if (unlocker.EncounteredInvalidExe)
				OnApplyMsg(true, "CheApe couldn't be applied to some or all of the exes. Check the debug log for more details");
			else
				OnApplyMsg(exception != null, msg);
		}