This commit is contained in:
Him188moe 2019-08-17 22:09:26 +08:00
parent 145b856611
commit 011417249f
7 changed files with 41 additions and 10 deletions

View File

@ -11,7 +11,7 @@ import io.netty.channel.socket.nio.NioSocketChannel
import io.netty.handler.codec.bytes.ByteArrayDecoder
import io.netty.handler.codec.bytes.ByteArrayEncoder
import net.mamoe.mirai.network.packet.client.ClientPacket
import net.mamoe.mirai.network.packet.client.ClientServerRedirectionPacket
import net.mamoe.mirai.network.packet.client.login.ClientServerRedirectionPacket
import net.mamoe.mirai.network.packet.client.writeHex
import net.mamoe.mirai.network.packet.server.Server0825Packet
import net.mamoe.mirai.network.packet.server.ServerPacket

View File

@ -0,0 +1,11 @@
package net.mamoe.mirai.network.packet.client
/**
* @author Him188moe @ Mirai Project
*/
@ExperimentalUnsignedTypes
class ClientSendMessagePacket : ClientPacket() {
override fun encode() {
}
}

View File

@ -1,7 +1,11 @@
package net.mamoe.mirai.network.packet.client
package net.mamoe.mirai.network.packet.client.login
import net.mamoe.mirai.network.Protocol
import net.mamoe.mirai.network.packet.PacketId
import net.mamoe.mirai.network.packet.client.ClientPacket
import net.mamoe.mirai.network.packet.client.writeHex
import net.mamoe.mirai.network.packet.client.writeQQ
import net.mamoe.mirai.network.packet.client.writeRandom
import net.mamoe.mirai.util.TEACryptor
import java.io.IOException
@ -9,7 +13,7 @@ import java.io.IOException
* @author Him188moe @ Mirai Project
*/
@ExperimentalUnsignedTypes
@PacketId("00 58")
@PacketId("00 58")//todo check
class ClientHeartbeatPacket : ClientPacket() {
var qq: Int = 0
var sessionKey: ByteArray? = null//登录后获得

View File

@ -1,7 +1,8 @@
package net.mamoe.mirai.network.packet.client
package net.mamoe.mirai.network.packet.client.login
import net.mamoe.mirai.network.Protocol
import net.mamoe.mirai.network.packet.PacketId
import net.mamoe.mirai.network.packet.client.*
import net.mamoe.mirai.util.TEACryptor
import net.mamoe.mirai.util.getCrc32
import net.mamoe.mirai.util.getRandomKey
@ -14,7 +15,7 @@ import java.net.InetAddress
*
* @author Him188moe @ Mirai Project
*/
@PacketId("08 36 31 03")
@PacketId("08 36 31 03")//may be 08 36, 31 03 has another meaning
@ExperimentalUnsignedTypes
class ClientPasswordSubmissionPacket(private val qq: Int, private val password: String, private val loginTime: ByteArray, private val loginIP: ByteArray, private val tgtgtKey: ByteArray, private val token0825: ByteArray) : ClientPacket() {
@ExperimentalUnsignedTypes
@ -81,7 +82,7 @@ class ClientPasswordSubmissionPacket(private val qq: Int, private val password:
this.writeHex("01 02")//tag
this.writeHex("00 62")//length
this.writeHex("00 01")//word?
this.writeHex("00 01")//word
this.writeHex("04 EB B7 C1 86 F9 08 96 ED 56 84 AB 50 85 2E 48")//key
this.writeHex("00 38")//length
//value

View File

@ -1,7 +1,11 @@
package net.mamoe.mirai.network.packet.client
package net.mamoe.mirai.network.packet.client.login
import net.mamoe.mirai.network.Protocol
import net.mamoe.mirai.network.packet.PacketId
import net.mamoe.mirai.network.packet.client.ClientPacket
import net.mamoe.mirai.network.packet.client.writeHex
import net.mamoe.mirai.network.packet.client.writeIp
import net.mamoe.mirai.network.packet.client.writeQQ
import net.mamoe.mirai.util.TEACryptor
import net.mamoe.mirai.util.hexToBytes
import java.io.IOException

View File

@ -1,18 +1,26 @@
package net.mamoe.mirai.network.packet.client
package net.mamoe.mirai.network.packet.client.login
import net.mamoe.mirai.network.Protocol
import net.mamoe.mirai.network.packet.PacketId
import net.mamoe.mirai.network.packet.client.ClientPacket
import net.mamoe.mirai.network.packet.client.writeHex
import net.mamoe.mirai.network.packet.client.writeIp
import net.mamoe.mirai.network.packet.client.writeQQ
import net.mamoe.mirai.util.ByteArrayDataOutputStream
import net.mamoe.mirai.util.TEACryptor
import net.mamoe.mirai.util.toHexString
import java.io.IOException
/**
* The packet to touch server.
*
* @see net.mamoe.mirai.network.packet.server.Server0825Packet
*
* @author Him188moe @ Mirai Project
*/
@ExperimentalUnsignedTypes
@PacketId("08 25 31 01")
class ClientLoginPacket : ClientPacket() {
class ClientTouchPacket : ClientPacket() {
var qq: Int = 0
@ExperimentalUnsignedTypes
@ -49,7 +57,7 @@ class ClientLoginPacket : ClientPacket() {
@ExperimentalUnsignedTypes
fun main() {
val pk = ClientLoginPacket()
val pk = ClientTouchPacket()
pk.qq = 1994701021
pk.encode()
pk.writeHex(Protocol.tail)

View File

@ -6,6 +6,9 @@ import java.io.DataInputStream
/**
* A packet received when logging in, used to redirect server address
*
* @see net.mamoe.mirai.network.packet.client.login.ClientServerRedirectionPacket
* @see net.mamoe.mirai.network.packet.client.login.ClientPasswordSubmissionPacket
*
* @author Him188moe @ Mirai Project
*/
class Server0825Packet(private val type: Type, inputStream: DataInputStream) : ServerPacket(inputStream) {