Skip to content

Commit 0ede0f4

Browse files
committed
Initial w3dm support, untested
1 parent 7d6bec6 commit 0ede0f4

File tree

5 files changed

+33
-23
lines changed

5 files changed

+33
-23
lines changed

BNLSProtocol/BNLSParse.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ public class BNLSParse{
8787
* private static final byte PRODUCT_DIABLO = 0x09; //Fully Supported
8888
* private static final byte PRODUCT_DIABLOSHAREWARE = 0x0A; //Fully Supported
8989
* private static final byte PRODUCT_STARCRAFTSHAREWARE = 0x0B; //Fully Supported
90+
* private static final byte PRODUCT_WAR3DEMO = 0x0C; //Fully Supported
9091
*/
9192

9293
/*Flag definitions for BNLS_CDKEY_EX*/

HTTP/HTTPParse.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ public class HTTPParse extends Thread{
7676
" <tr><td class=li>JSTR Checks</td><td class=li><jstr></td><td class=li><jstrvb></td></tr>" + CRLF +
7777
" <tr><td class=li>W3XP Checks</td><td class=li><war3></td><td class=li><war3vb></td></tr>" + CRLF +
7878
" <tr><td class=li>DRTL Checks</td><td class=li><drtl></td><td class=li><drtlvb></td></tr>" + CRLF +
79+
" <tr><td class=li>W3DM Checks</td><td class=li><w3dm></td><td class=li><w3dmvb></td></tr>" + CRLF +
7980
" </table>" + CRLF +
8081
" <table width=550 align=center cellpadding=3 cellspacing=0 border=0>" + CRLF +
8182
" <tr><td align=left colspan=2><span class=subheader>Additional Information</span></td></tr>" + CRLF +
@@ -143,6 +144,7 @@ public void run(){
143144
page = page.replaceAll("<drtl>", String.valueOf(HashMain.CRevChecks[8]));
144145
page = page.replaceAll("<dshr>", String.valueOf(HashMain.CRevChecks[9]));
145146
page = page.replaceAll("<sshr>", String.valueOf(HashMain.CRevChecks[10]));
147+
page = page.replaceAll("<w3dm>", String.valueOf(HashMain.CRevChecks[11]));
146148
page = page.replaceAll("<starvb>", hex(Constants.IX86verbytes[Constants.PRODUCT_STARCRAFT - 1]));
147149
page = page.replaceAll("<w2bnvb>", hex(Constants.IX86verbytes[Constants.PRODUCT_WAR2BNE - 1]));
148150
page = page.replaceAll("<d2dvvb>", hex(Constants.IX86verbytes[Constants.PRODUCT_DIABLO2 - 1]));
@@ -152,6 +154,7 @@ public void run(){
152154
page = page.replaceAll("<drtlvb>", hex(Constants.IX86verbytes[Constants.PRODUCT_DIABLO - 1]));
153155
page = page.replaceAll("<dshrvb>", hex(Constants.IX86verbytes[Constants.PRODUCT_DIABLOSHAREWARE - 1]));
154156
page = page.replaceAll("<sshrvb>", hex(Constants.IX86verbytes[Constants.PRODUCT_STARCRAFTSHAREWARE - 1]));
157+
page = page.replaceAll("<w3dmvb>", hex(Constants.IX86verbytes[Constants.PRODUCT_WAR3DEMO - 1]));
155158
page = page.replaceAll("<auth>", String.valueOf(Constants.requireAuthorization));
156159
page = page.replaceAll("<build>", Constants.build);
157160
page = page.replaceAll("<news>", Constants.strNews[0]+"<br \\>"+Constants.strNews[1]+"<br \\>"+Constants.strNews[2]+"<br \\>"+Constants.strNews[3]+"<br \\>"+Constants.strNews[4]);
@@ -238,7 +241,9 @@ else if(file.equalsIgnoreCase("/DRTL.zip"))
238241
else if(file.equalsIgnoreCase("/DSHR.zip"))
239242
sendHashFile("DSHR", Constants.DSHRfiles);
240243
else if(file.equalsIgnoreCase("/SSHR.zip"))
241-
sendHashFile("SSHR", Constants.SSHRfiles);*/
244+
sendHashFile("SSHR", Constants.SSHRfiles);
245+
else if(file.equalsIgnoreCase("/W3DM.zip"))
246+
sendHashFile("W3DM", Constants.W3DMfiles);*/
242247
else{
243248
send404(file);
244249
}

Hashing/CheckRevisionV1.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,9 @@ public static int getVersion(String[] files, int prod){
336336
int ver = 0;
337337
try{
338338
ver = PE.getVersion(files[0], false);
339-
if(prod == Constants.PRODUCT_WARCRAFT3 || prod == Constants.PRODUCT_THEFROZENTHRONE){
339+
if(prod == Constants.PRODUCT_WARCRAFT3 ||
340+
prod == Constants.PRODUCT_THEFROZENTHRONE ||
341+
prod == Constants.PRODUCT_WAR3DEMO){
340342
ver = (ver & 0xFF000000) >>> 24 |
341343
(ver & 0x00FF0000) >> 8 |
342344
(ver & 0x0000FF00) << 8 |

Hashing/HashMain.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
public class HashMain {
2020

2121
//Only compilied once(as needed), then stored
22-
public static int CRevChecks[] = new int[0x0B];
22+
public static int CRevChecks[] = new int[0x0C];
2323

2424
public static int WAR3KeysHashed=0;
2525
public static int STARKeysHashed=0;

util/Constants.java

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package util;
22

33
public final class Constants{
4-
4+
55
public static final byte PLATFORM_INTEL = 0x01;
66
public static final byte PLATFORM_POWERPC = 0x02;
77
public static final byte PLATFORM_MACOSX = 0x03;
@@ -17,27 +17,29 @@ public final class Constants{
1717
public static final byte PRODUCT_DIABLO = 0x09;
1818
public static final byte PRODUCT_DIABLOSHAREWARE = 0x0A;
1919
public static final byte PRODUCT_STARCRAFTSHAREWARE= 0x0B;
20-
public static String[] prods = {"STAR", "SEXP", "W2BN", "D2DV", "D2XP", "JSTR", "WAR3", "W3XP", "DRTL", "DSHR", "SSHR"};
20+
public static final byte PRODUCT_WAR3DEMO = 0x0C;
21+
public static String[] prods = {"STAR", "SEXP", "W2BN", "D2DV", "D2XP", "JSTR", "WAR3", "W3XP", "DRTL", "DSHR", "SSHR", "W3DM"};
2122
public static String[][] IX86files = {
22-
{"IX86/STAR/", "StarCraft.exe", "Storm.dll", "NULL", "STAR.bin"},
23-
{"IX86/STAR/", "StarCraft.exe", "Storm.dll", "NULL", "STAR.bin"},
24-
{"IX86/W2BN/", "Warcraft II BNE.exe", "Storm.dll", "Battle.snp", "W2BN.bin"},
25-
{"IX86/D2DV/", "Game.exe", "NULL", "NULL", "D2DV.bin"},
26-
{"IX86/D2XP/", "Game.exe", "NULL", "NULL", "D2XP.bin"},
27-
{"IX86/JSTR/", "StarcraftJ.exe", "Storm.dll", "Battle.snp", "JSTR.bin"},
28-
{"IX86/WAR3/", "Warcraft III.exe", "NULL", "NULL", "WAR3.bin"},
29-
{"IX86/WAR3/", "Warcraft III.exe", "NULL", "NULL", "WAR3.bin"},
30-
{"IX86/DRTL/", "Diablo.exe", "Storm.dll", "Battle.snp", "DRTL.bin"},
31-
{"IX86/DSHR/", "Diablo_s.exe", "Storm.dll", "Battle.snp", "DSHR.bin"},
32-
{"IX86/SSHR/", "Starcraft.exe", "Storm.dll", "Battle.snp", "SSHR.bin"}
23+
{"IX86/STAR/", "StarCraft.exe", "Storm.dll", "NULL", "STAR.bin"},
24+
{"IX86/STAR/", "StarCraft.exe", "Storm.dll", "NULL", "STAR.bin"},
25+
{"IX86/W2BN/", "Warcraft II BNE.exe", "Storm.dll", "Battle.snp", "W2BN.bin"},
26+
{"IX86/D2DV/", "Game.exe", "NULL", "NULL", "D2DV.bin"},
27+
{"IX86/D2XP/", "Game.exe", "NULL", "NULL", "D2XP.bin"},
28+
{"IX86/JSTR/", "StarcraftJ.exe", "Storm.dll", "Battle.snp", "JSTR.bin"},
29+
{"IX86/WAR3/", "Warcraft III.exe", "NULL", "NULL", "WAR3.bin"},
30+
{"IX86/WAR3/", "Warcraft III.exe", "NULL", "NULL", "WAR3.bin"},
31+
{"IX86/DRTL/", "Diablo.exe", "Storm.dll", "Battle.snp", "DRTL.bin"},
32+
{"IX86/DSHR/", "Diablo_s.exe", "Storm.dll", "Battle.snp", "DSHR.bin"},
33+
{"IX86/SSHR/", "Starcraft.exe", "Storm.dll", "Battle.snp", "SSHR.bin"},
34+
{"IX86/W3DM/", "War3Demo.exe", "Storm.dll", "Game.dll", "W3DM.bin"}
3335
};
34-
public static int[] IX86verbytes = {0xD3, 0xD3, 0x4f, 0x0e, 0x0e, 0xa9, 0x1E, 0x1E, 0x2a, 0x2a, 0xa5};
36+
public static int[] IX86verbytes = {0xD3, 0xD3, 0x4f, 0x0e, 0x0e, 0xa9, 0x1E, 0x1E, 0x2a, 0x2a, 0xa5, 0x01};
3537
public static String[] IX86versions = {"", "", "2.0.2.1", "1.14.3.71", "1.14.3.71", "", "", "", "2001, 5, 18, 1", "", ""};
3638
public static String[] IX86certs = {"", "", "", "", "", "", "", "", "", "", ""};
37-
39+
3840
public static String ArchivePath = "DLLs/";
3941
public static String LogFilePath = "./Logs/";
40-
42+
4143
public static String build="Build V3.1 Bug Fixes, SQL Stats tracking. (10-14-07)";
4244
//public static String build="Build V3.0 BotNet Admin, Lockdown, Legacy Clients.(07-07-07)";
4345
//public static String build="Build V2.9 Remote admin, extended admin commands w/ JSTR support.(01/18/06)";
@@ -60,7 +62,7 @@ public final class Constants{
6062
public static String BotNetUsername = "";
6163
public static String BotNetPassword = "";
6264
public static String BotNetServer = "www.valhallalegends.com";
63-
65+
6466
public static boolean LogStats = false;
6567
public static String StatsUsername = "";
6668
public static String StatsPassword = "";
@@ -72,12 +74,12 @@ public final class Constants{
7274
public static boolean StatsLogBotIDs = true;
7375
public static boolean StatsLogConns = true;
7476
public static boolean StatsCheckSchema = true;
75-
77+
7678
public static String DownloadPath = "./";
77-
79+
7880
public static boolean RunHTTP = true;
7981
public static int HTTPPort = 81;
80-
82+
8183
public static int lngServerVer=0x01;
8284
public static int numOfNews=0;
8385
public static String[] strNews={"", "", "", "", ""};

0 commit comments

Comments
 (0)