mirror of
https://github.com/mamoe/mirai.git
synced 2025-02-01 20:10:18 +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 Him188moe @ Mirai Project
|
||||||
|
* @author NaturalHG @ Mirai Project
|
||||||
*/
|
*/
|
||||||
class ServerLoginResponseSucceedPacket(input: DataInputStream, val tgtgtKey: ByteArray) : ServerPacket(input) {
|
class ServerLoginResponseSucceedPacket(input: DataInputStream, val tgtgtKey: ByteArray) : ServerPacket(input) {
|
||||||
lateinit var _0828_rec_decr_key: ByteArray
|
lateinit var _0828_rec_decr_key: ByteArray
|
||||||
lateinit var nick_length: ByteArray
|
|
||||||
var age: Int = 0
|
var age: Int = 0
|
||||||
var gender: Boolean = false//from 1byte
|
var gender: Boolean = false//from 1byte
|
||||||
lateinit var nick: String
|
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);
|
val decryptedData = TEACryptor.decrypt(TEACryptor.decrypt(data, Protocol.shareKey.hexToBytes()), tgtgtKey);
|
||||||
|
|
||||||
|
|
||||||
DataInputStream(decryptedData.inputStream()).let {
|
DataInputStream(decryptedData.inputStream()).let {
|
||||||
//换成 readShort
|
//换成 readShort
|
||||||
|
|
||||||
@ -37,13 +38,18 @@ class ServerLoginResponseSucceedPacket(input: DataInputStream, val tgtgtKey: Byt
|
|||||||
else -> throw IllegalStateException()
|
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()
|
age = it.readShort(取文本中间(it, 取文本长度(it) - 82, 5)).toBoolean()
|
||||||
gender = it.readByte(取文本中间(it, 取文本长度(it) - 94, 2))
|
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))
|
clientKey = it.readBytes(取文本中间(it, 484 * 3 + msgLength + 1, 112 * 3 - 1))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package net.mamoe.mirai.network.packet.server.login
|
package net.mamoe.mirai.network.packet.server.login
|
||||||
|
|
||||||
import net.mamoe.mirai.network.Protocol
|
|
||||||
import net.mamoe.mirai.network.packet.server.ServerPacket
|
import net.mamoe.mirai.network.packet.server.ServerPacket
|
||||||
import java.io.DataInputStream
|
import java.io.DataInputStream
|
||||||
|
|
||||||
@ -14,13 +13,14 @@ class ServerLoginResponseVerificationCodePacket(input: DataInputStream) : Server
|
|||||||
var unknownBoolean: Boolean? = null
|
var unknownBoolean: Boolean? = null
|
||||||
|
|
||||||
|
|
||||||
override fun decode() {
|
override fun decode() {//todo decode 注释的内容
|
||||||
|
/*
|
||||||
data = 取文本中间(data, 43, 取文本长度(data) - 45)
|
data = 取文本中间(data, 43, 取文本长度(data) - 45)
|
||||||
data = TeaDecrypt(data, Protocol.shareKey)
|
data = TeaDecrypt(data, Protocol.shareKey)
|
||||||
|
|
||||||
verifyCodeLength = HexToDec(取文本中间(data, 235, 5))
|
verifyCodeLength = HexToDec(取文本中间(data, 235, 5))
|
||||||
verifyCode = 取文本中间(data, 241, verifyCodeLength * 3 - 1)
|
verifyCode = 取文本中间(data, 241, verifyCodeLength * 3 - 1)
|
||||||
unknownBoolean = 取文本中间(data, 245 + verifyCodeLength * 3 - 1, 2) == "01"
|
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