Author | Message | Time |
---|---|---|
DDA-TriCk-E | When should this be sent? I keep getting Invalid version response from S=>C SID_AUTH_CHECK I am currently sending it after I receive SID_AUTH_INFO response | December 4, 2006, 11:17 AM |
Ersan | whenever you want... | December 4, 2006, 2:13 PM |
l2k-Shadow | you can send any BNLS packet anytime. | December 4, 2006, 3:03 PM |
Ersan | is there an echo in here? | December 4, 2006, 3:04 PM |
l2k-Shadow | I posted a more detailed description of what you posted. :-* | December 4, 2006, 3:08 PM |
HdxBmx27 | [code]BNCS C->S Protocol Byte: 0x01 BNCS C->S 0x50 BNCS S->C 0x50 If Client.protocol == NLS BNLS C->S 0x0D BNLS S->C 0x0D End If BNCS S->C 0x25 BNCS C->S 0x25 BNLS C->S 0x1A BNLS S->C 0x1A BNLS C->S 0x0C BNLS C->S 0x51 If Client.protocol != NLS BNLS C->S 0x0B BNLS S->C 0x0B BNCS C->S 0x3A BNCS S->C 0x3A Else BNLS C->S 0x02 BNLS S->C 0x02 BNCS C->S 0x53 BNCS S->C 0x53 BNLS C->S 0x03 BNLS S->C 0x03 BNCS C->S 0x53 BNCS S->C 0x53 BNCS S->C 0x45 End If If Client.UDPGames == True BNCS C->S UDP 0x09 BNCS C->S UDP 0x09 BNCS C->S UDP 0x09 BNCS S->C UDP 0x09 BNCS S->C UDP 0x09 BNCS S->C UDP 0x09 BNCS S->C UDP 0x09 BNCS S->C UDP 0x09 BNCS S->C UDP 0x09 BNCS S->C UDP 0x09 BNCS S->C UDP 0x09 BNCS S->C UDP 0x09 BNCS C->S 0x14 End If BNCS C->S 0x0A BNCS C->S 0x0B BNCS C->S 0x0C[/code]Bah I'm bored, but that should be correct. (Its off the top of my head) ~-~(HDX)~-~ | December 4, 2006, 3:22 PM |
MysT_DooM | I assume your parsing out ur 0x1A responce correctly, but also use the exeinfo provided in 0x1A , you cant have it like "DDA-TRiCk`BoT" or watever , bnet now checks that | December 4, 2006, 3:53 PM |
HeRo | When does bnls send back the exe information? [code](BOOL) Success* (DWORD) Version. (DWORD) Checksum. (STRING) Version check stat string. (DWORD) Cookie. (DWORD) The latest version code for this product.[/code] Do any of those mean exe information, I'm stumped here. | December 4, 2006, 10:43 PM |
l2k-Shadow | [quote author=heRo link=topic=16108.msg162188#msg162188 date=1165272210] When does bnls send back the exe information? [code](BOOL) Success* (DWORD) Version. (DWORD) Checksum. (STRING) Version check stat string. (DWORD) Cookie. (DWORD) The latest version code for this product.[/code] Do any of those mean exe information, I'm stumped here. [/quote] well let's see, exe info is a string, and there is only one string in there. ::) | December 4, 2006, 10:48 PM |
HeRo | [quote author=l2k-Shadow link=topic=16108.msg162190#msg162190 date=1165272522] [quote author=heRo link=topic=16108.msg162188#msg162188 date=1165272210] When does bnls send back the exe information? [code](BOOL) Success* (DWORD) Version. (DWORD) Checksum. (STRING) Version check stat string. (DWORD) Cookie. (DWORD) The latest version code for this product.[/code] Do any of those mean exe information, I'm stumped here. [/quote] well let's see, exe info is a string, and there is only one string in there. ::) [/quote] Actually, thats what I was going to edit my post w/, but I didn't know if I was even looking at the right packet for the info. Why don't they match bnetdocs; for example in 0x51 it says EXE Info, shouldn't it in the BNLS packet? @School so typing fast btw. | December 4, 2006, 10:57 PM |
DDA-TriCk-E | Oh maybe it's the ULONGLONG? I just assumed that was FILETIME? does it have a different format/size? how many bytes should it be in length? [code] 0x1A (DWORD) Product ID.* (DWORD) Flags.** (DWORD) Cookie. (ULONGLONG) Timestamp for version check archive. (STRING) Version check archive filename. (STRING) Checksum formula. [/code] Heres what I'm getting from BNLS compared to hashing [code] D2DV Using Hashes version: 16780032 checksum: 522892090 exeinfo: Game.exe 07/19/06 11:54:27 2125824 Using BNLS version: 0 checksum: -1895759861 exeinfo: í~Game.exe 08/17/05 01:11:43 2125824 [/code] | December 4, 2006, 10:59 PM |
l2k-Shadow | [quote author=DDA-TriCk-E link=topic=16108.msg162192#msg162192 date=1165273145] Oh maybe it's the ULONGLONG? I just assumed that was FILETIME? does it have a different format/size? how many bytes should it be in length? [code] 0x1A (DWORD) Product ID.* (DWORD) Flags.** (DWORD) Cookie. (ULONGLONG) Timestamp for version check archive. (STRING) Version check archive filename. (STRING) Checksum formula. [/code] [/quote] [code] #include <iostream.h> void main() { cout << sizeof(unsigned long long) << "\n"; } [/code] It's the timestamp of the MPQ file so that the client would know if the mpq was updated in case it has an outdated file in it's cache. | December 4, 2006, 11:04 PM |
DDA-TriCk-E | [quote author=l2k-Shadow link=topic=16108.msg162193#msg162193 date=1165273443] [quote author=DDA-TriCk-E link=topic=16108.msg162192#msg162192 date=1165273145] Oh maybe it's the ULONGLONG? I just assumed that was FILETIME? does it have a different format/size? how many bytes should it be in length? [code] 0x1A (DWORD) Product ID.* (DWORD) Flags.** (DWORD) Cookie. (ULONGLONG) Timestamp for version check archive. (STRING) Version check archive filename. (STRING) Checksum formula. [/code] [/quote] [code] #include <iostream.h> void main() { cout << sizeof(unsigned long long) << "\n"; } [/code] It's the timestamp of the MPQ file so that the client would know if the mpq was updated in case it has an outdated file in it's cache. [/quote] Is that the same as the 'FILETIME' of the MPQ received in 0x50? Heres what I'm getting from BNLS compared to hashing [code] D2DV Using Hashes version: 16780032 checksum: 522892090 exeinfo: Game.exe 07/19/06 11:54:27 2125824 Using BNLS version: 0 checksum: -1895759861 exeinfo: í~Game.exe 08/17/05 01:11:43 2125824 [/code] | December 4, 2006, 11:08 PM |
l2k-Shadow | yes it's the FILETIME, however, it looks like you're parsing the data wrong, considering you have some crap in front of the Game.exe, maybe if you pasted your parsing code for parsing 0x50 and sending/receiving 0x1A..? | December 4, 2006, 11:18 PM |
DDA-TriCk-E | Okay heres 0x50 [code] Private Sub Recv0x50() Dim lngRevision As Long ClientToken = GetTickCount With objPacket lngRevision = .GetDWORD ServerToken = .GetDWORD .Skip 4 MpqFileTime = .GetULONG MpqArchive = .GetCString ChecksumFormula = .GetCString If lngRevision = 2 Then useNLS = True Else useNLS = False End With With objPacketBNLS .InsertDWORD CLng(IIf(lngRevision = 0, 1, lngRevision)) .SendBNLSPacket ObjectIndex, BNLS_CHOOSENLSREVISION End With End Sub [/code] Heres 0x1A send [code] Case BNLS_CHOOSENLSREVISION '(0x0D) With objPacketBNLS If .GetDWORD = &H1 Then ProductID = BNLSGetProductID(Profile(Index).Config.ProductID) With objPacketBNLS .InsertDWORD ProductID .InsertDWORD &H0 .InsertDWORD ServerToken .InsertULONG MpqFileTime .InsertCString MpqArchive .InsertCString ChecksumFormula .SendBNLSPacket ObjectIndex, BNLS_VERSIONCHECKEX2 End With AddChat ObjectIndex, GetColor(COL_SUCCESS), "BNLS: Login information authenticated!" Else AddChat ObjectIndex, GetColor(COL_FAILED), "BNLS: Revision number was not recognized." End If End With [/code] And heres 0x1A recv [code] Case BNLS_VERSIONCHECKEX2 With objPacketBNLS If .GetBYTE = &H1 Then EXEversion = .GetDWORD Checksum = .GetDWORD EXEinfo = .GetCString Debug.Print EXEversion Debug.Print Checksum Debug.Print EXEinfo AddChat ObjectIndex, GetColor(COL_SUCCESS), "BNLS: Version check passed!" If Profile(Index).Config.ProductID = "D2XP" Or Profile(Index).Config.ProductID = "W3XP" Then .InsertDWORD &H1 .InsertBYTE &H2 .InsertDWORD &H1 .InsertDWORD ServerToken .InsertCString Profile(Index).Config.Cdkey .InsertCString Profile(Index).Config.CdkeyExp .SendBNLSPacket ObjectIndex, BNLS_CDKEY_EX Else .InsertDWORD &H1 .InsertBYTE &H1 .InsertDWORD &H1 .InsertDWORD ServerToken .InsertCString Profile(Index).Config.Cdkey .SendBNLSPacket ObjectIndex, BNLS_CDKEY_EX End If AddChat ObjectIndex, GetColor(col_info), "BNLS: Hashing cdkeys.." End If End With [/code] | December 4, 2006, 11:39 PM |
Ersan | [code].InsertULONG MpqFileTime[/code] A filetime struct has two 4-byte halves, totalling 7 bytes an a null terminator. As for why your parsing's off: [code]If .GetBYTE = &H1 Then[/code] The BOOL response is 4 bytes long (GetDWORD), not one. I have no idea why Skywing did that. | December 5, 2006, 12:13 AM |
Skywing | A FILETIME is not a delimited item. It is two raw four-byte halves (or a single unaligned eight-byte field); there is no null terminator. Aside from fields with an explicit (dynamic) length or null delimited fields, all fields in the body of BNLS messages tend to be at least four bytes in length. | December 5, 2006, 2:00 AM |
DDA-TriCk-E | Whenever I send 0x51 using Version, Checksum and ExeInfo from 0x1A I get disconnected and IPbanned on the server | December 5, 2006, 2:53 AM |
l2k-Shadow | paste your fixed 0x1A parse + 0x51 send? | December 5, 2006, 2:59 AM |
Kp | Therefore, we can conclude that you're doing it wrong. If you want more help, we need more information. Perhaps you should post the actual bytes sent? You can censor the cdkey data, but without seeing the outbound message we cannot even be sure you're sending the data in the right order. | December 5, 2006, 3:00 AM |
Ersan | [quote author=Skywing link=topic=16108.msg162204#msg162204 date=1165284042] A FILETIME is not a delimited item. It is two raw four-byte halves (or a single unaligned eight-byte field); there is no null terminator. [/quote] Sorry, I have no idea where I read that it was nullterm, it's 8 bytes regardless. | December 5, 2006, 3:18 AM |
MysT_DooM | these posts in this topic should help you out also https://davnit.net/bnet/vL/index.php?topic=15960.210 | December 5, 2006, 3:19 AM |
DDA-TriCk-E | Thanks I'll try everything you guys said, I still don't know why it's disconnecting me, everything looks correct compared to BnetDocs but I'll get back to you if I fix it... | December 5, 2006, 11:02 AM |
Ringo | [quote author=DDA-TriCk-E link=topic=16108.msg162192#msg162192 date=1165273145] Oh maybe it's the ULONGLONG? I just assumed that was FILETIME? does it have a different format/size? how many bytes should it be in length? [code] 0x1A (DWORD) Product ID.* (DWORD) Flags.** (DWORD) Cookie. (ULONGLONG) Timestamp for version check archive. (STRING) Version check archive filename. (STRING) Checksum formula. [/code] Heres what I'm getting from BNLS compared to hashing [code] D2DV Using Hashes version: 16780032 checksum: 522892090 exeinfo: Game.exe 07/19/06 11:54:27 2125824 Using BNLS version: 0 checksum: -1895759861 exeinfo: í~Game.exe 08/17/05 01:11:43 2125824 [/code] [/quote] Apart from (what looks like) not skipping the BNLS packet header, I dont think BNLS_VERSIONCHECKEX2 supports d2/w3 clients as of yet? | December 5, 2006, 2:58 PM |
Skywing | It should support those clients. | December 5, 2006, 4:26 PM |
Ersan | [quote author=Ringo link=topic=16108.msg162266#msg162266 date=1165330700] Apart from (what looks like) not skipping the BNLS packet header, I dont think BNLS_VERSIONCHECKEX2 supports d2/w3 clients as of yet? [/quote] I already mentioned that he was treating the boolean success as one byte instead of four. And yes it does. | December 5, 2006, 5:12 PM |
Ringo | [quote author=Skywing link=topic=16108.msg162274#msg162274 date=1165335985] It should support those clients. [/quote] Oh my bad, I thought D2/W2 clients couldnt use it yet :P [quote author=Ersan link=topic=16108.msg162276#msg162276 date=1165338769] I already mentioned that he was treating the boolean success as one byte instead of four. [/quote] Ok, but dont expect an award or anything.. [quote author=Ersan link=topic=16108.msg162276#msg162276 date=1165338769] And yes it does. [/quote] Thanks. | December 5, 2006, 8:56 PM |
DDA-TriCk-E | [quote author=Ersan link=topic=16108.msg162276#msg162276 date=1165338769] [quote author=Ringo link=topic=16108.msg162266#msg162266 date=1165330700] Apart from (what looks like) not skipping the BNLS packet header, I dont think BNLS_VERSIONCHECKEX2 supports d2/w3 clients as of yet? [/quote] I already mentioned that he was treating the boolean success as one byte instead of four. And yes it does. [/quote] Yeah I have been treating it as four bytes since you pointed that out, still doesnt work. | December 5, 2006, 9:22 PM |
HdxBmx27 | Post a packet log + Your changed handle code. ~-~(HDX)~-~ | December 5, 2006, 9:31 PM |
DDA-TriCk-E | The error had to do with BNLS_CDKEY_EX it wasn't returning the cdkey data correctly. | December 8, 2006, 4:56 AM |
warz | [quote author=DDA-TriCk-E link=topic=16108.msg162376#msg162376 date=1165553780] The error had to do with BNLS_CDKEY_EX it wasn't returning the cdkey data correctly. [/quote] you sure it wasnt you providing / misinterpreting incorrect data? | December 8, 2006, 5:05 AM |
DDA-TriCk-E | perhaps, are you supposed to send BNLS_CDKEY_EX for original clients cdkeys? because it worked fine when I only sent BNLS_CDKEY_EX for expansion clients and BNLS_CDKEY for original clients... | December 8, 2006, 7:11 AM |
l2k-Shadow | It's probably you sending incorrect data to hash multiple cd-keys though. Did you read this?: [quote] Note: When using Lord of Destruction, two CD-keys are encrypted, and they must share the same client session key. There are several ways to do this. One way is to provide both CD-keys in this packet, using the flag CDKEY_SAME_SESSION_KEY (0x01). Another way is to use BNLS_CDKEY (0x01) to encrypt the first CD-key, then use this packet with the flag CDKEY_GIVEN_SESSION_KEY (0x02) to encrypt the second CD-key with the same client session key. [/quote] Providing code/packet log could also help us determine the problem. | December 8, 2006, 3:08 PM |