Small updates

This commit is contained in:
Him188 2019-10-03 12:56:08 +08:00
parent 7c5c01bb40
commit 41ddd4c2be
4 changed files with 5 additions and 5 deletions

View File

@ -333,7 +333,9 @@ internal class TIMBotNetworkHandler(private val bot: Bot) : BotNetworkHandler {
}
bot.notice("需要验证码登录, 验证码为 4 字母")
try {
File(System.getProperty("user.dir") + "/temp/Captcha.png").writeBytes(this.captchaCache!!)
File(System.getProperty("user.dir") + "/temp/Captcha.png")
.also { withContext(Dispatchers.IO) { it.createNewFile() } }
.writeBytes(this.captchaCache!!)
bot.notice("若看不清字符图片, 请查看 Mirai 目录下 /temp/Captcha.png")
} catch (e: Exception) {
bot.notice("无法写出验证码文件, 请尝试查看以上字符图片")

View File

@ -70,7 +70,6 @@ object TIMProtocol {
* 没有任何地方写入了这个 key
*/
const val shareKey = "1A E9 7F 7D C9 73 75 98 AC 02 E0 80 5F A9 C6 AF"//16
const val fix0836 = "06 A9 12 97 B7 F8 76 25 AF AF D3 EA B4 C8 BC E7 "
const val key00BA = "C1 9C B8 C8 7B 8C 81 BA 9E 9E 7A 89 E1 7A EC 94"
const val key00BAFix = "69 20 D1 14 74 F5 B3 93 E4 D5 02 B3 71 1A CD 2A"

View File

@ -24,7 +24,6 @@ class ServerLoginResponseSuccessPacket(input: DataInputStream) : ServerPacket(in
@Tested
override fun decode() {
this.input.skip(7)//8
this.encryptionKey = this.input.readNBytes(16)//24

View File

@ -31,7 +31,7 @@ class ClientSessionRequestPacket(
writeIP(serverIp)
writeHex("1F 40 00 00 00 00 00 15 00 30 00 01")//fix1
writeHex("01 92 A5 D2 59 00 10 54 2D CF 9B 60 BF BB EC 0D D4 81 CE 36 87 DE 35 02 AE 6D ED DC 00 10 ")
writeHex(TIMProtocol.fix0836)
writeHex("06 A9 12 97 B7 F8 76 25 AF AF D3 EA B4 C8 BC E7")//fix0836
writeHex("00 36 00 12 00 02 00 01 00 00 00 05 00 00 00 00 00 00 00 00 00 00")
writeHex(TIMProtocol.constantData1)
writeHex(TIMProtocol.constantData2)
@ -57,7 +57,7 @@ class ClientSessionRequestPacket(
writeHex("68")
writeHex("00 00 00 00 00 2D 00 06 00 01")
writeIP(InetAddress.getLocalHost().hostAddress)
writeIP(InetAddress.getLocalHost().hostAddress)//todo random to avoid being banned?
}
}
}