Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: Brolly on June 27, 2003, 01:50 PM

Title: Grabbing the version ID?
Post by: Brolly on June 27, 2003, 01:50 PM
How do you grab the version ID from the EXE of a official (i.e. released by blizzard) Battle.Net client?
Title: Re:Grabbing the version ID?
Post by: Yoni on June 27, 2003, 03:52 PM
What are you referring to by "version ID"? Do you want the version byte, the file's hash (for CheckRevision), just the game's version (i.e. "1.09"), or something else?
Title: Re:Grabbing the version ID?
Post by: Camel on June 27, 2003, 04:18 PM
I dont know for sure, but I would assume it's stored in a dynamic place within one of the three files. If this is the case, one could search said file(s) for the code surrounding the address that refers to the ver byte, and use said address to find the ver byte. Just remember, it's entirely speculation. :)

[edit] I am also assuming you mean ver byte, by the way.
Title: Re:Grabbing the version ID?
Post by: Brolly on June 27, 2003, 06:06 PM
By Version ID I meant the version byte.
Title: Re:Grabbing the version ID?
Post by: Arta on June 28, 2003, 04:14 AM
There's no very good way to do it, no. It's not stored anywhere obvious - at least not in Starcraft/Brood war - but you could, as camel said, search for the code in the module containing the game's Battle.net logon code and find it that way. However, the whole point would be to dynamically update the version byte after patches, and the patch might change the code you're looking for, so it's not guaranteed to work anyway.
Title: Re:Grabbing the version ID?
Post by: Yoni on June 28, 2003, 09:44 AM
If you can be bothered to use BNLS, you can always get the latest version byte by sending BNLS_REQUESTVERSIONBYTE (0x10).
Title: Re:Grabbing the version ID?
Post by: ______ on June 28, 2003, 09:59 AM
or you can make a crappy webpage with the current version byte on it then change it when a new version byte comes out, then use msinet.ocx to get the latest version byte from the web page. :-X
Title: Re:Grabbing the version ID?
Post by: TheMinistered on June 28, 2003, 10:50 AM
Camel, if you only have the hash files you would not use an address but rather an offset into the file.  You are not loading anything into memory... thus, you would want to know the offset into the file that contains the version byte.
Title: Re:Grabbing the version ID?
Post by: Camel on June 28, 2003, 01:54 PM
Quote from: TheMinistered on June 28, 2003, 10:50 AM
Camel, if you only have the hash files you would not use an address but rather an offset into the file.  You are not loading anything into memory... thus, you would want to know the offset into the file that contains the version byte.
Close 'nuff =P
Title: Re:Grabbing the version ID?
Post by: Arta on June 29, 2003, 03:12 AM
Actually, I would load it into memory. It would reduce the amount of data you'd need to search, thus reducing the likelyhood of false positives - since you could determine the offset of the module's code, you could avoid searching through everything else.
Title: Re:Grabbing the version ID?
Post by: Camel on June 29, 2003, 11:02 AM
Quote from: Arta[vL] on June 29, 2003, 03:12 AM
Actually, I would load it into memory. It would reduce the amount of data you'd need to search, thus reducing the likelyhood of false positives - since you could determine the offset of the module's code, you could avoid searching through everything else.

+1 to arta for making me sound at least a little right! ;D
Title: Re:Grabbing the version ID?
Post by: tA-Kane on June 30, 2003, 12:02 PM
Quote from: Arta[vL] on June 28, 2003, 04:14 AMThere's no very good way to do it, no. It's not stored anywhere obvious - at least not in Starcraft/Brood war
Maybe not on the Win32 platform... but on the Mac PPC platform (not sure of Mac OS X), it's the last 4 bytes of the game's data fork (even stored in the correct byte order, IIRC).