mirror of
https://github.com/raphaeIl/Novaria.git
synced 2025-12-12 14:34:38 +01:00
pcap path "not hardcoded" anymore
This commit is contained in:
@@ -21,7 +21,7 @@ namespace Novaria.Common.Core
|
||||
}
|
||||
|
||||
packetWriter.Write(msgIdBytes.AsSpan<byte>());
|
||||
packetWriter.Write(packet.msgBody.AsSpan<byte>());
|
||||
packetWriter.Write(packet.msgBody.AsSpan<byte>());
|
||||
|
||||
|
||||
byte[] packetData = ((MemoryStream)packetWriter.BaseStream).ToArray();
|
||||
@@ -262,6 +262,8 @@ namespace Novaria.Common.Core
|
||||
msgBody = decrypted_bytes[2..],
|
||||
};
|
||||
|
||||
Utils.PrintByteArray(decrypted_bytes);
|
||||
|
||||
IKEReq ike_request = IKEReq.Parser.ParseFrom(packet.msgBody);
|
||||
|
||||
return ike_request;
|
||||
|
||||
@@ -8,6 +8,7 @@ using Novaria.Common.Util;
|
||||
|
||||
//using Mono.Security.Cryptography;
|
||||
using NSec.Cryptography;
|
||||
using Serilog;
|
||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||
|
||||
namespace Novaria.Common.Crypto
|
||||
@@ -46,15 +47,20 @@ namespace Novaria.Common.Crypto
|
||||
|
||||
FIRST_IKE_KEY = new byte[] { 51, 76, 83, 57, 38, 111, 89, 100, 115, 112, 94, 53, 119, 105, 56, 38, 90, 120, 67, 35, 99, 55, 77, 90, 103, 55, 51, 104, 98, 69, 68, 119 };
|
||||
|
||||
if (clientType == ClientType.Mobile)
|
||||
{
|
||||
FIRST_IKE_KEY = Encoding.ASCII.GetBytes("3LS9&oYdsp^5wi8&ZxC#c7MZg73hbEDw");
|
||||
}
|
||||
//if (clientType == ClientType.Mobile)
|
||||
//{
|
||||
// FIRST_IKE_KEY = Encoding.ASCII.GetBytes("3LS9&oYdsp^5wi8&ZxC#c7MZg73hbEDw");
|
||||
// Log.Information("Mobile Client Type with key:");
|
||||
// Utils.PrintByteArray(FIRST_IKE_KEY);
|
||||
//}
|
||||
|
||||
else
|
||||
{
|
||||
FIRST_IKE_KEY = Encoding.ASCII.GetBytes("#$*;1H&x*)0!@,/OcIe4VbiL[~fLyE7t");
|
||||
}
|
||||
//else
|
||||
//{
|
||||
// FIRST_IKE_KEY = Encoding.ASCII.GetBytes("#$*;1H&x*)0!@,/OcIe4VbiL[~fLyE7t");
|
||||
// Log.Information("PC Client Type with key:");
|
||||
// Utils.PrintByteArray(FIRST_IKE_KEY);
|
||||
//}
|
||||
FIRST_IKE_KEY = Encoding.ASCII.GetBytes("3LS9&oYdsp^5wi8&ZxC#c7MZg73hbEDw");
|
||||
|
||||
associatedData = new byte[13];
|
||||
|
||||
|
||||
@@ -19,11 +19,9 @@ namespace Novaria.PcapParser
|
||||
public int totalPacketsCount = 0;
|
||||
public List<NovaPacket> packets = new List<NovaPacket>();
|
||||
|
||||
private readonly string rootPath = "E:\\documents\\Decompiling\\Extracted\\NOVA\\Novaria\\Novaria.PcapParser\\";
|
||||
|
||||
public void Parse(string pcapFileName, bool auto_key = true)
|
||||
{
|
||||
string pcapJsonFile = File.ReadAllText(rootPath + pcapFileName);
|
||||
string pcapJsonFile = File.ReadAllText($"../../../../Novaria.PcapParser/{pcapFileName}"); // disgusting pathing, but "not hardcoded" now ig
|
||||
var data = System.Text.Json.JsonSerializer.Deserialize<List<PcapPacket>>(pcapJsonFile);
|
||||
|
||||
foreach (PcapPacket packet in data)
|
||||
@@ -90,7 +88,7 @@ namespace Novaria.PcapParser
|
||||
public void SavePackets(string saveFileName)
|
||||
{
|
||||
Console.WriteLine($"Got {packets.Count} packet(s) out a total of {totalPacketsCount}");
|
||||
File.WriteAllText(rootPath + saveFileName, JsonConvert.SerializeObject(packets, Formatting.Indented));
|
||||
File.WriteAllText($"../../../{saveFileName}", JsonConvert.SerializeObject(packets, Formatting.Indented));
|
||||
}
|
||||
|
||||
public IMessage GetPcapPacket(NetMsgId msgId)
|
||||
|
||||
19089
Novaria.PcapParser/parsed_packets.json
Normal file
19089
Novaria.PcapParser/parsed_packets.json
Normal file
File diff suppressed because it is too large
Load Diff
BIN
Novaria.SDKServer/Character
Normal file
BIN
Novaria.SDKServer/Character
Normal file
Binary file not shown.
@@ -102,6 +102,8 @@ namespace Novaria.GameServer.Controllers.Api
|
||||
Request.Body.CopyTo(memoryStream); // Copy request body to MemoryStream
|
||||
byte[] rawPayload = memoryStream.ToArray(); // Get raw bytes from MemoryStream
|
||||
|
||||
Utils.PrintByteArray(rawPayload);
|
||||
|
||||
IKEReq ikeRequest = HttpNetworkManager.Instance.ParseIkeRequest(rawPayload);
|
||||
|
||||
Log.Information("Decoded Packet: " + JsonSerializer.Serialize(ikeRequest));
|
||||
|
||||
@@ -11,6 +11,7 @@ using System.Numerics;
|
||||
using Microsoft.AspNetCore.DataProtection;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using Nova.Client;
|
||||
|
||||
namespace Novaria.GameServer
|
||||
{
|
||||
@@ -18,13 +19,16 @@ namespace Novaria.GameServer
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
byte[] spub = new byte[] { 0, 219, 176, 103, 73, 245, 239, 125, 227, 240, 79, 51, 62, 250, 113, 143, 251, 155, 158, 45, 101, 1, 6, 185, 140, 153, 221, 163, 200, 112, 161, 11, 138, 163, 7, 71, 182, 127, 144, 192, 147, 169, 124, 54, 220, 208, 253, 121, 80, 41, 4, 97, 51, 129, 32, 228, 40, 227, 89, 226, 152, 51, 24, 105, 233, 140, 153, 114, 142, 244, 105, 13, 201, 150, 39, 192, 101, 50, 39, 57, 59, 110, 88, 201, 150, 221, 251, 248, 247, 250, 33, 114, 125, 200, 182, 163, 176 };
|
||||
byte[] cpriv = new byte[] { 10,128,76,30};
|
||||
//byte[] spub = new byte[] { 0, 219, 176, 103, 73, 245, 239, 125, 227, 240, 79, 51, 62, 250, 113, 143, 251, 155, 158, 45, 101, 1, 6, 185, 140, 153, 221, 163, 200, 112, 161, 11, 138, 163, 7, 71, 182, 127, 144, 192, 147, 169, 124, 54, 220, 208, 253, 121, 80, 41, 4, 97, 51, 129, 32, 228, 40, 227, 89, 226, 152, 51, 24, 105, 233, 140, 153, 114, 142, 244, 105, 13, 201, 150, 39, 192, 101, 50, 39, 57, 59, 110, 88, 201, 150, 221, 251, 248, 247, 250, 33, 114, 125, 200, 182, 163, 176 };
|
||||
//byte[] cpriv = new byte[] { 10,128,76,30};
|
||||
|
||||
byte[] res = DiffieHellman.Instance.CalculateKey(spub, cpriv);
|
||||
//byte[] res = DiffieHellman.Instance.CalculateKey(spub, cpriv);
|
||||
|
||||
Utils.PrintByteArray(res);
|
||||
Log.Information("Starting SDK Server...");
|
||||
//Utils.PrintByteArray(res);
|
||||
|
||||
//table_Character table_Character = table_Character.Parser.ParseFrom(File.ReadAllBytes("E:\\documents\\Decompiling\\Extracted\\NOVA\\Novaria\\Novaria.SDKServer\\Character"));
|
||||
|
||||
//Log.Information("Starting SDK Server...");
|
||||
try
|
||||
{
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
Reference in New Issue
Block a user