Esempio n. 1
0
        private void ReplaceBIN(DefineBinaryDataTag binaryTag)
        {
            string binaryDataBody = Encoding.UTF8
                .GetString(binaryTag.BinaryData);

            if (binaryDataBody.Contains("habbo_login_dialog"))
            {
                string realRsaKeys = binaryDataBody
                    .GetChild("name=\"dummy_field\" caption=\"", '"');

                if (string.IsNullOrWhiteSpace(realRsaKeys)) return;
                ExtractRsaKeys(realRsaKeys);

                string fakeRsaKeys = EncodeRsaKeys(
                    HandshakeManager.FAKE_EXPONENT, HandshakeManager.FAKE_MODULUS);

                binaryTag.BinaryData = Encoding.UTF8.GetBytes(
                    binaryDataBody.Replace(realRsaKeys, fakeRsaKeys));

                return;
            }
        }
Esempio n. 2
0
        protected virtual FlashTag ReadTag(FlashReader reader, TagRecord header)
        {
            FlashTag tag = null;
            switch (header.TagType)
            {
                default:
                tag = new UnknownTag(Reader, header);
                break;

                case FlashTagType.DoABC:
                tag = new DoABCTag(Reader, header);
                break;

                case FlashTagType.DefineBitsLossless2:
                tag = new DefineBitsLossless2Tag(Reader, header);
                break;

                case FlashTagType.DefineBinaryData:
                tag = new DefineBinaryDataTag(Reader, header);
                break;
            }

            var character = (tag as ICharacter);
            if (character != null)
            {
                // Add ICharacter tag to the global dictionary.
                Dictionary.Characters[
                    character.CharacterId] = character;
            }
            return tag;
        }