VERSION 5.00
Begin VB.Form Form4 
   Caption         =   "Hard Disk Serial Changer"
   ClientHeight    =   1740
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   3840
   Icon            =   "Form4.frx":0000
   LinkTopic       =   "Form4"
   ScaleHeight     =   1740
   ScaleWidth      =   3840
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton Command2 
      Caption         =   "Exit"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   372
      Left            =   2160
      TabIndex        =   5
      ToolTipText     =   "Exit without any change"
      Top             =   1260
      Width           =   1452
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Change"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   372
      Left            =   240
      TabIndex        =   4
      ToolTipText     =   "Pressing here you change your HD number with the value typed above"
      Top             =   1260
      Width           =   1632
   End
   Begin VB.TextBox Text2 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   312
      Left            =   2280
      TabIndex        =   3
      Text            =   "00000000"
      ToolTipText     =   "Enter here the HD serial that you like to obtain"
      Top             =   660
      Width           =   1392
   End
   Begin VB.TextBox Text1 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   312
      Left            =   2280
      Locked          =   -1  'True
      TabIndex        =   0
      Text            =   "Unknow"
      ToolTipText     =   "Your current HD serial Number (in some case this number my be not showed)"
      Top             =   120
      Width           =   1392
   End
   Begin VB.Label Label2 
      Caption         =   "New Serial Number:"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   192
      Left            =   180
      TabIndex        =   2
      Top             =   720
      Width           =   1992
   End
   Begin VB.Label Label1 
      Caption         =   "Current Serial Number:"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   192
      Left            =   180
      TabIndex        =   1
      Top             =   180
      Width           =   1992
   End
End
Attribute VB_Name = "Form4"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Screen.MousePointer = 11
Kill App.Path + "\GETTED"
If Len(Text2.Text) > 8 Then GoTo NOCHANGE
If Val("&H" + Text2.Text) > 4294967295# Then GoTo NOCHANGE
If Len(Text2.Text) = 0 Then GoTo NOCHANGE
 
If Len(Text2.Text) = 1 Then Text2.Text = "0000000" + Text2.Text
If Len(Text2.Text) = 2 Then Text2.Text = "000000" + Text2.Text
If Len(Text2.Text) = 3 Then Text2.Text = "00000" + Text2.Text
If Len(Text2.Text) = 4 Then Text2.Text = "0000" + Text2.Text
If Len(Text2.Text) = 5 Then Text2.Text = "000" + Text2.Text
If Len(Text2.Text) = 6 Then Text2.Text = "00" + Text2.Text
If Len(Text2.Text) = 7 Then Text2.Text = "0" + Text2.Text
 
BYTE1 = Val("&h" + Left(Text2.Text, 2))
BYTE2 = Val("&h" + Mid(Text2.Text, 3, 2))
BYTE3 = Val("&h" + Mid(Text2.Text, 5, 2))
BYTE4 = Val("&h" + Right(Text2.Text, 2))
  
  
filen1 = FreeFile
Open App.Path + "\DSET.EXE" For Binary Access Write As #filen1
Put #filen1, 534, Chr$(BYTE1)
Put #filen1, 533, Chr$(BYTE2)
Put #filen1, 532, Chr$(BYTE3)
Put #filen1, 531, Chr$(BYTE4)
Close #filen1
 
WaitForProcessToEnd (App.Path + "\DSET.EXE")
WaitForProcessToEnd (App.Path + "\dgets.bat " + App.Path)
filex = FreeFile
Open App.Path + "\GETTED" For Input As #filex
Line Input #filex, zz
Close #filex
diskactual = RTrim(zz)
Text1.Text = diskactual
 
VB_GEN.Combo3.Clear
VB_GEN.Combo3.AddItem "ANY"
VB_GEN.Combo3.AddItem "DEMO"

VB_GEN.Combo6.Clear
VB_GEN.Combo6.AddItem "ANY"
VB_GEN.Combo6.AddItem "DEMO"

Dim k As String
Dim HostidType As Long
Dim BufLen As Integer
BufLen = 2048
k = Space$(2048) ' this may need to be made larger depending upon size of license file
HostidType = HOSTID_ETHER
If dllused(VB_GEN.Combo1.ListIndex) = "325" Then
    i% = c325_LC_HOSTID(HostidType, k, BufLen)
End If
If dllused(VB_GEN.Combo1.ListIndex) = "326" Then
    i% = b326_6_LC_HOSTID(HostidType, k, BufLen)
End If
If UCase(RTrim(k)) = "FFFFFFFF" Then
    k = "No ethernet card detected"
    VB_GEN.Combo3.AddItem k
    VB_GEN.Combo6.AddItem k
Else
    VB_GEN.Combo3.AddItem RTrim(k)
    VB_GEN.Combo3.AddItem "HOSTID_ETHER=" + RTrim(k)
    VB_GEN.Combo6.AddItem RTrim(k)
    VB_GEN.Combo6.AddItem "HOSTID_ETHER=" + RTrim(k)

End If

BufLen = 2048
k = Space$(2048) ' this may need to be made larger depending upon size of license file
HostidType = HOSTID_DISK_SERIAL_NUM
If dllused(VB_GEN.Combo1.ListIndex) = "325" Then
    i% = c325_LC_HOSTID(HostidType, k, BufLen)
End If
If dllused(VB_GEN.Combo1.ListIndex) = "326" Then
    i% = b326_6_LC_HOSTID(HostidType, k, BufLen)
End If

VB_GEN.Combo3.AddItem RTrim(k)
VB_GEN.Combo6.AddItem RTrim(k)

BufLen = 2048
k = Space$(2048) ' this may need to be made larger depending upon size of license file
HostidType = HOSTID_FLEXID1_KEY
If dllused(VB_GEN.Combo1.ListIndex) = "325" Then
    i% = c325_LC_HOSTID(HostidType, k, BufLen)
End If
If dllused(VB_GEN.Combo1.ListIndex) = "326" Then
    i% = b326_6_LC_HOSTID(HostidType, k, BufLen)
End If
VB_GEN.Combo3.AddItem RTrim(k)
VB_GEN.Combo6.AddItem RTrim(k)

BufLen = 2048
k = Space$(2048) ' this may need to be made larger depending upon size of license file
HostidType = HOSTID_INTERNET
If dllused(VB_GEN.Combo1.ListIndex) = "325" Then
    i% = c325_LC_HOSTID(HostidType, k, BufLen)
End If
If dllused(VB_GEN.Combo1.ListIndex) = "326" Then
    i% = b326_6_LC_HOSTID(HostidType, k, BufLen)
End If
If RTrim(k) <> "" Then
    VB_GEN.Combo3.AddItem RTrim(k)
    VB_GEN.Combo6.AddItem RTrim(k)
End If

VB_GEN.Combo3.AddItem "SKEY=00000000"
VB_GEN.Combo3.ListIndex = 0
VB_GEN.Combo6.AddItem "SKEY=00000000"
VB_GEN.Combo6.ListIndex = 0
Screen.MousePointer = 0
End Sub
 
NOCHANGE:
MsgBox "You typed a wrong number, you must put a HEX number between 0 to FFFFFFFF", vbCritical, "Wrong HD Serial"
Screen.MousePointer = 0
End Sub

Private Sub Command2_Click()
Unload Me
End Sub

Private Sub Form_Load()
On Error Resume Next
Kill App.Path + "\GETTED"
On Error GoTo 0
WaitForProcessToEnd (App.Path + "\dgets.bat " + App.Path)
filex = FreeFile
Open App.Path + "\GETTED" For Input As #filex
Line Input #filex, zz
Close #filex
diskactual = RTrim(zz)
Text1.Text = diskactual
End Sub
