• Welcome to Valhalla Legends Archive.
 

[VB6] How exactly do you use these numbers...

Started by Sorc_Polgara, June 19, 2004, 08:34 PM

Previous topic - Next topic

Sorc_Polgara

Totally nooblar question, but how do you use these message IDs (i.e. 0x01)?

What are they, I mean they aren't hex... look like memory or something...

How exactly would I use such a value code in a packet?  Should I conver it to some kind fo special format, or do I just take the code (i.e. 0x01) and make it a string?

I see people using stuff with &H1, that kind of stuff...  I'm lost.  These codes given aren't any help if I don't know what the hell they mean and are suppose to be used... bleh

I'm using VB6 but how the hell do I make this 0x01 into a BYTE?  The protocolspec.txt or w/e says that the ID has to be a BYTE... but I can't make a BYTE out of "0x01"... bleh


Public Sub Send0x51()
AddC Form1.RTB1, True, vbYellow, "BNLS: Sent 0x51"
   With pBuffer
       .InsertDWORD GTC
       .InsertDWORD version
       .InsertDWORD CheckSum
       If varProduct = "PX2D" Then
           .InsertDWORD &H2
       Else
           .InsertDWORD &H1
       End If
       .InsertDWORD &H0
       .InsertNonNTString CdkeyHash
       If varProduct = "PX2D" Then
           .InsertNonNTString Cdkey2Hash
       End If
       .InsertNTString ExeInfo
       .InsertNTString (varUser)
       .SendPacket &H51
   End With
End Sub


Sure... this is just some code I found of a  post... to use as ex

Where the hell did the "&H51" or "&H0" come from? what are they used for?  I dun see those things in any of the bot documents I found... bleh

UserLoser.

&H is just Visual Basic's representation of hex.  &H51 is the same as 0x51.  0x01 is the same as 0x1, which is the same as 0x00000001, which is the same as &H1.  Other languages such as Java (i'm assuming), C++, have prefixes of 0x, where VB has &H.  Hope this helps. ;)

Sorc_Polgara

Yes, that really helps.  Conversions are killing me.  Thanks. :)