Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Mirai
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Mirai
Commits
a6959672
Commit
a6959672
authored
Aug 17, 2019
by
Him188moe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
3e451344
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
10 deletions
+15
-10
mirai-core/src/main/java/net/mamoe/mirai/network/packet/client/Client0825ResponsePacket.kt
...e/mirai/network/packet/client/Client0825ResponsePacket.kt
+1
-1
mirai-core/src/main/java/net/mamoe/mirai/network/packet/client/Client0836_622Packet.kt
...mamoe/mirai/network/packet/client/Client0836_622Packet.kt
+9
-4
mirai-core/src/main/java/net/mamoe/mirai/network/packet/client/ClientHeartbeatPacket.kt
...amoe/mirai/network/packet/client/ClientHeartbeatPacket.kt
+2
-1
mirai-core/src/main/java/net/mamoe/mirai/network/packet/client/ClientLoginPacket.kt
...et/mamoe/mirai/network/packet/client/ClientLoginPacket.kt
+1
-1
mirai-core/src/main/java/net/mamoe/mirai/network/packet/client/ClientPacket.kt
...ava/net/mamoe/mirai/network/packet/client/ClientPacket.kt
+2
-3
No files found.
mirai-core/src/main/java/net/mamoe/mirai/network/packet/client/Client0825ResponsePacket.kt
View file @
a6959672
...
...
@@ -10,7 +10,7 @@ import java.io.IOException
* @author Him188moe @ Mirai Project
*/
@ExperimentalUnsignedTypes
@PacketId
(
0
x08_25_31_02
)
@PacketId
(
"08 25 31 02"
)
class
Client0825ResponsePacket
(
private
val
serverIP
:
String
,
private
val
qq
:
Int
)
:
ClientPacket
()
{
@ExperimentalUnsignedTypes
override
fun
encode
()
{
...
...
mirai-core/src/main/java/net/mamoe/mirai/network/packet/client/Client0836_622Packet.kt
View file @
a6959672
...
...
@@ -14,10 +14,15 @@ import java.net.InetAddress
*/
@PacketId
(
"08 36"
)
@ExperimentalUnsignedTypes
class
Client0836_622Packet
(
private
val
qq
:
Int
,
private
val
password
:
String
,
private
val
tgtgtKey
:
ByteArray
,
private
val
seq
:
String
,
private
val
token0825
:
ByteArray
)
:
ClientPacket
()
{
class
Client0836_622Packet
(
private
val
qq
:
Int
,
private
val
password
:
String
,
private
val
loginTime
:
ByteArray
,
private
val
loginIP
:
ByteArray
,
private
val
tgtgtKey
:
ByteArray
,
private
val
seq
:
String
,
private
val
token0825
:
ByteArray
)
:
ClientPacket
()
{
@ExperimentalUnsignedTypes
override
fun
encode
()
{
this
.
writeHex
(
seq
)
this
.
writeQQ
(
qq
)
this
.
writeHex
(
Protocol
.
_0836_622_fix1
)
this
.
writeHex
(
Protocol
.
publicKey
)
this
.
writeHex
(
"00 00 00 10"
)
this
.
writeHex
(
Protocol
.
_0836key1
)
//TEA 加密
this
.
write
(
TEACryptor
.
encrypt
(
object
:
ClientPacket
()
{
...
...
@@ -37,7 +42,7 @@ class Client0836_622Packet(private val qq: Int, private val password: String, pr
this
.
writeQQ
(
qq
)
this
.
writeHex
(
"00 06"
)
//tag
this
.
writeHex
(
"00 78"
)
//length
this
.
writeTLV0006
(
qq
,
password
)
this
.
writeTLV0006
(
qq
,
password
,
loginTime
,
loginIP
,
tgtgtKey
)
//fix
this
.
writeHex
(
Protocol
.
_0836_622_fix2
)
this
.
writeHex
(
"00 1A"
)
//tag
...
...
@@ -88,7 +93,7 @@ class Client0836_622Packet(private val qq: Int, private val password: String, pr
writeLong
(
getCrc32
(
it
))
//todo may be int? check that.
}
}
}.
encodeToByteArray
(),
Protocol
.
redirection
Key
.
hexToBytes
()))
}.
encodeToByteArray
(),
Protocol
.
share
Key
.
hexToBytes
()))
}
...
...
mirai-core/src/main/java/net/mamoe/mirai/network/packet/client/ClientHeartbeatPacket.kt
View file @
a6959672
...
...
@@ -8,7 +8,8 @@ import java.io.IOException
/**
* @author Him188moe @ Mirai Project
*/
@PacketId
(
0
x00_58
)
@ExperimentalUnsignedTypes
@PacketId
(
"00 58"
)
class
ClientHeartbeatPacket
:
ClientPacket
()
{
var
qq
:
Int
=
0
var
sessionKey
:
ByteArray
?
=
null
//登录后获得
...
...
mirai-core/src/main/java/net/mamoe/mirai/network/packet/client/ClientLoginPacket.kt
View file @
a6959672
...
...
@@ -11,7 +11,7 @@ import java.io.IOException
* @author Him188moe @ Mirai Project
*/
@ExperimentalUnsignedTypes
@PacketId
(
0
x08_25_31_01
)
@PacketId
(
"08 25 31 01"
)
class
ClientLoginPacket
:
ClientPacket
()
{
var
qq
:
Int
=
0
...
...
mirai-core/src/main/java/net/mamoe/mirai/network/packet/client/ClientPacket.kt
View file @
a6959672
...
...
@@ -85,11 +85,10 @@ fun DataOutputStream.writeTLV0006(qq: Int, password: String, loginTime: ByteArra
it
.
writeHex
(
Protocol
.
_0825data2
)
it
.
writeHex
(
"00 00 01"
)
val
md5_1
:
ByteArray
=
md5
(
password
);
val
md5_1
=
md5
(
password
);
val
md5_2
=
md5
(
md5_1
+
"00 00 00 00"
.
hexToBytes
()
+
qq
.
toBytes
())
it
.
write
(
md5_1
)
it
.
write
(
loginTime
)
//
FIXED 12(maybe 11???) bytes
it
.
write
(
loginTime
)
//
todo FIXED 12(maybe 11???) bytes??? check that
it
.
writeByte
(
0
);
it
.
writeZero
(
4
*
3
)
it
.
write
(
loginIP
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment