Exemple #1
0
        public OicqRequest(ushort command, ushort subCommand, uint uin,
                           OicqEncryptMethod method, OicqRequestBody body,
                           byte[] shareKey, byte[] randKey, byte[] publicKey)
            : base()
        {
            this.uin          = uin;
            oicqVersion       = 8001;
            oicqCommand       = command;
            oicqSubCommand    = subCommand;
            oicqRequestBody   = body;
            oicqEncryptMethod = method;

            PutByte(0x02); // 頭部 0x02
            {
                EnterBarrier(Prefix.Uint16, Endian.Big, 4);
                {
                    PutUshortBE(oicqVersion);
                    PutUshortBE(oicqCommand);
                    PutUshortBE(1);
                    PutUintBE(this.uin);
                    PutByte(0x03);
                    PutByte((byte)method);
                    PutByte(0x00); // 永遠0
                    PutUintBE(2);
                    PutUintBE(AppInfo.appClientVersion);
                    PutUintBE(0);

                    PutOicqRequestBody(oicqRequestBody, shareKey, randKey, publicKey);
                }
                LeaveBarrier();
            }
            PutByte(0x03); // 尾部 0x03
        }
Exemple #2
0
 private void PutOicqRequestBody(OicqRequestBody body, byte[] shareKey,
                                 byte[] randKey, byte[] publicKey)
 {
     PutUshortBE(0x0101);
     PutBytes(randKey);
     PutUshortBE(0x0102);
     PutBytes(publicKey);
     PutPacketEncrypted(body, TeaCryptor.Instance, shareKey);
 }
Exemple #3
0
 private void TakeOicqRequestBody(out OicqRequestBody body, byte[] shareKey)
 {
     body = new OicqRequestBody(TakeBytes(out byte[] _, RemainLength - 1), shareKey);
 }