This commit is contained in:
Him188moe 2019-08-18 15:47:56 +08:00
parent 00ac8cb2c6
commit da0e2e829e
2 changed files with 15 additions and 9 deletions

View File

@ -9,10 +9,10 @@ import java.io.DataInputStream
/**
* @author Him188moe @ Mirai Project
* @author NaturalHG @ Mirai Project
*/
class ServerLoginResponseSucceedPacket(input: DataInputStream, val tgtgtKey: ByteArray) : ServerPacket(input) {
lateinit var _0828_rec_decr_key: ByteArray
lateinit var nick_length: ByteArray
var age: Int = 0
var gender: Boolean = false//from 1byte
lateinit var nick: String
@ -26,6 +26,7 @@ class ServerLoginResponseSucceedPacket(input: DataInputStream, val tgtgtKey: Byt
val decryptedData = TEACryptor.decrypt(TEACryptor.decrypt(data, Protocol.shareKey.hexToBytes()), tgtgtKey);
DataInputStream(decryptedData.inputStream()).let {
//换成 readShort
@ -37,13 +38,18 @@ class ServerLoginResponseSucceedPacket(input: DataInputStream, val tgtgtKey: Byt
else -> throw IllegalStateException()
}
it.skip(((514 + msgLength) / 2 - 212 - 2).toLong())
_0828_rec_decr_key = it.readBytes(取文本中间(it, 514 + msgLength, 47))
nick_length = it.readByte(取文本中间(it, 1873 + msgLength, 2))
nick = it.readBytes(取文本中间(it, 1876 + msgLength, 3 * nick_length - 1)).toString()
age = it.readShort(取文本中间(it, 取文本长度(it) - 82, 5)).toBoolean()
gender = it.readByte(取文本中间(it, 取文本长度(it) - 94, 2))
var position = ((514 + msgLength) / 2 - 212 - 2).toLong();
it.skip(position)
_0828_rec_decr_key = it.readNBytes(13)
it.skip((1873 + msgLength) / 2 - position)
position += (1873 + msgLength) / 2
nick = it.readNBytes(it.readByte().toInt()).toString()
clientKey = it.readBytes(取文本中间(it, 484 * 3 + msgLength + 1, 112 * 3 - 1))
}

View File

@ -1,6 +1,5 @@
package net.mamoe.mirai.network.packet.server.login
import net.mamoe.mirai.network.Protocol
import net.mamoe.mirai.network.packet.server.ServerPacket
import java.io.DataInputStream
@ -14,13 +13,14 @@ class ServerLoginResponseVerificationCodePacket(input: DataInputStream) : Server
var unknownBoolean: Boolean? = null
override fun decode() {
override fun decode() {//todo decode 注释的内容
/*
data = 取文本中间(data, 43, 取文本长度(data) - 45)
data = TeaDecrypt(data, Protocol.shareKey)
verifyCodeLength = HexToDec(取文本中间(data, 235, 5))
verifyCode = 取文本中间(data, 241, verifyCodeLength * 3 - 1)
unknownBoolean = 取文本中间(data, 245 + verifyCodeLength * 3 - 1, 2) == "01"
token00BA = 取文本中间(data, 取文本长度(data) - 178, 119)
token00BA = 取文本中间(data, 取文本长度(data) - 178, 119)*/
}
}