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
e1c8a6a0
Commit
e1c8a6a0
authored
Aug 18, 2019
by
Him188moe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
9ad74927
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
1 deletion
+16
-1
mirai-core/src/main/java/net/mamoe/mirai/network/packet/server/ServerPacket.kt
...ava/net/mamoe/mirai/network/packet/server/ServerPacket.kt
+1
-1
mirai-core/src/main/java/net/mamoe/mirai/network/packet/server/login/ServerLoginResponseVerificationCodePacket.kt
...server/login/ServerLoginResponseVerificationCodePacket.kt
+14
-0
mirai-core/src/main/java/net/mamoe/mirai/util/TEACryptor.java
...i-core/src/main/java/net/mamoe/mirai/util/TEACryptor.java
+1
-0
No files found.
mirai-core/src/main/java/net/mamoe/mirai/network/packet/server/ServerPacket.kt
View file @
e1c8a6a0
...
@@ -86,7 +86,7 @@ fun DataInputStream.readIP(): String {
...
@@ -86,7 +86,7 @@ fun DataInputStream.readIP(): String {
return
buff
return
buff
}
}
fun
DataInputStream
.
readVarString
(
length
:
Int
):
String
{
fun
DataInputStream
.
readVarString
(
length
:
Int
):
String
{
return
String
(
this
.
readNBytes
(
length
))
return
String
(
this
.
readNBytes
(
length
))
}
}
...
...
mirai-core/src/main/java/net/mamoe/mirai/network/packet/server/login/ServerLoginResponseVerificationCodePacket.kt
View file @
e1c8a6a0
package
net.mamoe.mirai.network.packet.server.login
package
net.mamoe.mirai.network.packet.server.login
import
net.mamoe.mirai.network.packet.server.ServerPacket
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
import
java.io.DataInputStream
/**
/**
...
@@ -23,4 +26,15 @@ class ServerLoginResponseVerificationCodePacket(input: DataInputStream) : Server
...
@@ -23,4 +26,15 @@ class ServerLoginResponseVerificationCodePacket(input: DataInputStream) : Server
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)*/
}
}
}
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
mirai-core/src/main/java/net/mamoe/mirai/util/TEACryptor.java
View file @
e1c8a6a0
...
@@ -9,6 +9,7 @@ import java.util.Random;
...
@@ -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
* @author iweiz https://github.com/iweizime/StepChanger/blob/master/app/src/main/java/me/iweizi/stepchanger/qq/Cryptor.java
*/
*/
public
class
TEACryptor
{
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_0825KEY
=
new
TEACryptor
(
Protocol
.
Companion
.
hexToBytes
(
Protocol
.
_0825key
));
public
static
final
TEACryptor
CRYPTOR_00BAKEY
=
new
TEACryptor
(
Protocol
.
Companion
.
hexToBytes
(
Protocol
.
_00BaKey
));
public
static
final
TEACryptor
CRYPTOR_00BAKEY
=
new
TEACryptor
(
Protocol
.
Companion
.
hexToBytes
(
Protocol
.
_00BaKey
));
...
...
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