From 289a4d661d3f4edb44371eb9ce6a7624a495f705 Mon Sep 17 00:00:00 2001 From: raphaeIl Date: Tue, 27 May 2025 12:50:00 -0400 Subject: [PATCH] hardcoded sdk, new en keys --- Novaria.Common/Crypto/AeadTool.cs | 6 +- .../Controllers/SDKController.cs | 36 ++++- .../Controllers/UserController.cs | 150 +++++++++++------- Novaria.GameServer/Services/TableService.cs | 2 +- Novaria.PcapParser/PcapParser.cs | 6 +- 5 files changed, 136 insertions(+), 64 deletions(-) diff --git a/Novaria.Common/Crypto/AeadTool.cs b/Novaria.Common/Crypto/AeadTool.cs index 4ed39d2..1bd23e5 100644 --- a/Novaria.Common/Crypto/AeadTool.cs +++ b/Novaria.Common/Crypto/AeadTool.cs @@ -29,12 +29,14 @@ namespace Novaria.Common.Crypto //public static byte[] PS_PUBLIC_KEY { get => DiffieHellman.Instance.ServerPublicKey.GetBytes(); } public static string TOKEN = "seggs"; // hardcoded for now - public static readonly byte[] DEFAULT_SERVERLIST_KEY = new byte[] { 74, 72, 42, 67, 80, 51, 50, 57, 89, 120, 111, 103, 81, 74, 69, 120 }; + //public static readonly byte[] DEFAULT_SERVERLIST_KEY = new byte[] { 74, 72, 42, 67, 80, 51, 50, 57, 89, 120, 111, 103, 81, 74, 69, 120 }; public static readonly byte[] DEFAULT_SERVERLIST_IV = new byte[] { 225, 92, 61, 72, 193, 89, 3, 64, 50, 61, 50, 145, 59, 128, 99, 72 }; public static readonly byte[] DEFAULT_AND_IV = new byte[] { 105, 7, 110, 72, 167, 117, 102, 212, 150, 44, 52, 229, 65, 61, 204, 205 }; public static readonly byte[] DEFAULT_WIN_IV = new byte[] { 144, 129, 81, 233, 8, 4, 33, 39, 106, 181, 229, 64, 68, 134, 31, 107 }; - public static readonly byte[] IKE_KEY = Encoding.ASCII.GetBytes("3LS9&oYdsp^5wi8&ZxC#c7MZg73hbEDw"); + public static readonly byte[] DEFAULT_SERVERLIST_KEY = Encoding.ASCII.GetBytes("qPmz8@Pd&F!N38Xm"); + + public static readonly byte[] IKE_KEY = Encoding.ASCII.GetBytes("D&4r2fnroZgBaRmueWyW%A4KL!!@Arvs"); private static DiffieHellmanManaged SendKey; private static BigInteger p = BigInteger.Parse("1552518092300708935130918131258481755631334049434514313202351194902966239949102107258669453876591642442910007680288864229150803718918046342632727613031282983744380820890196288509170691316593175367469551763119843371637221007210577919"); diff --git a/Novaria.GameServer/Controllers/SDKController.cs b/Novaria.GameServer/Controllers/SDKController.cs index ceb4a6c..c9c2a83 100644 --- a/Novaria.GameServer/Controllers/SDKController.cs +++ b/Novaria.GameServer/Controllers/SDKController.cs @@ -8,19 +8,53 @@ namespace Novaria.GameServer.Controllers [Route("/")] public class SDKController : ControllerBase { + [HttpPost("yostar/send-code")] + public IResult SendCode() + { + return Results.Content( +@" +{ + ""Code"": 200, + ""Data"": {}, + ""Msg"": ""OK"" +} +" + , "application/json"); + } + + [HttpPost("yostar/get-auth")] + public IResult GetAuth() + { + return Results.Content( +@" +{ + ""Code"": 200, + ""Data"": { + ""Account"": ""seggs@gmail.com"", + ""Token"": ""sdfsdfsdfsdf"", + ""UID"": ""seggs@gmail.com"" + }, + ""Msg"": ""OK"" +} +" + , "application/json"); + } + + [HttpPost("user/oauth2/v2/grant")] public IResult OAuthGrant() { return Results.Content( @" { - ""msg"": ""夏萝莉是小楠梁"", + ""msg"": ""sss"", ""status"": 106, ""type"": ""A"" }", "application/json" ); } + [Route("")] public IResult GetNothing() { diff --git a/Novaria.GameServer/Controllers/UserController.cs b/Novaria.GameServer/Controllers/UserController.cs index 87528d8..2ca4bbd 100644 --- a/Novaria.GameServer/Controllers/UserController.cs +++ b/Novaria.GameServer/Controllers/UserController.cs @@ -7,6 +7,21 @@ namespace Novaria.GameServer.Controllers [Route("/user")] public class UserController : ControllerBase { + [Route("set")] + public IResult PostSet() + { + Log.Information("post set received!"); + + string jsonResponse = @" +{ + ""Code"": 200, + ""Data"": {}, + ""Msg"": ""OK"" +} +"; + return Results.Text(jsonResponse, "application/json"); + } + [Route("login")] public IResult PostLogin() { @@ -16,14 +31,28 @@ namespace Novaria.GameServer.Controllers { ""Code"": 200, ""Data"": { - ""IsNew"": true, - ""IsTestAccount"": false, - ""User"": { - ""DestroyState"": 0, - ""ID"": 1, - ""PID"": ""CN-NOVA"", + ""AgeVerifyMethod"": 0, + ""IsNew"": 1, + ""UserInfo"": { + ""ID"": ""69"", + ""UID2"": 0, + ""PID"": ""US-NOVA-TEST"", + ""Token"": ""seggs"", + ""Birthday"": """", + ""RegChannel"": ""pc"", + ""TransCode"": """", ""State"": 1, - ""Token"": ""f94d936f7235f84493564ee0282e845cccd44828"" + ""DeviceID"": """", + ""CreatedAt"": 1748359959 + }, + ""Yostar"": { + ""ID"": ""Y69"", + ""Country"": ""US"", + ""Nickname"": """", + ""Picture"": """", + ""State"": 1, + ""AgreeAd"": 0, + ""CreatedAt"": 1654600174 } }, ""Msg"": ""OK"" @@ -41,40 +70,42 @@ namespace Novaria.GameServer.Controllers { ""Code"": 200, ""Data"": { - ""Destroy"": { - ""DestroyAt"": 0 - }, - ""Identity"": { - ""BirthDate"": """", - ""IDCard"": ""123*********34567"", - ""PI"": """", - ""RealName"": ""**"", - ""State"": 1, - ""Type"": 0, - ""Underage"": false - }, + ""AgeVerifyMethod"": 0, + ""Destroy"": null, ""IsTestAccount"": false, ""Keys"": [ { - ""NickName"": ""123****4567"", - ""Type"": ""mobile"" + ""ID"": ""69"", + ""Type"": ""yostar"", + ""Key"": ""seggs@gmail.com"", + ""NickName"": ""seggs@gmail.com"", + ""CreatedAt"": 1654600175 } ], - ""User"": { - ""DestroyState"": 0, - ""ID"": 1, - ""PID"": ""CN-NOVA"", + ""ServerNowAt"": 1748359960, + ""UserInfo"": { + ""ID"": ""69"", + ""UID2"": 0, + ""PID"": ""US-NOVA-TEST"", + ""Token"": ""seggs"", + ""Birthday"": """", + ""RegChannel"": ""pc"", + ""TransCode"": """", ""State"": 1, - ""Token"": ""f94d936f723asdasd5f84493564ee0282e845cccd44828"" + ""DeviceID"": """", + ""CreatedAt"": 1748359959 }, ""Yostar"": { - ""CreatedAt"": 1735902322, - ""DefaultNickName"": """", - ""ID"": 1, - ""NickName"": ""seggs"", + ""ID"": ""Y69"", + ""Country"": ""US"", + ""Nickname"": """", ""Picture"": """", - ""State"": 1 - } + ""State"": 1, + ""AgreeAd"": 0, + ""CreatedAt"": 1654600174 + }, + ""YostarDestroy"": null + }, ""Msg"": ""OK"" } @@ -88,42 +119,43 @@ namespace Novaria.GameServer.Controllers { string jsonResponse = @" { - ""Code"": 200, - ""Data"": { - ""Destroy"": { - ""DestroyAt"": 0 - }, - ""Identity"": { - ""BirthDate"": """", - ""IDCard"": ""123*********34567*"", - ""PI"": """", - ""RealName"": ""**"", - ""State"": 1, - ""Type"": 0, - ""Underage"": false - }, + ""Code"": 200, + ""Data"": { + ""AgeVerifyMethod"": 0, + ""Destroy"": null, ""IsTestAccount"": false, ""Keys"": [ { - ""NickName"": ""123****4567"", - ""Type"": ""mobile"" + ""ID"": ""69"", + ""Type"": ""yostar"", + ""Key"": ""seggs@gmail.com"", + ""NickName"": ""seggs@gmail.com"", + ""CreatedAt"": 1654600175 } ], - ""User"": { - ""DestroyState"": 0, - ""ID"": 1, - ""PID"": ""CN-NOVA"", + ""ServerNowAt"": 1748359960, + ""UserInfo"": { + ""ID"": ""69"", + ""UID2"": 0, + ""PID"": ""US-NOVA-TEST"", + ""Token"": ""seggs"", + ""Birthday"": """", + ""RegChannel"": ""pc"", + ""TransCode"": """", ""State"": 1, - ""Token"": ""f9s243e483e3e322138"" + ""DeviceID"": """", + ""CreatedAt"": 1748359959 }, ""Yostar"": { - ""CreatedAt"": 1, - ""DefaultNickName"": """", - ""ID"": 1, - ""NickName"": ""seggs"", + ""ID"": ""Y69"", + ""Country"": ""US"", + ""Nickname"": """", ""Picture"": """", - ""State"": 1 - } + ""State"": 1, + ""AgreeAd"": 0, + ""CreatedAt"": 1654600174 + }, + ""YostarDestroy"": null }, ""Msg"": ""OK"" } diff --git a/Novaria.GameServer/Services/TableService.cs b/Novaria.GameServer/Services/TableService.cs index ecca62d..3376f86 100644 --- a/Novaria.GameServer/Services/TableService.cs +++ b/Novaria.GameServer/Services/TableService.cs @@ -47,7 +47,7 @@ namespace Novaria.GameServer.Services this.LoadCommonBin(bytesFilePath); // after this, loaded table will be in the cache - logger.LogDebug("{Excel} loaded and cached", type.Name); + Log.Information("{Excel} Table loaded and cached", type.Name); return caches[currentTableTypeCache]; } diff --git a/Novaria.PcapParser/PcapParser.cs b/Novaria.PcapParser/PcapParser.cs index dafd46f..2e288dc 100644 --- a/Novaria.PcapParser/PcapParser.cs +++ b/Novaria.PcapParser/PcapParser.cs @@ -44,7 +44,11 @@ namespace Novaria.PcapParser public void Parse(string pcapFileName, bool auto_key = true) { - string pcapJsonFile = File.ReadAllText($"../Novaria.PcapParser/{pcapFileName}"); // disgusting pathing, but "not hardcoded" now ig + //string pcapJsonFile = File.ReadAllText($"E:\\documents\\Decompiling\\Extracted\\NOVA\\Novaria\\Novaria.PcapParser\\{pcapFileName}"); // disgusting pathing, but "not hardcoded" now ig + string basePath = AppContext.BaseDirectory; + string projectRoot = Path.GetFullPath(Path.Combine(basePath, @"..\..\..\..\")); + string pcapPath = Path.Combine(projectRoot, "Novaria.PcapParser", pcapFileName); + string pcapJsonFile = File.ReadAllText(pcapPath); var data = System.Text.Json.JsonSerializer.Deserialize>(pcapJsonFile); foreach (PcapPacket packet in data)