Valhalla Legends Forums Archive | Battle.net Bot Development | BnFTP

AuthorMessageTime
Myndfyr
Well, I did a 2-year search and, after realizing I only allowed 50 results, started grumbling to myself. However, it turns out that only 49 results returned, so it doesn't matter. Needless to say, there's not much on the subject.

Here's what I know (or think I know) at this point:

1.) Any client can log on using BnFTP version 1. According to UserLoser's info, the packet sent (after the 0x02) is:

Sent:
WORD size
BYTE unknown (0)
BYTE protocol (1)
DWORD platform id ('IX86', 'PMAC', etc.)
DWORD client id ('STAR', 'SSHR', 'SEXP', etc.)
DWORD unknown (0)
DWORD unknown (0)
DWORD position to begin resuming file
FILETIME file time of the file
STRING name of the file

Received:
WORD packet size
BYTE unknown (0)
BYTE protocol (1)
WORD file size -- NOTE I suggest that this might be a DWORD and the next field might be a BYTE[8], because -- what if you have a file bigger than 65535 bytes? :P
BYTE[10] unknown -- NOTE, I say BYTE[8].
FILETIME file time of file
STRING file name

My question is -- if you can't retrieve a list of the files on BnFTP, how are you going to know the FILETIME of the file you want to download?

2.) For BnFTP version 2, authorization is required. UserLoser's docs list is as:

WORD packet size
BYTE unknown
BYTE protocol (2)
DWORD platform id
DWORD client id
FILETIME file time of the file

Received:
DWORD server key

Sent:
DWORD unknown
DWORD unknown
DWORD position to resume file
DWORD client key
DWORD cd key length
DWORD cd key product ID
DWORD cd key public value
DWORD unknown (0)
DWORD[5] hashed key data
STRING filename

Received:
DWORD unknown (0)
DWORD filesize
FILETIME file time sent
FILETIME file time of server's file
STRING file name

Here's what I don't understand about this request:

1.) You still need to have the file time before you make the request.
2.) Why would you need to specify the key length? All Starcraft keys have the same length, all Diablo 2/W2BN keys have the same length, and all War3 keys have the same length. Wouldn't it know by your client ID ('STAR', 'WAR3', etc.) how long the damn key length is?
3.) What is the "cd key product id" ? Is that the client ID -- thus the same as the client ID in the first packet?
4.) What is the "cd key public value" ? I've re-checked the BNLS protocol spec and can find nothing on it.
5.) What if you're logging on with W3XP? Do you only hash the WAR3 key?

Thanks much. :)
July 1, 2004, 2:20 AM
UserLoser.
[quote author=Myndfyre link=board=17;threadid=7517;start=0#msg68023 date=1088648415]
Well, I did a 2-year search and, after realizing I only allowed 50 results, started grumbling to myself. However, it turns out that only 49 results returned, so it doesn't matter. Needless to say, there's not much on the subject.

Here's what I know (or think I know) at this point:

1.) Any client can log on using BnFTP version 1. According to UserLoser's info, the packet sent (after the 0x02) is:

Sent:
WORD size
BYTE unknown (0)
BYTE protocol (1)
DWORD platform id ('IX86', 'PMAC', etc.)
DWORD client id ('STAR', 'SSHR', 'SEXP', etc.)
DWORD unknown (0)
DWORD unknown (0)
DWORD position to begin resuming file
FILETIME file time of the file
STRING name of the file

Received:
WORD packet size
BYTE unknown (0)
BYTE protocol (1)
WORD file size -- NOTE I suggest that this might be a DWORD and the next field might be a BYTE[8], because -- what if you have a file bigger than 65535 bytes? :P
BYTE[10] unknown -- NOTE, I say BYTE[8].
FILETIME file time of file
STRING file name

My question is -- if you can't retrieve a list of the files on BnFTP, how are you going to know the FILETIME of the file you want to download?

2.) For BnFTP version 2, authorization is required. UserLoser's docs list is as:

WORD packet size
BYTE unknown
BYTE protocol (2)
DWORD platform id
DWORD client id
FILETIME file time of the file

Received:
DWORD server key

Sent:
DWORD unknown
DWORD unknown
DWORD position to resume file
DWORD client key
DWORD cd key length
DWORD cd key product ID
DWORD cd key public value
DWORD unknown (0)
DWORD[5] hashed key data
STRING filename

Received:
DWORD unknown (0)
DWORD filesize
FILETIME file time sent
FILETIME file time of server's file
STRING file name

Here's what I don't understand about this request:

1.) You still need to have the file time before you make the request.
2.) Why would you need to specify the key length? All Starcraft keys have the same length, all Diablo 2/W2BN keys have the same length, and all War3 keys have the same length. Wouldn't it know by your client ID ('STAR', 'WAR3', etc.) how long the damn key length is?
3.) What is the "cd key product id" ? Is that the client ID -- thus the same as the client ID in the first packet?
4.) What is the "cd key public value" ? I've re-checked the BNLS protocol spec and can find nothing on it.
5.) What if you're logging on with W3XP? Do you only hash the WAR3 key?

Thanks much. :)
[/quote]


FTP stuff is probably is my weakest area of knowledge that I have documented. It might not be correct (version 2), and it might be missing some information. Public value is value returned in cdkey decode which is sent to battle.net, where the private value (other value returned in decode) isn't. CDKey product id is also result from cdkey decode. As far as CDKey length, don't be asking here, since it's sent in 0x51 and nobody has ever questioned the length DWORD in there.
July 1, 2004, 2:33 AM
Maddox
1.) You still need to have the file time before you make the request.

This is not a question. Anyways, I'm guessing the file time is up there to see if there is a newer version of the file available for download.

2.) Why would you need to specify the key length? All Starcraft keys have the same length, all Diablo 2/W2BN keys have the same length, and all War3 keys have the same length. Wouldn't it know by your client ID ('STAR', 'WAR3', etc.) how long the damn key length is?

In case in the future they go to variable-length keys I guess.

3.) What is the "cd key product id" ? Is that the client ID -- thus the same as the client ID in the first packet?

Like userloser said, it is returned from cdkey decode.

4.) What is the "cd key public value" ? I've re-checked the BNLS protocol spec and can find nothing on it.

Like userloser said, it is returned from cdkey decode.

5.) What if you're logging on with W3XP? Do you only hash the WAR3 key?

I think you just send the frozen throne key data.
July 1, 2004, 7:03 AM
Myndfyr
[quote author=Maddox link=board=17;threadid=7517;start=0#msg68059 date=1088665410]
1.) You still need to have the file time before you make the request.

This is not a question. Anyways, I'm guessing the file time is up there to see if there is a newer version of the file available for download.
[/quote]

If you look at the first part of my post, I asked:

[quote]
if you can't retrieve a list of the files on BnFTP, how are you going to know the FILETIME of the file you want to download?
[/quote]
July 1, 2004, 5:58 PM
UserLoser.
[quote author=Myndfyre link=board=17;threadid=7517;start=0#msg68091 date=1088704684]
[quote author=Maddox link=board=17;threadid=7517;start=0#msg68059 date=1088665410]
1.) You still need to have the file time before you make the request.

This is not a question. Anyways, I'm guessing the file time is up there to see if there is a newer version of the file available for download.
[/quote]

If you look at the first part of my post, I asked:

[quote]
if you can't retrieve a list of the files on BnFTP, how are you going to know the FILETIME of the file you want to download?
[/quote]
[/quote]

If you already have the file, and need to update it. Otherwise just 0 should be fine.
July 2, 2004, 2:24 AM
Adron
I think you typically get the FILETIME from the other connection where you're being told to download the file? I.e. you ask bncs about icons.bni, it tells you what the current FILETIME should be, and if you don't have that version you go download it.
July 3, 2004, 9:50 AM
LoRd
[quote author=Adron link=board=17;threadid=7517;start=0#msg68292 date=1088848226]
I think you typically get the FILETIME from the other connection where you're being told to download the file? I.e. you ask bncs about icons.bni, it tells you what the current FILETIME should be, and if you don't have that version you go download it.
[/quote]

Since you have to create the file when you receive the file's data from BNFTP, wouldn't your filetime almost always differ from Blizzard's? And isn't SID_GETICONDATA meant for checking to see if icons.bni needs an update?
July 3, 2004, 7:07 PM
Myndfyr
[quote author=LoRd[nK] link=board=17;threadid=7517;start=0#msg68333 date=1088881675]
[quote author=Adron link=board=17;threadid=7517;start=0#msg68292 date=1088848226]
I think you typically get the FILETIME from the other connection where you're being told to download the file? I.e. you ask bncs about icons.bni, it tells you what the current FILETIME should be, and if you don't have that version you go download it.
[/quote]

Since you have to create the file when you receive the file's data from BNFTP, wouldn't your filetime almost always differ from Blizzard's? And isn't SID_GETICONDATA meant for checking to see if icons.bni needs an update?
[/quote]

No, you can use the SetFileTime function to set the filetime info.

And -- I'm not familiar with the SID_GETICONDATA packet. In any case, that's not what I want to do anyway. I'm working on a plugin for my bot (although I want to make BnFTP part of the basic bot connections API) that will download the .mng advertisements from Battle.net (Warcraft III connection) and display them using the FreeImage library.

Anyway.... :)
July 3, 2004, 7:34 PM
Adron
[quote author=Myndfyre link=board=17;threadid=7517;start=0#msg68334 date=1088883247]
And -- I'm not familiar with the SID_GETICONDATA packet. In any case, that's not what I want to do anyway. I'm working on a plugin for my bot (although I want to make BnFTP part of the basic bot connections API) that will download the .mng advertisements from Battle.net (Warcraft III connection) and display them using the FreeImage library.
[/quote]

But, isn't there a FILETIME in the packet that gives you the filename for the advertisement too?
July 4, 2004, 10:42 AM
Myndfyr
[quote author=Adron link=board=17;threadid=7517;start=0#msg68449 date=1088937776]
[quote author=Myndfyre link=board=17;threadid=7517;start=0#msg68334 date=1088883247]
And -- I'm not familiar with the SID_GETICONDATA packet. In any case, that's not what I want to do anyway. I'm working on a plugin for my bot (although I want to make BnFTP part of the basic bot connections API) that will download the .mng advertisements from Battle.net (Warcraft III connection) and display them using the FreeImage library.
[/quote]

But, isn't there a FILETIME in the packet that gives you the filename for the advertisement too?
[/quote]

Ahh, so there is. I've been ignoring it generally, but I guess I should look into that. ;-)
July 4, 2004, 8:12 PM

Search