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 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");

View File

@@ -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()
{

View File

@@ -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""
}

View File

@@ -47,7 +47,7 @@ namespace Novaria.GameServer.Services
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];
}

View File

@@ -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<List<PcapPacket>>(pcapJsonFile);
foreach (PcapPacket packet in data)