Added gitignore and fixed packets not decrypting

This commit is contained in:
ayy lmao 2022-04-25 10:27:22 +03:00
parent 3661d44dd9
commit fe36ab77a3
2 changed files with 58 additions and 3 deletions

55
.gitignore vendored Normal file
View File

@ -0,0 +1,55 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
# TypeScript v1 declaration files
typings/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
package-lock.json
# User data
captures
GenshinData

View File

@ -119,9 +119,9 @@ async function processMHYPacket(packet) {
let packetID = recv.readUInt16BE(2);
if (packetID == PACKET_GetPlayerTokenRsp) {
var proto = await MHYbuf.dataToProtobuffer(MHYbuf.removeMagic(recv), "GetPlayerTokenRsp")
log.debug(proto.secretKey.toString())
log.debug(proto.secretKeySeed.toString())
let initgen = new MT19937_64();
initgen.seed(BigInt(proto.secretKey));
initgen.seed(BigInt(proto.secretKeySeed));
let generator = new MT19937_64();
generator.seed(initgen.int64());
generator.int64();
@ -389,7 +389,7 @@ function getSessionStatus() {
}
async function updateProxyIP(ip, port) {
if (Session.proxy && proxyIP !== ip || Session.proxy && proxyPort !== port) {
if (Session.proxy && config.UdpTargetIP !== ip || Session.proxy && config.UdpTargetPort !== port) {
log.refresh('Relaunching proxy with an updated IP and port...')
await stopProxySession();
startProxySession(undefined, ip, port);