mirror of
https://github.com/raphaeIl/Novaria.git
synced 2025-12-15 16:04:48 +01:00
basic PcapParser
This commit is contained in:
@@ -46,7 +46,7 @@ namespace Novaria.SDKServer.Controllers.Api
|
||||
NetMsgId msgid = (NetMsgId)requestPacket.msgId;
|
||||
Log.Information("Received protocol msgid: " + msgid);
|
||||
|
||||
Type requestType = protocolHandlerFactory.GetRequestPacketTypeByProtocol(msgid);
|
||||
Type requestType = ProtocolHandlerFactory.GetRequestPacketTypeByProtocol(msgid);
|
||||
|
||||
if (requestType is null)
|
||||
{
|
||||
|
||||
@@ -21,7 +21,6 @@ namespace Novaria.SDKServer.Controllers.Api.ProtocolHandlers
|
||||
{
|
||||
public object? Invoke(NetMsgId protocol, IMessage? req);
|
||||
public MethodInfo? GetProtocolHandler(NetMsgId protocol);
|
||||
public Type? GetRequestPacketTypeByProtocol(NetMsgId protocol);
|
||||
public void RegisterInstance(Type t, object? inst);
|
||||
}
|
||||
|
||||
@@ -621,8 +620,13 @@ namespace Novaria.SDKServer.Controllers.Api.ProtocolHandlers
|
||||
return handler;
|
||||
}
|
||||
|
||||
public Type? GetRequestPacketTypeByProtocol(NetMsgId msgId)
|
||||
public static Type? GetRequestPacketTypeByProtocol(NetMsgId msgId)
|
||||
{
|
||||
if (!ProtocolHandlerFactory.NetMsgIdToNameMappings.ContainsKey((short)msgId))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
string msgIdClassName = ProtocolHandlerFactory.NetMsgIdToNameMappings[(short)msgId];
|
||||
|
||||
Type packetClassType = Assembly.GetAssembly(typeof(LoginReq))!.GetTypes().Where(x => x.Name == msgIdClassName).SingleOrDefault();
|
||||
|
||||
@@ -17,34 +17,6 @@ namespace Novaria.SDKServer
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
// BigInteger p = BigInteger.Parse("1552518092300708935130918131258481755631334049434514313202351194902966239949102107258669453876591642442910007680288864229150803718918046342632727613031282983744380820890196288509170691316593175367469551763119843371637221007210577919");
|
||||
// BigInteger g = 2;
|
||||
|
||||
// byte[] cprivBytes = new byte[] { 40, 155, 225, 54 }.Reverse().ToArray();
|
||||
// BigInteger cpriv = new BigInteger(cprivBytes);
|
||||
|
||||
// byte[] spubBytes = new byte[] {
|
||||
// 100, 141, 208, 69, 213, 140, 78, 33, 138, 99, 79, 253, 190, 117, 15, 56,
|
||||
// 17, 222, 37, 150, 138, 74, 93, 159, 17, 17, 178, 23, 44, 140, 32, 73,
|
||||
// 170, 24, 92, 31, 123, 53, 174, 72, 7, 70, 248, 248, 223, 0, 69, 92,
|
||||
// 72, 152, 30, 173, 95, 36, 76, 19, 213, 82, 134, 122, 182, 190, 153, 145,
|
||||
// 5, 116, 66, 91, 123, 140, 191, 23, 162, 169, 48, 142, 252, 184, 200, 25,
|
||||
// 94, 34, 174, 238, 100, 171, 37, 30, 65, 63, 37, 106, 127, 116, 168, 36
|
||||
//}.Reverse().ToArray();
|
||||
// BigInteger spub = new BigInteger(spubBytes);
|
||||
|
||||
// BigInteger secret = BigInteger.ModPow(spub, cpriv, p);
|
||||
|
||||
// Utils.PrintByteArray(secret.ToByteArray(true, true)[..32]);
|
||||
|
||||
//byte[] cpriv = new byte[] { 40, 155, 225, 54 };
|
||||
//byte[] spub = new byte[] { 176, 163, 182, 200, 125, 114, 33, 250, 247, 248, 251, 221, 150, 201, 88, 110, 59, 57, 39, 50, 101, 192, 39, 150, 201, 13, 105, 244, 142, 114, 153, 140, 233, 105, 24, 51, 152, 226, 89, 227, 40, 228, 32, 129, 51, 97, 4, 41, 80, 121, 253, 208, 220, 54, 124, 169, 147, 192, 144, 127, 182, 71, 7, 163, 138, 11, 161, 112, 200, 163, 221, 153, 140, 185, 6, 1, 101, 45, 158, 155, 251, 143, 113, 250, 62, 51, 79, 240, 227, 125, 239, 245, 73, 103, 176, 219, 0 };
|
||||
|
||||
//byte[] result = DiffieHellman.Instance.CalculateKey(spub);
|
||||
|
||||
//Utils.PrintByteArray(result);
|
||||
|
||||
//return;
|
||||
Log.Information("Starting SDK Server...");
|
||||
try
|
||||
{
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
<EFBFBD>\=H<>Y@2=2<>;<3B>cH<63><48>&9<>S<EFBFBD><53><EFBFBD>B<EFBFBD>o<EFBFBD>{g<><67>8<EFBFBD>3<EFBFBD><33>R<<0F><>N<EFBFBD><0F><>/<1E><>_<EFBFBD><5F><EFBFBD>
|
||||
@@ -1,3 +0,0 @@
|
||||
<EFBFBD><EFBFBD>d<EFBFBD>
|
||||
'<27><1A>!<21>15L<35>M<EFBFBD>m<EFBFBD>P<EFBFBD><50><0F>}n1<6E><31>b
|
||||
㏐<EFBFBD>&<26><08><><EFBFBD><EFBFBD>u<g<>Ui<55>OP1C<31><43><EFBFBD><EFBFBD>#<23>뱇<1D>Ht<48><0E> <20><>EZ<15>j<EFBFBD>MlZ<6C>B<EFBFBD>{<13>m<EFBFBD>tKY'V<>d<EFBFBD><64>?<3F><>ߨ<EFBFBD><DFA8>Lf<4C><66>:`W<>
|
||||
@@ -1,3 +0,0 @@
|
||||
<EFBFBD><EFBFBD>d<EFBFBD>
|
||||
'<27><1A>!<21>15L<35>M<EFBFBD>m<EFBFBD>P<EFBFBD><50><0F>}n1<6E><31>b
|
||||
㏐<EFBFBD>&<26><08><><EFBFBD><EFBFBD>u<g<>Ui<55>OP1C<31><43><EFBFBD><EFBFBD>#<23>뱇<1D>Ht<48><0E> <20><>EZ<15>j<EFBFBD>MlZ<6C>B<EFBFBD>{<13>m<EFBFBD>tKY'V<>d<EFBFBD><64>?<3F><>ߨ<EFBFBD><DFA8>Lf<4C><66>:`W<>
|
||||
@@ -1,2 +0,0 @@
|
||||
<15><>GsQ<>xK!P]<5D><1D>kl<6B><6C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>b6&J<1E><><EFBFBD>q-<12>H<EFBFBD>ߺ<EFBFBD>8<EFBFBD>Qi<51><69><EFBFBD><EFBFBD><EFBFBD>B4<42>_<EFBFBD><5F>UH<55>H<><48>/z*Q<>Xu<58><75>/<2F>[Hؽ<17>Y<EFBFBD>@<40><1F>JQc&HsV<73><56><11><>& <20><>H<EFBFBD><0B>
|
||||
<EFBFBD>$P<><50>e<><65>v<EFBFBD>y<>åV<C3A5> |,|<7C>n<14><><EFBFBD><EFBFBD>v<EFBFBD><76>/i<>aSq<53>S.<2E>4<EFBFBD><34>ߝ<EFBFBD><DF9D>*d!
|
||||
Binary file not shown.
Binary file not shown.
@@ -1 +0,0 @@
|
||||
<EFBFBD>bJ<EFBFBD>6|<12>><3E>Od<4F>.<2E>æ<>ADW<44>Q<>i[<5B>
|
||||
Reference in New Issue
Block a user