VERSION 5.00
Begin VB.Form Main 
   BackColor       =   &H00000000&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Armadillo Cleaner v1.0 by BLiND PRoPHET"
   ClientHeight    =   2670
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   7140
   BeginProperty Font 
      Name            =   "Tahoma"
      Size            =   8.25
      Charset         =   161
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   Icon            =   "Main.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2670
   ScaleWidth      =   7140
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton Command3 
      Cancel          =   -1  'True
      Height          =   375
      Left            =   6600
      Picture         =   "Main.frx":0BD2
      Style           =   1  'Graphical
      TabIndex        =   3
      ToolTipText     =   "Exit"
      Top             =   2160
      Width           =   375
   End
   Begin VB.CommandButton Command2 
      Height          =   375
      Left            =   6000
      Picture         =   "Main.frx":0F5C
      Style           =   1  'Graphical
      TabIndex        =   2
      ToolTipText     =   "About The Author"
      Top             =   2160
      Width           =   375
   End
   Begin VB.CommandButton Command1 
      Height          =   375
      Left            =   5400
      Picture         =   "Main.frx":12E6
      Style           =   1  'Graphical
      TabIndex        =   1
      ToolTipText     =   "Clean"
      Top             =   2160
      Width           =   375
   End
   Begin VB.ListBox List1 
      Appearance      =   0  'Flat
      BackColor       =   &H00E0E0E0&
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   161
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1980
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   5055
   End
   Begin VB.Label Label1 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "Armadillo Cleaner will clean all the registry settings made by Armadillo-Protected Applications, such as Time Restriction."
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   161
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   615
      Left            =   0
      TabIndex        =   4
      Top             =   2040
      Width           =   5055
   End
   Begin VB.Image Image1 
      Height          =   1920
      Left            =   5160
      Picture         =   "Main.frx":1870
      Top             =   120
      Width           =   1920
   End
End
Attribute VB_Name = "Main"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'ArmClean v1.0 by BLiND PRoPHET
'[bl1nd_proph3t@yahoo.com]
'[www.blindprophet.tk]

Private Sub Command1_Click()
Dim TheValue    As String
Dim ThePath     As String
Dim TempPath
Dim TheFiles    As String

On Error GoTo Er

'HKEY_CLASSES_ROOT
List1.AddItem "Key Enumeration (ROOT) Started..."
List1.Selected(List1.ListCount - 1) = True

'erase and re-create the AllKeys() Array
Erase AllKeys()
ReDim AllKeys(0) As String
'enumerate all keys under the HKEY_CLASSES_ROOT\CLSID path
EnumKey HKEY_CLASSES_ROOT, "CLSID"
List1.AddItem "Key Enumeration (ROOT) Finished..."
List1.Selected(List1.ListCount - 1) = True

'erase and re-create the ArmKeys() Array
Erase ArmKeys()
ReDim ArmKeys(0) As String
'search for the Armadillo keys
For i = 1 To UBound(AllKeys)
    DoEvents
    ThePath = "CLSID\" & AllKeys(i)
    TheValue = Trim(ReadValue(HKEY_CLASSES_ROOT, ThePath, "0"))
    
    'if we found one, add it to the Array
    If TheValue <> "" Then
        ReDim Preserve ArmKeys(UBound(ArmKeys) + 1) As String
        ArmKeys(UBound(ArmKeys)) = ThePath
    End If
Next i

'check if there were found any keys
If UBound(ArmKeys) = 0 Then
    'if not
    List1.AddItem "No Armadillo Keys Were Found In (ROOT)"
    List1.Selected(List1.ListCount - 1) = True
Else
    'if yes
    List1.AddItem UBound(ArmKeys) & " Armadillo Key(s) Found :"
    List1.Selected(List1.ListCount - 1) = True
    
    'show the keys
    For i = 1 To UBound(ArmKeys)
        DoEvents
        List1.AddItem ArmKeys(i)
        List1.Selected(List1.ListCount - 1) = True
    Next i
    
    List1.AddItem "Deleting Armadillo Keys..."
    List1.Selected(List1.ListCount - 1) = True
    
    'delete the keys
    For i = 1 To UBound(ArmKeys)
        DoEvents
        DeleteKey HKEY_CLASSES_ROOT, ArmKeys(i) & "\Version"
        DeleteKey HKEY_CLASSES_ROOT, ArmKeys(i)
    Next i
    List1.AddItem "Keys Deleted Successfully..."
End If



'HKEY_CURRENT_USER
List1.AddItem "Key Enumeration (USER) Started..."
List1.Selected(List1.ListCount - 1) = True

'erase and re-create the AllKeys() Array
Erase AllKeys()
ReDim AllKeys(0) As String
'enumerate all keys under the HKEY_CLASSES_ROOT\CLSID path
EnumKey HKEY_CURRENT_USER, "Software\Classes"
List1.AddItem "Key Enumeration (USER) Finished..."
List1.Selected(List1.ListCount - 1) = True

'erase and re-create the ArmKeys() Array
Erase ArmKeys()
ReDim ArmKeys(0) As String

'search for the Armadillo keys
For i = 1 To UBound(AllKeys)
    DoEvents

    'if a key is found, add it
    If Left(AllKeys(i), 1) = "{" Then
        ReDim Preserve ArmKeys(UBound(ArmKeys) + 1) As String
        ArmKeys(UBound(ArmKeys)) = AllKeys(i)
    End If
Next i

If UBound(ArmKeys) = 0 Then
    List1.AddItem "No Armadillo Keys Were Found In (USERS)"
    List1.Selected(List1.ListCount - 1) = True
Else
    List1.AddItem UBound(ArmKeys) & " Armadillo Key(s) Found :"
    List1.Selected(List1.ListCount - 1) = True
    
    'show the keys
    For i = 1 To UBound(ArmKeys)
        DoEvents
        List1.AddItem ArmKeys(i)
        List1.Selected(List1.ListCount - 1) = True
    Next i
    
    List1.AddItem "Deleting Armadillo Keys..."
    List1.Selected(List1.ListCount - 1) = True
    
    'delete the keys
    For i = 1 To UBound(ArmKeys)
        DoEvents
        DeleteKey HKEY_CURRENT_USER, "SOFTWARE\Classes\" & ArmKeys(i) & "\Version"
        DeleteKey HKEY_CURRENT_USER, "SOFTWARE\Classes\" & ArmKeys(i)
    Next i
    List1.AddItem "Keys Deleted Successfully..."
    List1.Selected(List1.ListCount - 1) = True
End If

'Delete Armadillo Standard Keys
'these keys are always created by Armadillo in a standard position
List1.AddItem "Deleting Standard Key 1..."
List1.Selected(List1.ListCount - 1) = True
DeleteKey HKEY_CURRENT_USER, "Software\The Silicon Realms Toolworks\Armadillo"

List1.AddItem "Deleting Standard Key 2..."
List1.Selected(List1.ListCount - 1) = True
DeleteKey HKEY_LOCAL_MACHINE, "Software\The Silicon Realms Toolworks\Armadillo"

'get temp path
Set fso = CreateObject("Scripting.FileSystemObject")
Set TempPath = fso.GetSpecialFolder(2)

If Right$(TempPath, 1) <> "\" Then TempPath = TempPath & "\"

'enum the *.tmp files from the Temp Directory
List1.AddItem "Deleting Armadillo Temp Files..."
List1.Selected(List1.ListCount - 1) = True

TheFiles = Dir(TempPath & "*.tmp")
Do Until Len(TheFiles) = 0
    'if the filename is 12 characters and it does NOT start with the '~' character
    'delete the file
    If (Len(TheFiles) = 12) And (Left$(TheFiles, 1) <> "~") Then
        Kill TempPath & TheFiles
    End If
    TheFiles = Dir
Loop

List1.AddItem "Armadillo Was Successfully Removed !"
List1.Selected(List1.ListCount - 1) = True
Exit Sub
Er:
'if there is an error deleting the file, Resume Next
If Err.Number = 53 Then Resume Next
End Sub

Private Sub Command2_Click()
AboutBox.Show vbModal
End Sub

Private Sub Command3_Click()
End
End Sub

Private Sub Form_Load()
List1.AddItem "Armadillo Cleaner v1.0 - Load Successful"
End Sub
