hardcoded sdk, new en keys

This commit is contained in:
raphaeIl
2025-05-27 12:50:00 -04:00
parent dd9c93b5b4
commit 289a4d661d
5 changed files with 136 additions and 64 deletions

View File

@@ -29,12 +29,14 @@ namespace Novaria.Common.Crypto
//public static byte[] PS_PUBLIC_KEY { get => DiffieHellman.Instance.ServerPublicKey.GetBytes(); } //public static byte[] PS_PUBLIC_KEY { get => DiffieHellman.Instance.ServerPublicKey.GetBytes(); }
public static string TOKEN = "seggs"; // hardcoded for now 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_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_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[] 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 DiffieHellmanManaged SendKey;
private static BigInteger p = BigInteger.Parse("1552518092300708935130918131258481755631334049434514313202351194902966239949102107258669453876591642442910007680288864229150803718918046342632727613031282983744380820890196288509170691316593175367469551763119843371637221007210577919"); private static BigInteger p = BigInteger.Parse("1552518092300708935130918131258481755631334049434514313202351194902966239949102107258669453876591642442910007680288864229150803718918046342632727613031282983744380820890196288509170691316593175367469551763119843371637221007210577919");

View File

@@ -8,19 +8,53 @@ namespace Novaria.GameServer.Controllers
[Route("/")] [Route("/")]
public class SDKController : ControllerBase 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")] [HttpPost("user/oauth2/v2/grant")]
public IResult OAuthGrant() public IResult OAuthGrant()
{ {
return Results.Content( return Results.Content(
@" @"
{ {
""msg"": ""夏萝莉是小楠梁"", ""msg"": ""sss"",
""status"": 106, ""status"": 106,
""type"": ""A"" ""type"": ""A""
}", }",
"application/json" "application/json"
); );
} }
[Route("")] [Route("")]
public IResult GetNothing() public IResult GetNothing()
{ {

View File

@@ -7,6 +7,21 @@ namespace Novaria.GameServer.Controllers
[Route("/user")] [Route("/user")]
public class UserController : ControllerBase 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")] [Route("login")]
public IResult PostLogin() public IResult PostLogin()
{ {
@@ -16,14 +31,28 @@ namespace Novaria.GameServer.Controllers
{ {
""Code"": 200, ""Code"": 200,
""Data"": { ""Data"": {
""IsNew"": true, ""AgeVerifyMethod"": 0,
""IsTestAccount"": false, ""IsNew"": 1,
""User"": { ""UserInfo"": {
""DestroyState"": 0, ""ID"": ""69"",
""ID"": 1, ""UID2"": 0,
""PID"": ""CN-NOVA"", ""PID"": ""US-NOVA-TEST"",
""Token"": ""seggs"",
""Birthday"": """",
""RegChannel"": ""pc"",
""TransCode"": """",
""State"": 1, ""State"": 1,
""Token"": ""f94d936f7235f84493564ee0282e845cccd44828"" ""DeviceID"": """",
""CreatedAt"": 1748359959
},
""Yostar"": {
""ID"": ""Y69"",
""Country"": ""US"",
""Nickname"": """",
""Picture"": """",
""State"": 1,
""AgreeAd"": 0,
""CreatedAt"": 1654600174
} }
}, },
""Msg"": ""OK"" ""Msg"": ""OK""
@@ -41,40 +70,42 @@ namespace Novaria.GameServer.Controllers
{ {
""Code"": 200, ""Code"": 200,
""Data"": { ""Data"": {
""Destroy"": { ""AgeVerifyMethod"": 0,
""DestroyAt"": 0 ""Destroy"": null,
},
""Identity"": {
""BirthDate"": """",
""IDCard"": ""123*********34567"",
""PI"": """",
""RealName"": ""**"",
""State"": 1,
""Type"": 0,
""Underage"": false
},
""IsTestAccount"": false, ""IsTestAccount"": false,
""Keys"": [ ""Keys"": [
{ {
""NickName"": ""123****4567"", ""ID"": ""69"",
""Type"": ""mobile"" ""Type"": ""yostar"",
""Key"": ""seggs@gmail.com"",
""NickName"": ""seggs@gmail.com"",
""CreatedAt"": 1654600175
} }
], ],
""User"": { ""ServerNowAt"": 1748359960,
""DestroyState"": 0, ""UserInfo"": {
""ID"": 1, ""ID"": ""69"",
""PID"": ""CN-NOVA"", ""UID2"": 0,
""PID"": ""US-NOVA-TEST"",
""Token"": ""seggs"",
""Birthday"": """",
""RegChannel"": ""pc"",
""TransCode"": """",
""State"": 1, ""State"": 1,
""Token"": ""f94d936f723asdasd5f84493564ee0282e845cccd44828"" ""DeviceID"": """",
""CreatedAt"": 1748359959
}, },
""Yostar"": { ""Yostar"": {
""CreatedAt"": 1735902322, ""ID"": ""Y69"",
""DefaultNickName"": """", ""Country"": ""US"",
""ID"": 1, ""Nickname"": """",
""NickName"": ""seggs"",
""Picture"": """", ""Picture"": """",
""State"": 1 ""State"": 1,
} ""AgreeAd"": 0,
""CreatedAt"": 1654600174
},
""YostarDestroy"": null
}, },
""Msg"": ""OK"" ""Msg"": ""OK""
} }
@@ -88,42 +119,43 @@ namespace Novaria.GameServer.Controllers
{ {
string jsonResponse = @" string jsonResponse = @"
{ {
""Code"": 200, ""Code"": 200,
""Data"": { ""Data"": {
""Destroy"": { ""AgeVerifyMethod"": 0,
""DestroyAt"": 0 ""Destroy"": null,
},
""Identity"": {
""BirthDate"": """",
""IDCard"": ""123*********34567*"",
""PI"": """",
""RealName"": ""**"",
""State"": 1,
""Type"": 0,
""Underage"": false
},
""IsTestAccount"": false, ""IsTestAccount"": false,
""Keys"": [ ""Keys"": [
{ {
""NickName"": ""123****4567"", ""ID"": ""69"",
""Type"": ""mobile"" ""Type"": ""yostar"",
""Key"": ""seggs@gmail.com"",
""NickName"": ""seggs@gmail.com"",
""CreatedAt"": 1654600175
} }
], ],
""User"": { ""ServerNowAt"": 1748359960,
""DestroyState"": 0, ""UserInfo"": {
""ID"": 1, ""ID"": ""69"",
""PID"": ""CN-NOVA"", ""UID2"": 0,
""PID"": ""US-NOVA-TEST"",
""Token"": ""seggs"",
""Birthday"": """",
""RegChannel"": ""pc"",
""TransCode"": """",
""State"": 1, ""State"": 1,
""Token"": ""f9s243e483e3e322138"" ""DeviceID"": """",
""CreatedAt"": 1748359959
}, },
""Yostar"": { ""Yostar"": {
""CreatedAt"": 1, ""ID"": ""Y69"",
""DefaultNickName"": """", ""Country"": ""US"",
""ID"": 1, ""Nickname"": """",
""NickName"": ""seggs"",
""Picture"": """", ""Picture"": """",
""State"": 1 ""State"": 1,
} ""AgreeAd"": 0,
""CreatedAt"": 1654600174
},
""YostarDestroy"": null
}, },
""Msg"": ""OK"" ""Msg"": ""OK""
} }

View File

@@ -47,7 +47,7 @@ namespace Novaria.GameServer.Services
this.LoadCommonBin<T>(bytesFilePath); // after this, loaded table will be in the cache this.LoadCommonBin<T>(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]; return caches[currentTableTypeCache];
} }

View File

@@ -44,7 +44,11 @@ namespace Novaria.PcapParser
public void Parse(string pcapFileName, bool auto_key = true) 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<List<PcapPacket>>(pcapJsonFile); var data = System.Text.Json.JsonSerializer.Deserialize<List<PcapPacket>>(pcapJsonFile);
foreach (PcapPacket packet in data) foreach (PcapPacket packet in data)