Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: shadypalm88 on October 18, 2003, 08:27 PM

Title: Visual Basic - BNLS_AUTHORIZEPROOF
Post by: shadypalm88 on October 18, 2003, 08:27 PM
Please excuse my newbish question, but I'm having a problem generating a checksum to send using BNLS_AUTHORIZEPROOF (0x0f).  I am using Yoni's VB CRC32 checksum functions that are listed in the BNLS protocol spec.  I wrote a packet parsing sub that returns divided packet data in a user-defined type array, with the actual data in a Variant.  Problem is, the checksum function's server key argument is a Long.  Trying to pass the key directly causes a type mismatch error.  I've tried using combinations of CLng, Val, and Fix, but they either cause the same error or destroy the data.

So here's my question:  How can I convert the BNLS server key data (stored in a variant or string) into an equivalent long that I can use to get a valid CRC32 checksum?
Title: Re:Visual Basic - BNLS_AUTHORIZEPROOF
Post by: Soul Taker on October 18, 2003, 08:52 PM
Do something like this:
CopyMemory lngKey, ByVal Mid$(strData, 4, 4), 4
lngKey of course being a long where the key will be stored.
Title: Re:Visual Basic - BNLS_AUTHORIZEPROOF
Post by: iago on October 18, 2003, 09:24 PM
<insert argument about why C++ is better here>
Title: Re:Visual Basic - BNLS_AUTHORIZEPROOF
Post by: shadypalm88 on October 18, 2003, 09:35 PM
Thanks.
Title: Re:Visual Basic - BNLS_AUTHORIZEPROOF
Post by: Banana fanna fo fanna on October 18, 2003, 10:10 PM
Quote from: iago on October 18, 2003, 09:24 PM
<insert argument about why C++ is better here>

shadypalm obviously is not a n00b, thus he does not deserve vb flaming.

shadypalm: +1
Title: Re:Visual Basic - BNLS_AUTHORIZEPROOF
Post by: Kp on October 19, 2003, 12:08 AM
Quote from: St0rm.iD on October 18, 2003, 10:10 PMshadypalm obviously is not a n00b, thus he does not deserve vb flaming.
Why are veterans excused from being flamed for using a language that doesn't even have an unsigned 32 bit type?
Title: Re:Visual Basic - BNLS_AUTHORIZEPROOF
Post by: Adron on October 19, 2003, 06:09 AM
Quote from: Kp on October 19, 2003, 12:08 AM
Why are veterans excused from being flamed for using a language that doesn't even have an unsigned 32 bit type?

They're excused because they may be under pressure from others to use it. That's punishment enough without being flamed as well.