Skip to content

Commit

Permalink
outside does not DC
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-heinz committed Jan 14, 2022
1 parent 6883f77 commit d28951a
Show file tree
Hide file tree
Showing 11 changed files with 165 additions and 24 deletions.
15 changes: 11 additions & 4 deletions Arrowgene.Ddon.Cli/Command/BruteForceCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public CommandResultType Run(CommandParameter parameter)
BruteForceJson(
"C:\\Users\\railgun\\Downloads\\stream3-party-experiments-marked.pcapng_3_login.json",
100 * 8,
2393
-1
);

return CommandResultType.Continue;
Expand Down Expand Up @@ -89,10 +89,17 @@ private void BruteForceJson(string jsonPath, int threadCount, int ms = -1)

if (ms <= -1)
{
uint min_ms = 60000;
uint startMs = 3 * 59000;
uint endMs = 4 * min_ms;

uint diff = endMs - startMs;
Console.WriteLine(diff);

// need to crack by finding MS
uint depth = 10000u;
uint startMs = 2000;
uint endMs = 10000;
uint depth = 12000;
// uint startMs = 2000;
// uint endMs = 10000;
uint msStep = (uint) (endMs / threadCount);
uint msOffset = startMs;
for (int i = 0; i < threadCount; i++)
Expand Down
22 changes: 13 additions & 9 deletions Arrowgene.Ddon.Cli/Command/PcapDecryptCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.IO;
using System.Text;
using System.Text.Json;
using Arrowgene.Ddon.Cli.Misc;
using Arrowgene.Ddon.PacketLibrary;
using Arrowgene.Ddon.Server;
using Arrowgene.Ddon.Server.Network;
Expand Down Expand Up @@ -79,16 +80,19 @@ public CommandResultType Run(CommandParameter parameter)
private void PrintPackets(List<Packet> packets, string outPath)
{
StringBuilder sb = new StringBuilder();
foreach (Packet packet in packets)
{
string pStr = packet.ToString();
sb.Append(pStr);
sb.Append(Environment.NewLine);
}
// foreach (Packet packet in packets)
// {
// string pStr = packet.ToString();
// sb.Append(pStr);
// sb.Append(Environment.NewLine);
// }



// string dump = PacketDump.DumpCSharpStruc(packets, "GameFull");
File.WriteAllText(outPath, sb.ToString());
Console.WriteLine(sb.ToString());
string dump = PacketDump.DumpCSharpStruc(packets, "Stream85");
File.WriteAllText( outPath+ ".cs", dump);
// File.WriteAllText(outPath, sb.ToString());
// Console.WriteLine(sb.ToString());
}

private List<Packet> Convert(List<PlPacket> plPackets)
Expand Down
6 changes: 5 additions & 1 deletion Arrowgene.Ddon.Cli/Misc/PacketDump.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ public static string DumpCSharpStruc(List<Packet> packets, string name)

public static string DumpCSharpStruc(Packet packet, string name)
{
if (packet.Source == PacketSource.Client)
{
return "";
}
StringBuilder sb = new StringBuilder();
sb.Append(
$"public static byte[] data_{name} = new byte[] /* {packet.Id.GroupId}.{packet.Id.HandlerId}.{packet.Id.HandlerSubId} */");
Expand All @@ -59,7 +63,7 @@ public static string DumpCSharpStruc(Packet packet, string name)
sb.Append("};");
sb.Append(Environment.NewLine);
sb.Append(
$"public static Packet {name} = new Packet(new PacketId({packet.Id.GroupId}, {packet.Id.HandlerId}, {packet.Id.HandlerSubId}, \"{name}\"), data_{name});");
$"public static Packet {name} = new Packet(new PacketId({packet.Id.GroupId}, {packet.Id.HandlerId}, {packet.Id.HandlerSubId}, \"{packet.Id.Name}\"), data_{name});");
sb.Append(Environment.NewLine);

return sb.ToString();
Expand Down
4 changes: 4 additions & 0 deletions Arrowgene.Ddon.GameServer/DdonGameServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ private void LoadPacketHandler()
AddHandler(new ConnectionPingHandler(this));
AddHandler(new ConnectionReserveServerHandler(this));

AddHandler(new ContextGetSetContextHandler(this));
AddHandler(new DailyMissionListGetHandler(this));
AddHandler(new EquipGetCharacterEquipListHandler(this));

Expand All @@ -95,6 +96,9 @@ private void LoadPacketHandler()

AddHandler(new GroupChatGroupChatGetMemberListHandler(this));

AddHandler(new InstanceGetEnemySetListHandler(this));
AddHandler(new InstanceGetItemSetListHandler(this));

AddHandler(new InstanceGetOmInstantKeyValueAllHandler(this));

AddHandler(new ItemGetStorageItemListHandler(this));
Expand Down
38 changes: 38 additions & 0 deletions Arrowgene.Ddon.GameServer/Dump/SelectedDump.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using Arrowgene.Ddon.Server.Network;

namespace Arrowgene.Ddon.GameServer.Dump
{
public class SelectedDump
{
// only the finest dump of the dumpster

public static byte[] data_Dump_93047 = new byte[] /* 13.0.2 */
{
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x8F, 0x0, 0x0, 0x0, 0x0,
0xA, 0x0, 0xC1, 0xA5, 0xB6, 0x67, 0x3, 0x1, 0xB, 0x8, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0,
0x2, 0x4, 0x3, 0x0, 0x0, 0xC, 0x56, 0x0, 0x0, 0x0, 0x0, 0x0, 0x64, 0x0, 0x64, 0x0,
0x0, 0x0, 0x1, 0x0, 0x4, 0x0, 0x0, 0x2, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0
};

public static Packet Dump_93047 = new Packet(new PacketId(13, 0, 2, "S2C_INSTANCE_GET_ENEMY_SET_LIST_RES"), data_Dump_93047);

public static byte[] data_Dump_93283 = new byte[] /* 13.5.2 */
{
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x8F, 0x0, 0x0, 0x0, 0x0,
0xFA, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0xB1, 0xD3, 0x80, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0xA1, 0x0, 0x1, 0x1
};

public static Packet Dump_93283 = new Packet(new PacketId(13, 5, 2, "S2C_INSTANCE_GET_ITEM_SET_LIST_RES"), data_Dump_93283);


public static byte[] data_Dump_1715 = new byte[] /* 35.7.2 */
{
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9F, 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x7, 0xD0, 0x40, 0x1
};

public static Packet Dump_1715 = new Packet(new PacketId(35, 7, 2, "S2C_CONTEXT_GET_SET_CONTEXT_RES"), data_Dump_1715);
}
}
24 changes: 24 additions & 0 deletions Arrowgene.Ddon.GameServer/Handler/ContextGetSetContextHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Arrowgene.Ddon.GameServer.Dump;
using Arrowgene.Ddon.Server.Logging;
using Arrowgene.Ddon.Server.Network;
using Arrowgene.Logging;

namespace Arrowgene.Ddon.GameServer.Handler
{
public class ContextGetSetContextHandler : PacketHandler<GameClient>
{
private static readonly DdonLogger Logger = LogProvider.Logger<DdonLogger>(typeof(ContextGetSetContextHandler));


public ContextGetSetContextHandler(DdonGameServer server) : base(server)
{
}

public override PacketId Id => PacketId.C2S_CONTEXT_GET_SET_CONTEXT_REQ;

public override void Handle(GameClient client, Packet packet)
{
client.Send(SelectedDump.Dump_1715);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Arrowgene.Ddon.GameServer.Dump;
using Arrowgene.Ddon.Server.Logging;
using Arrowgene.Ddon.Server.Network;
using Arrowgene.Logging;

namespace Arrowgene.Ddon.GameServer.Handler
{
public class InstanceGetEnemySetListHandler : PacketHandler<GameClient>
{
private static readonly DdonLogger Logger = LogProvider.Logger<DdonLogger>(typeof(InstanceGetEnemySetListHandler));


public InstanceGetEnemySetListHandler(DdonGameServer server) : base(server)
{
}

public override PacketId Id => PacketId.C2S_INSTANCE_GET_ENEMY_SET_LIST_REQ;

public override void Handle(GameClient client, Packet packet)
{
client.Send(SelectedDump.Dump_93047);
}
}
}
24 changes: 24 additions & 0 deletions Arrowgene.Ddon.GameServer/Handler/InstanceGetItemSetListHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Arrowgene.Ddon.GameServer.Dump;
using Arrowgene.Ddon.Server.Logging;
using Arrowgene.Ddon.Server.Network;
using Arrowgene.Logging;

namespace Arrowgene.Ddon.GameServer.Handler
{
public class InstanceGetItemSetListHandler : PacketHandler<GameClient>
{
private static readonly DdonLogger Logger = LogProvider.Logger<DdonLogger>(typeof(InstanceGetItemSetListHandler));


public InstanceGetItemSetListHandler(DdonGameServer server) : base(server)
{
}

public override PacketId Id => PacketId.C2S_INSTANCE_GET_ITEM_SET_LIST_REQ;

public override void Handle(GameClient client, Packet packet)
{
client.Send(SelectedDump.Dump_93283);
}
}
}
2 changes: 1 addition & 1 deletion Arrowgene.Ddon.WebServer/AccountRoute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public override async Task<WebResponse> Post(WebRequest request)
res.Token = token.Token;
break;
case "create":
Account account = CreateAccount(req.Account, "", req.Password);
Account account = CreateAccount(req.Account, $"{req.Account}@dd.on", req.Password);
if (account == null)
{
res.Error = "Account already exists";
Expand Down
4 changes: 4 additions & 0 deletions Arrowgene.Ddon.WebServer/DdonWebServer.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Threading.Tasks;
using Arrowgene.Ddon.Database;
using Arrowgene.Logging;
using Arrowgene.WebServer;
using Arrowgene.WebServer.Server;
using Arrowgene.WebServer.Server.Kestrel;
Expand All @@ -10,6 +11,8 @@ namespace Arrowgene.Ddon.WebServer
{
public class DdonWebServer
{
private static readonly ILogger Logger = LogProvider.Logger<Logger>(typeof(DdonWebServer));

private readonly WebService _webService;
private readonly WebServerSetting _setting;
private readonly IDatabase _database;
Expand All @@ -33,6 +36,7 @@ public DdonWebServer(WebServerSetting setting)
public async Task Start()
{
await _webService.Start();
Logger.Info($"Running Web Server http://localhost/web/index.html");
}

public async Task Stop()
Expand Down
26 changes: 17 additions & 9 deletions Arrowgene.Ddon.WebServer/Files/www/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@
<body>

<div>
<label><b>Username</b></label>
<input id="input_account" type="text" placeholder="Enter Username">
<label><b>Password</b></label>
<input id="input_password" type="password" placeholder="Enter Password">
<button id="button_login" type="button">Login</button>
<button id="button_create_account" type="button">Create</button>
<div>
<label><b>Username</b></label>
<input id="input_account" type="text" placeholder="Enter Username">
</div>
<div>
<label><b>Password</b></label>
<input id="input_password" type="password" placeholder="Enter Password">
</div>
<div>
<button id="button_login" type="button">Login</button>
<button id="button_create_account" type="button">Create</button>
</div>
</div>

<script>
Expand All @@ -35,7 +41,7 @@
DDON.post(DDON.API_ACCOUNT, data, DDON.onLoginResponse);
},
onLoginResponse: function (data) {
console.log(data);
window.postMessage(data, "*");
},
createAccount: function () {
var data = {
Expand All @@ -46,14 +52,16 @@
DDON.post(DDON.API_ACCOUNT, data, DDON.onCreateAccountResponse);
},
onCreateAccountResponse: function (data) {
console.log(data);
window.postMessage(data, "*");
},
post: function (url, data, cb) {
fetch(url, {
method: 'post',
body: JSON.stringify(data)
}).then(function (response) {
cb(response.json());
return response.json();
}).then(function (json) {
cb(json);
})
},
addClick: function (elementId, cb) {
Expand Down

0 comments on commit d28951a

Please sign in to comment.