• Welcome to Valhalla Legends Archive.
 

BnFTP

Started by MyndFyre, June 30, 2004, 09:20 PM

Previous topic - Next topic

MyndFyre

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.  :)
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

UserLoser.

Quote from: Myndfyre on June 30, 2004, 09:20 PM
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.  :)


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.

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.
asdf.

MyndFyre

Quote from: Maddox on July 01, 2004, 02:03 AM
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.

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?
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

UserLoser.

Quote from: Myndfyre on July 01, 2004, 12:58 PM
Quote from: Maddox on July 01, 2004, 02:03 AM
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.

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?

If you already have the file, and need to update it.  Otherwise just 0 should be fine.

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.

Eric

#6
Quote from: Adron on July 03, 2004, 04:50 AM
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.

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?

MyndFyre

Quote from: LoRd[nK] on July 03, 2004, 02:07 PM
Quote from: Adron on July 03, 2004, 04:50 AM
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.

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?

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....  :)
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Adron

#8
Quote from: Myndfyre on July 03, 2004, 02:34 PM
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.

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

MyndFyre

Quote from: Adron on July 04, 2004, 05:42 AM
Quote from: Myndfyre on July 03, 2004, 02:34 PM
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.

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

Ahh, so there is.  I've been ignoring it generally, but I guess I should look into that.  ;-)
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.