Exemple #1
0
        private void initialisator_DoWork(object sender, DoWorkEventArgs e)
        {
            var filepath = Assembly.GetExecutingAssembly().Location;

            Environment.CurrentDirectory = filepath.Remove(filepath.LastIndexOf(System.IO.Path.DirectorySeparatorChar));

            //initialisator.ReportProgress(0, "Checking for updates");
            //CraftNetTools.AppUpdates.Check();

            initialisator.ReportProgress(0, "Initializing MapleStory AES Keys");
            MapleKeys.Initialize();

            //initialisator.ReportProgress(0, "Loading Script.NET context");
            //ScriptNET.Runtime.RuntimeHost.Initialize();

            initialisator.ReportProgress(0, "Loading packet definitions");
            DefinitionsContainer.Load();

            initialisator.ReportProgress(0, "Loading + 保存配置文件");
            Config.Instance.Save();

            initialisator.ReportProgress(0, "Loading 加在包头配置");
            Config.LoadProperties();

            initialisator.ReportProgress(0, "Registering .msb extension");
            RegisterFileAssociation(".msb", "MapleShark", "MapleShark Binary File", filepath, string.Empty, 0);
        }
Exemple #2
0
        internal MapleAES(ushort pBuild, byte pLocale, byte[] pIV, byte pSubVersion)
        {
            mBuild = pBuild;

            if ((short)pBuild < 0)
            {
                pBuild = (ushort)(0xFFFF - pBuild);
            }

            mAES.Key = MapleKeys.GetKeyForVersion(pLocale, pBuild, pSubVersion) ?? sSecretKey;

            mAES.Mode    = CipherMode.ECB;
            mAES.Padding = PaddingMode.PKCS7;
            mTransformer = mAES.CreateEncryptor();
            mIV          = pIV;
        }
        internal MapleAES(ushort pBuild, byte pLocale, byte[] pIV, byte pSubVersion)
        {
            mBuild = pBuild;

            if ((short)pBuild < 0)
            {
                pBuild = (ushort)(0xFFFF - pBuild);
            }

            // TODO: Only do this when required. It currently does not affect the performance too much, however.
            mAES.Key = MapleKeys.GetKeyForVersion(pLocale, pBuild, pSubVersion) ?? sSecretKey;

            mAES.Mode    = CipherMode.ECB;
            mAES.Padding = PaddingMode.PKCS7;
            mTransformer = mAES.CreateEncryptor();
            mIV          = pIV;
        }