This commit is contained in:
Him188moe 2019-08-18 17:17:43 +08:00
parent 8937239e40
commit baec0a2bda
2 changed files with 4 additions and 4 deletions

View File

@ -87,7 +87,7 @@ class Robot(val number: Int, private val password: String) {
}
is ServerLoginResponseSucceedPacket -> {
is ServerLoginResponseSuccessPacket -> {
this._0828_rec_decr_key = packet._0828_rec_decr_key
sendPacket(ClientLoginSucceedConfirmationPacket(this.number, this.serverIP, this.md5_32, packet.token38, packet.token88, packet.encryptionKey, this.tlv0105))
}

View File

@ -12,7 +12,7 @@ import java.io.DataInputStream
* @author Him188moe @ Mirai Project
* @author NaturalHG @ Mirai Project
*/
class ServerLoginResponseSucceedPacket(input: DataInputStream) : ServerPacket(input) {
class ServerLoginResponseSuccessPacket(input: DataInputStream) : ServerPacket(input) {
lateinit var _0828_rec_decr_key: ByteArray
var age: Int = 0
var gender: Boolean = false//from 1byte
@ -54,9 +54,9 @@ class ServerLoginResponseSucceedPacketEncrypted(input: DataInputStream) : Server
}
@ExperimentalUnsignedTypes
fun decrypt(tgtgtKey: ByteArray): ServerLoginResponseSucceedPacket {//todo test
fun decrypt(tgtgtKey: ByteArray): ServerLoginResponseSuccessPacket {//todo test
this.input.skip(14)
return ServerLoginResponseSucceedPacket(TEACryptor.decrypt(TEACryptor.decrypt(this.input.readAllBytes().let { it.copyOfRange(0, it.size - 1) }, Protocol.shareKey.hexToBytes()), tgtgtKey).dataInputStream());
return ServerLoginResponseSuccessPacket(TEACryptor.decrypt(TEACryptor.decrypt(this.input.readAllBytes().let { it.copyOfRange(0, it.size - 1) }, Protocol.shareKey.hexToBytes()), tgtgtKey).dataInputStream());
//TeaDecrypt(取文本中间(data, 43, 取文本长度(data) 45), m_0828_rec_decr_key)
}
}