VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "clsHashInfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit

Public LogonType As Long
Public ServerToken As Long
Public ClientToken As Long
Public UdpValue As Long
Public MpqFileTime As String
Public MpqFile As String
Public ValueString As String
Public CdkeyHash As String
Public Decoder As Long
Public UsingNLS As Boolean
Private HashLen As Long

Public Function VerifyCdkey(Cdkey As String, ClientToken As Long, ServerToken As Long) As Byte
    Decoder = kd_create(Cdkey, Len(Cdkey))
    If Decoder = -1 Then VerifyCdkey = &H1: Exit Function
    HashLen = kd_calculateHash(Decoder, ClientToken, ServerToken)
    If HashLen = 0 Then VerifyCdkey = &H2: Exit Function
    CdkeyHash = Space$(HashLen)
    kd_getHash Decoder, CdkeyHash
End Function
