Skip to content

Commit

Permalink
STAR and SEXP no longer require keys
Browse files Browse the repository at this point in the history
  • Loading branch information
carlbennett committed Mar 29, 2017
1 parent 5a4c8cb commit 49c3c80
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 18 deletions.
Binary file modified .BNRBot.rbuistate
Binary file not shown.
4 changes: 2 additions & 2 deletions BNRBot.rbvcp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ Folder=Resources;src/Resources;&h794A17FF;&h18062FFF;false
Folder=Windows;src/Windows;&h3DC777FF;&h18062FFF;false
MajorVersion=2
MinorVersion=8
SubVersion=10
NonRelease=73
SubVersion=11
NonRelease=74
Release=3
InfoVersion=Battle.Net Realbasic Bot
LongVersion=(C) 2016 Carl Bennett
Expand Down
2 changes: 0 additions & 2 deletions src/Modules/Globals.rbbas
Original file line number Diff line number Diff line change
Expand Up @@ -1631,8 +1631,6 @@ Protected Module Globals
Function NeedsCDKey(Product As UInt32) As Boolean

Select Case Product
Case Packets.BNETProduct_STAR
Case Packets.BNETProduct_SEXP
Case Packets.BNETProduct_JSTR
Case Packets.BNETProduct_D2DV
Case Packets.BNETProduct_D2XP
Expand Down
29 changes: 15 additions & 14 deletions src/Modules/Packets.rbbas
Original file line number Diff line number Diff line change
Expand Up @@ -3157,14 +3157,14 @@ Protected Module Packets
End If

Dim CDKeys(), TempKey As String
Dim NeedsKey1, NeedsKey2 As Boolean

NeedsKey1 = Globals.NeedsCDKey(Sock.Product)
NeedsKey2 = Globals.NeedsCDKeyExpansion(Sock.Product)

// CD-Key decrypting begins here.
// Exclude any products that don't use CD-Keys now.
If Sock.Product <> Packets.BNETProduct_W3DM And _ // Warcraft III Demo
Sock.Product <> Packets.BNETProduct_CHAT And _ // Telnet
Sock.Product <> Packets.BNETProduct_DRTL And _ // Diablo I
Sock.Product <> Packets.BNETProduct_DSHR And _ // Diablo I Shareware
Sock.Product <> Packets.BNETProduct_SSHR Then // Starcraft Shareware
If NeedsKey1 Or NeedsKey2 Then

If Settings.FileCheckBNCSUtilDLL = False Then
Sock.Config.AddChat(True, Colors.Red, "BNET: Error - it appears BNCSUtil.dll is missing." + EndOfLine)
Expand All @@ -3173,19 +3173,20 @@ Protected Module Packets
End If

// Decrypt original CD-Key
//
TempKey = Globals.DecryptCDKey(Sock.Config.CDKey, Sock.ClientToken, Sock.ServerToken)
If LenB(TempKey) < 1 Then
// Invalid CD-Key
Sock.Config.AddChat(True, Colors.Red, "BNET: Failed to validate your CD-Key." + EndOfLine)
Sock.DoDisconnect(False)
Return False
If NeedsKey1 Then
TempKey = Globals.DecryptCDKey(Sock.Config.CDKey, Sock.ClientToken, Sock.ServerToken)
If LenB(TempKey) < 1 Then
// Invalid CD-Key
Sock.Config.AddChat(True, Colors.Red, "BNET: Failed to validate your CD-Key." + EndOfLine)
Sock.DoDisconnect(False)
Return False
End If
CDKeys.Append(TempKey)
End If
CDKeys.Append(TempKey)

// Decrypt expansion CD-Key, if necessary
//
If Sock.Product = Packets.BNETProduct_W3XP Or Sock.Product = Packets.BNETProduct_D2XP Then
If NeedsKey2 Then
TempKey = Globals.DecryptCDKey(Sock.Config.CDKeyExpansion, Sock.ClientToken, Sock.ServerToken)
If LenB(TempKey) < 1 Then
// Invalid CD-Key
Expand Down

0 comments on commit 49c3c80

Please sign in to comment.