Commit e1c8a6a0 authored by Him188moe's avatar Him188moe

update

parent 9ad74927
......@@ -86,7 +86,7 @@ fun DataInputStream.readIP(): String {
return buff
}
fun DataInputStream.readVarString(length:Int): String{
fun DataInputStream.readVarString(length: Int): String {
return String(this.readNBytes(length))
}
......
package net.mamoe.mirai.network.packet.server.login
import net.mamoe.mirai.network.packet.server.ServerPacket
import net.mamoe.mirai.network.packet.server.dataInputStream
import net.mamoe.mirai.network.packet.server.goto
import net.mamoe.mirai.util.TEACryptor
import java.io.DataInputStream
/**
......@@ -24,3 +27,14 @@ class ServerLoginResponseVerificationCodePacket(input: DataInputStream) : Server
token00BA = 取文本中间(data, 取文本长度(data) - 178, 119)*/
}
}
class ServerLoginResponseVerificationCodePacketEncrypted(input: DataInputStream) : ServerPacket(input) {
override fun decode() {
}
fun decrypt(): ServerLoginResponseVerificationCodePacket {
this.input goto 14
return ServerLoginResponseVerificationCodePacket(TEACryptor.CRYPTOR_SHARE_KEY.decrypt(this.input.readAllBytes().let { it.copyOfRange(0, it.size - 1) }).dataInputStream())
}
}
\ No newline at end of file
......@@ -9,6 +9,7 @@ import java.util.Random;
* @author iweiz https://github.com/iweizime/StepChanger/blob/master/app/src/main/java/me/iweizi/stepchanger/qq/Cryptor.java
*/
public class TEACryptor {
public static final TEACryptor CRYPTOR_SHARE_KEY = new TEACryptor(Protocol.Companion.hexToBytes(Protocol.shareKey));
public static final TEACryptor CRYPTOR_0825KEY = new TEACryptor(Protocol.Companion.hexToBytes(Protocol._0825key));
public static final TEACryptor CRYPTOR_00BAKEY = new TEACryptor(Protocol.Companion.hexToBytes(Protocol._00BaKey));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment