mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-21 12:32:23 +08:00
reset
This commit is contained in:
parent
a3c51a6022
commit
0b6f4a271d
@ -7,6 +7,7 @@ import net.mamoe.mirai.network.packet.server.readVarString
|
||||
import net.mamoe.mirai.util.TEACryptor
|
||||
import net.mamoe.mirai.util.hexToBytes
|
||||
import net.mamoe.mirai.util.hexToShort
|
||||
import net.mamoe.mirai.util.toHexString
|
||||
import java.io.DataInputStream
|
||||
|
||||
/**
|
||||
@ -18,7 +19,6 @@ class ServerLoginResponseSuccessPacket(input: DataInputStream, val packetDataLen
|
||||
var age: Short = 0
|
||||
var gender: Int = 0//from 1byte
|
||||
lateinit var nick: String
|
||||
lateinit var clientKey: ByteArray
|
||||
|
||||
lateinit var token38: ByteArray
|
||||
lateinit var token88: ByteArray
|
||||
@ -32,44 +32,47 @@ class ServerLoginResponseSuccessPacket(input: DataInputStream, val packetDataLen
|
||||
|
||||
encryptionKey = this.input.readNBytes(16)//24
|
||||
|
||||
this.input.skip(1)//25
|
||||
this.input.skip(2)//25->26
|
||||
|
||||
token38 = this.input.readNBytes(56)//81
|
||||
token38 = this.input.readNBytes(56)//81->82
|
||||
|
||||
this.input.skip(61L)//142
|
||||
this.input.skip(60L)//142
|
||||
|
||||
val msgLength = when (this.input.readShort()) {
|
||||
"01 07".hexToShort() -> 0
|
||||
"00 33".hexToShort() -> 28 * 3
|
||||
"01 10".hexToShort() -> 64 * 3
|
||||
//??
|
||||
var b = this.input.readNBytes(2)
|
||||
val msgLength = when (b.toUByteArray().toHexString()) {
|
||||
"01 07" -> 0
|
||||
"00 33" -> 28
|
||||
"01 10" -> 65
|
||||
else -> throw IllegalStateException()
|
||||
}//144
|
||||
|
||||
|
||||
System.out.println(msgLength)
|
||||
|
||||
this.input.skip(17L + msgLength)//161+msgLength
|
||||
|
||||
this.input.mark(113)//161+msgLength
|
||||
|
||||
clientKey = this.input.readNBytes(112)//273+msgLength
|
||||
|
||||
this.input.reset()//161+msgLength
|
||||
|
||||
this.input.skip(10)//171+msgLength
|
||||
|
||||
this._0828_rec_decr_key = this.input.readNBytes(16)//187+msgLength
|
||||
_0828_rec_decr_key = this.input.readNBytes(16)//187+msgLength
|
||||
|
||||
this.input.skip(2)//189+msgLength
|
||||
|
||||
token88 = this.input.readNBytes(136)//325+msgLength
|
||||
this.input.skip(2)
|
||||
|
||||
token88 = this.input.readNBytes(136)//325+ // msgLength
|
||||
|
||||
this.input.skip(299L)//624+msgLength
|
||||
|
||||
//varString (nickLength bytes)
|
||||
val nickLength = this.input.readByte().toUByte().toInt()//625+msgLength
|
||||
val nickLength = this.input.readByte().toInt()//625+msgLength
|
||||
|
||||
System.out.println(nickLength)
|
||||
|
||||
nick = this.input.readVarString(nickLength)//625+msgLength+nickLength
|
||||
|
||||
val dataIndex = packetDataLength - 31
|
||||
|
||||
/*
|
||||
this.input.skip((dataIndex - (625 + msgLength + nickLength)) + 0L)//-31
|
||||
|
||||
gender = this.input.readByte().toUByte().toInt()//-30
|
||||
@ -77,6 +80,9 @@ class ServerLoginResponseSuccessPacket(input: DataInputStream, val packetDataLen
|
||||
this.input.skip(9)//-27
|
||||
|
||||
age = this.input.readShort()//-25
|
||||
*/
|
||||
age = 0
|
||||
gender = 0
|
||||
|
||||
/*
|
||||
age = HexToDec(取文本中间(data, 取文本长度(data) - 82, 5))
|
||||
|
@ -73,6 +73,6 @@ public class HaxComparator {
|
||||
|
||||
|
||||
public static void main(String[] args){
|
||||
System.out.println(HaxComparator.compare("AA CC AA DD EE FF","AA CC AA DD EE GG HH"));
|
||||
System.out.println(HaxComparator.compare("00 01 09 00 70 00 01 23 7B FE 83 D1 37 64 46 84 9D E9 9C E7 BB 8E 44 00 38 9B A4 3B C2 BB 49 4C DA B0 A5 5C C8 27 29 74 EF CB 38 59 4E 03 C8 15 C6 F9 BF 3F 88 22 7E 22 5B 48 02 71 59 1A 2C C8 42 BA 81 76 66 0C 46 91 89 6C B2 17 BF 2A 00 F8 8B 00 20 7C 28 07 3D AA 24 EF B4 49 9D 85 7F 4C F5 41 56 F4 1F AD 53 81 9F C1 03 F3 03 65 DD 0C 04 CC 68 00 00 01 03 00 14 00 01 00 10 60 C9 5D A7 45 70 04 7F 21 7D 84 50 5C 66 A5 C6","AA CC AA DD EE GG HH"));
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
import net.mamoe.mirai.network.packet.server.login.ServerLoginResponseSuccessPacket
|
||||
import net.mamoe.mirai.util.hexToBytes
|
||||
import net.mamoe.mirai.util.toHexString
|
||||
import java.io.DataInputStream
|
||||
|
||||
@ExperimentalUnsignedTypes
|
||||
@ -16,9 +17,19 @@ fun main(){
|
||||
|
||||
// val packet = ClientPasswordSubmissionPacket(1994701021,"xiaoqqq",)
|
||||
|
||||
val data = "00 01 09 00 70 00 01 23 7B FE 83 D1 37 64 46 84 9D E9 9C E7 BB 8E 44 00 38 9B A4 3B C2 BB 49 4C DA B0 A5 5C C8 27 29 74 EF CB 38 59 4E 03 C8 15 C6 F9 BF 3F 88 22 7E 22 5B 48 02 71 59 1A 2C C8 42 BA 81 76 66 0C 46 91 89 6C B2 17 BF 2A 00 F8 8B 00 20 7C 28 07 3D AA 24 EF B4 49 9D 85 7F 4C F5 41 56 F4 1F AD 53 81 9F C1 03 F3 03 65 DD 0C 04 CC 68 00 00 01 03 00 14 00 01 00 10 60 C9 5D A7 45 70 04 7F 21 7D 84 50 5C 66 A5 C6 01 07 01 D3 00 01 00 16 00 00 00 01 00 00 00 64 00 00 0D FD 00 09 3A 80 00 00 00 3C 00 02 68 6E 6A 38 6A 50 36 71 43 72 60 2A 5A 29 72 3D 00 88 00 04 5D 59 19 96 B7 5F F8 D4 00 00 00 00 00 78 B9 8D 0C 93 E9 54 A1 D4 5A E8 44 84 F9 A6 47 58 BB 32 8F 97 A1 40 70 B7 49 30 60 04 15 D4 4F D1 E0 52 53 20 8F 16 4E 02 2E 36 0C E5 4A 64 41 80 84 C6 15 74 16 37 BC 59 7B 19 EA ED A2 20 61 79 03 24 75 12 80 D5 87 47 09 52 53 5C 99 DA 89 A9 AB B4 35 43 B8 86 92 7F D9 53 04 10 9E 9E CC 4F FE 7F B3 67 CF 39 C9 9B 74 B9 16 CC 4E 71 27 E2 51 FB 5E 30 6A A6 34 BB 4A 74 5A 47 48 28 24 69 79 6D 2D 63 35 32 40 35 00 78 00 01 5D 59 19 96 00 70 0F 3E 2C E5 BC 62 C6 C3 0A 06 01 DB 81 C5 73 BE B0 6A D0 2F 36 E5 F4 0E E2 EC 50 03 0E 7B 30 9A 38 F7 82 87 F7 65 AE E9 FE 98 82 49 A5 E6 9F E7 46 71 C3 9F 69 BD 13 08 65 3F 78 3F 57 7B 14 B3 BE 74 87 1B F6 C3 FC E9 A2 78 4E FE E2 7C 0A DD DD 38 E9 52 25 79 8A 8A CF 25 B0 E2 62 65 B8 A5 95 ED AC 48 B7 D6 2E AA A8 6A C3 FF 56 E3 7F 0F 00 83 01 3C 78 52 35 69 24 68 3F 76 55 25 37 60 43 40 64 00 70 00 01 5D 59 19 96 00 68 BA BF 74 0D 6D E6 81 FF 63 B5 EB A3 44 A8 3F 9E 25 36 D0 B3 29 14 24 5A 34 17 32 88 4D F6 96 4D 8A 4F 6B 00 45 CF AD 0A 17 74 C9 75 45 98 1F 20 E0 CD 89 32 21 7B 3C 60 9E AE 2B EE 23 2C 87 F2 C8 30 9F CD 93 1E 07 A5 5C 67 F3 71 01 9D 86 BB B5 0F 3E ED AB 39 F4 09 C4 8C 0A DD 65 04 A9 9E 3E 97 08 BE 40 4C 66 56 70 5F 45 47 6A 5E 4D 36 38 29 34 53 3D 3B 2C 52 01 08 00 29 00 01 00 25 00 1D 02 5B 14 28 E0 B9 91 E2 80 A2 CC 80 CF 89 E2 80 A2 CC 81 E0 B9 91 29 02 13 80 02 00 05 00 04 00 00 00 01 01 15 00 10 1C 57 7F 1B BF 9C 97 09 79 30 5C 17 43 B9 A2 FC"
|
||||
val data = "00 01 09 00 70 00 01 B8 51 6F CD 6A 1B 27 7B 76 41 68 F3 BA 33 7F 73 00 38 35 3E 7C 76 37 D4 AD A1 2C E0 C7 23 9A 44 0D 2C 38 53 9F 94 80 E1 20 B9 2F F5 9F 80 3A 8C CB F6 1E 54 3D 09 12 B9 6A FA DB E3 02 63 A9 E1 5A 2C EE 02 39 10 AF 4B 3F 74 00 20 BF AC F4 D7 4F BD 5A 33 1E 08 3E BE D0 E7 61 79 F4 79 14 9D C9 24 67 01 67 AB 7B 23 94 E8 42 A7 00 00 01 03 00 14 00 01 00 10 60 C9 5D A7 45 70 04 7F 21 7D 84 50 5C 66 A5 C6 01 10 00 3C 00 01 00 38 8A 51 0A CC 9D D6 AC A6 BA BA 32 0E 4E E8 04 28 F9 33 E3 2A D5 0A 99 13 14 C0 DE DA 3C 01 B6 CB 58 5C 5F E0 4B 0C C4 1C 1F 28 36 DC 6A B0 6E CE AF 0B D1 17 AD 4B C3 BD 01 07 01 D3 00 01 00 16 00 00 00 01 00 00 00 64 00 00 0D CE 00 09 3A 80 00 00 00 3C 00 02 67 35 45 62 5B 35 2C 46 7D 47 48 5F 52 70 5F 38 00 88 00 04 5D 59 1F DD B7 5F F8 D4 00 00 00 00 00 78 4A 9E EB 20 77 9C D0 02 98 85 9A 48 EA 05 11 AC F4 25 4C 7C 1F E2 18 CD 78 EF 22 07 8D FD E8 51 23 29 CF 64 97 DC E2 1B 3E 99 00 54 37 F8 35 8F 70 0A CB 7C CD 74 6C 9C 3D 81 32 C6 9B 8A B4 16 D2 41 0D B3 27 CC C7 F9 07 71 EB 6D FD 75 2F 95 75 31 21 D5 22 39 16 FA F6 14 3C 10 81 20 21 E4 31 D2 A3 A4 49 EB EC DA AC 38 0C 27 C9 3F 8A A4 0C 32 58 56 E4 70 47 AB 6A 3E 28 57 2E 55 45 24 56 69 69 43 51 27 2C 71 00 78 00 01 5D 59 1F DD 00 70 98 9E 49 87 39 20 2A 9E 75 28 3D D5 05 9C AF 0F 60 BC 95 2E B9 CF 86 E6 C6 54 FD E7 CF EA 1E 1A 2E E2 99 DE EB CC FF 39 11 6E 5C 8C 17 E0 E4 7E DD 55 CF 09 F7 EA 1A 9E AF CB BC 36 E0 B8 7A 9E 47 34 68 61 E9 1E A0 29 AE 17 A2 EA A6 72 3D 5D 6B 8A 22 A2 1C 24 B8 B2 A0 00 56 11 A9 12 B3 31 D6 3A 2D 5A C0 21 D2 52 56 14 C1 8F EE D9 2B C3 00 83 01 66 33 7A 39 39 32 79 40 49 37 42 4B 62 5E 7B 68 00 70 00 01 5D 59 1F DD 00 68 04 49 23 69 F2 FC C3 81 DC F1 D8 E6 AE E7 69 C9 78 EB EB 90 B1 B4 42 DC DD 1D EF 87 30 72 36 20 1E B6 89 5B AF A5 88 25 60 B7 E3 66 30 D4 0A E5 D9 FA 74 2C 18 E2 26 6C DC F7 42 38 21 23 25 08 57 45 2F 4B BF BF 83 9F CA C5 04 5C 7A 97 8C 4B 1B 6F F7 EE A7 5D 4C 94 B2 CF F6 8D 32 00 21 46 9B C6 9D C5 4B 75 32 19 5E 3D 51 32 3A 79 55 71 25 5F 4B 6B 4A 6E 5D 27 01 08 00 29 00 01 00 25 00 1D 02 5B 14 28 E0 B9 91 E2 80 A2 CC 80 CF 89 E2 80 A2 CC 81 E0 B9 91 29 02 13 80 02 00 05 00 04 00 00 00 01 01 15 00 10 A0 D6 11 4B 1F 12 26 55 0D 21 1D BB 53 5B 4E 12"
|
||||
val s = DataInputStream(data.hexToBytes().inputStream())
|
||||
val packet = ServerLoginResponseSuccessPacket(s,(data.length+1)/3)
|
||||
packet.decode()
|
||||
|
||||
System.out.println("0828key: \n" + packet._0828_rec_decr_key.toUByteArray().toHexString(" "))
|
||||
|
||||
System.out.println("token88: \n" + packet.token88.toUByteArray().toHexString(" "))
|
||||
|
||||
System.out.println("token38: \n" + packet.token38.toUByteArray().toHexString(" "))
|
||||
|
||||
System.out.println("enckey: \n" + packet.encryptionKey.toUByteArray().toHexString(" "))
|
||||
|
||||
System.out.println("nick: " + packet.nick)
|
||||
|
||||
System.out.println(packet._0828_rec_decr_key)
|
||||
}
|
Loading…
Reference in New Issue
Block a user