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
da0e2e82
Commit
da0e2e82
authored
Aug 18, 2019
by
Him188moe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
00ac8cb2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
9 deletions
+15
-9
mirai-core/src/main/java/net/mamoe/mirai/network/packet/server/login/ServerLoginResponseSucceedPacket.kt
...k/packet/server/login/ServerLoginResponseSucceedPacket.kt
+12
-6
mirai-core/src/main/java/net/mamoe/mirai/network/packet/server/login/ServerLoginResponseVerificationCodePacket.kt
...server/login/ServerLoginResponseVerificationCodePacket.kt
+3
-3
No files found.
mirai-core/src/main/java/net/mamoe/mirai/network/packet/server/login/ServerLoginResponseSucceedPacket.kt
View file @
da0e2e82
...
@@ -9,10 +9,10 @@ import java.io.DataInputStream
...
@@ -9,10 +9,10 @@ import java.io.DataInputStream
/**
/**
* @author Him188moe @ Mirai Project
* @author Him188moe @ Mirai Project
* @author NaturalHG @ Mirai Project
*/
*/
class
ServerLoginResponseSucceedPacket
(
input
:
DataInputStream
,
val
tgtgtKey
:
ByteArray
)
:
ServerPacket
(
input
)
{
class
ServerLoginResponseSucceedPacket
(
input
:
DataInputStream
,
val
tgtgtKey
:
ByteArray
)
:
ServerPacket
(
input
)
{
lateinit
var
_0828_rec_decr_key
:
ByteArray
lateinit
var
_0828_rec_decr_key
:
ByteArray
lateinit
var
nick_length
:
ByteArray
var
age
:
Int
=
0
var
age
:
Int
=
0
var
gender
:
Boolean
=
false
//from 1byte
var
gender
:
Boolean
=
false
//from 1byte
lateinit
var
nick
:
String
lateinit
var
nick
:
String
...
@@ -26,6 +26,7 @@ class ServerLoginResponseSucceedPacket(input: DataInputStream, val tgtgtKey: Byt
...
@@ -26,6 +26,7 @@ class ServerLoginResponseSucceedPacket(input: DataInputStream, val tgtgtKey: Byt
val
decryptedData
=
TEACryptor
.
decrypt
(
TEACryptor
.
decrypt
(
data
,
Protocol
.
shareKey
.
hexToBytes
()),
tgtgtKey
);
val
decryptedData
=
TEACryptor
.
decrypt
(
TEACryptor
.
decrypt
(
data
,
Protocol
.
shareKey
.
hexToBytes
()),
tgtgtKey
);
DataInputStream
(
decryptedData
.
inputStream
()).
let
{
DataInputStream
(
decryptedData
.
inputStream
()).
let
{
//换成 readShort
//换成 readShort
...
@@ -37,13 +38,18 @@ class ServerLoginResponseSucceedPacket(input: DataInputStream, val tgtgtKey: Byt
...
@@ -37,13 +38,18 @@ class ServerLoginResponseSucceedPacket(input: DataInputStream, val tgtgtKey: Byt
else
->
throw
IllegalStateException
()
else
->
throw
IllegalStateException
()
}
}
it
.
skip
(((
514
+
msgLength
)
/
2
-
212
-
2
).
toLong
())
_0828_rec_decr_key
=
it
.
readBytes
(
取文本中间
(
it
,
514
+
msgLength
,
47
))
nick_length
=
it
.
readByte
(
取文本中间
(
it
,
1873
+
msgLength
,
2
))
nick
=
it
.
readBytes
(
取文本中间
(
it
,
1876
+
msgLength
,
3
*
nick_length
-
1
)).
toString
()
age
=
it
.
readShort
(
取文本中间
(
it
,
取文本长度
(
it
)
-
82
,
5
)).
toBoolean
()
age
=
it
.
readShort
(
取文本中间
(
it
,
取文本长度
(
it
)
-
82
,
5
)).
toBoolean
()
gender
=
it
.
readByte
(
取文本中间
(
it
,
取文本长度
(
it
)
-
94
,
2
))
gender
=
it
.
readByte
(
取文本中间
(
it
,
取文本长度
(
it
)
-
94
,
2
))
var
position
=
((
514
+
msgLength
)
/
2
-
212
-
2
).
toLong
();
it
.
skip
(
position
)
_0828_rec_decr_key
=
it
.
readNBytes
(
13
)
it
.
skip
((
1873
+
msgLength
)
/
2
-
position
)
position
+=
(
1873
+
msgLength
)
/
2
nick
=
it
.
readNBytes
(
it
.
readByte
().
toInt
()).
toString
()
clientKey
=
it
.
readBytes
(
取文本中间
(
it
,
484
*
3
+
msgLength
+
1
,
112
*
3
-
1
))
clientKey
=
it
.
readBytes
(
取文本中间
(
it
,
484
*
3
+
msgLength
+
1
,
112
*
3
-
1
))
}
}
...
...
mirai-core/src/main/java/net/mamoe/mirai/network/packet/server/login/ServerLoginResponseVerificationCodePacket.kt
View file @
da0e2e82
package
net.mamoe.mirai.network.packet.server.login
package
net.mamoe.mirai.network.packet.server.login
import
net.mamoe.mirai.network.Protocol
import
net.mamoe.mirai.network.packet.server.ServerPacket
import
net.mamoe.mirai.network.packet.server.ServerPacket
import
java.io.DataInputStream
import
java.io.DataInputStream
...
@@ -14,13 +13,14 @@ class ServerLoginResponseVerificationCodePacket(input: DataInputStream) : Server
...
@@ -14,13 +13,14 @@ class ServerLoginResponseVerificationCodePacket(input: DataInputStream) : Server
var
unknownBoolean
:
Boolean
?
=
null
var
unknownBoolean
:
Boolean
?
=
null
override
fun
decode
()
{
override
fun
decode
()
{
//todo decode 注释的内容
/*
data = 取文本中间(data, 43, 取文本长度(data) - 45)
data = 取文本中间(data, 43, 取文本长度(data) - 45)
data = TeaDecrypt(data, Protocol.shareKey)
data = TeaDecrypt(data, Protocol.shareKey)
verifyCodeLength = HexToDec(取文本中间(data, 235, 5))
verifyCodeLength = HexToDec(取文本中间(data, 235, 5))
verifyCode = 取文本中间(data, 241, verifyCodeLength * 3 - 1)
verifyCode = 取文本中间(data, 241, verifyCodeLength * 3 - 1)
unknownBoolean = 取文本中间(data, 245 + verifyCodeLength * 3 - 1, 2) == "01"
unknownBoolean = 取文本中间(data, 245 + verifyCodeLength * 3 - 1, 2) == "01"
token00BA
=
取文本中间
(
data
,
取文本长度
(
data
)
-
178
,
119
)
token00BA = 取文本中间(data, 取文本长度(data) - 178, 119)
*/
}
}
}
}
\ No newline at end of file
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