mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-21 12:32:23 +08:00
update
This commit is contained in:
parent
00ac8cb2c6
commit
da0e2e829e
@ -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))
|
||||
}
|
||||
|
||||
|
@ -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)*/
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user