Masih membahas apa yang bisa dilakukan oleh VB 6.0 (Visual Basic 6.0) dan kali ini saya akan membagikan kepada teman-teman kode program untuk melihat/mengetahui kata sandi/password Database Access. Ok, langsung saja ke TKP.
- Buat Project baru.
- Pada Form yang aktif tambahkan 1 Textbox dan 1 Commanbutton.
- Tambahkan 1 Common Dialog dengan cara, pilih menu Project --> Components --> centang Microsoft Common Dialog Control 6.0 (SP6).
- Atur Properties Textbox, Name=txtGet.
- Atur Properties Commanbutton, Name=cmdGet dan Caption=Pilih Database.
- Atur Properties Common Dialog, Name=cd.
- Masuk ke jendela kode dan buat sebuah Function, berikut kodenya.
- Klik 2x tombol Pilih Database dan masukkan kode berikut ini.
- Selesai dan jalankan programnya.
Dim str2000 As String
Dim File As String
Option Explicit
Private Function GetPassword()
On Error GoTo ErrHand
Dim Access2000Decode As Variant
Dim fFile As Integer
Dim bCnt As Integer
Dim retXPwd(17) As Integer
Dim wkCode As Integer
Dim mgCode As Integer
Access2000Decode = Array(&H6ABA, &H37EC, &HD561, &HFA9C, &HCFFA, _
&HE628, &H272F, &H608A, &H568, &H367B, _
&HE3C9, &HB1DF, &H654B, &H4313, &H3EF3, _
&H33B1, &HF008, &H5B79, &H24AE, &H2A7C)
If Len(File) > 0 Then
fFile = FreeFile
Open File For Binary As #fFile
Get #fFile, 67, retXPwd
Get #fFile, 103, mgCode
Close #fFile
mgCode = mgCode Xor Access2000Decode(18)
str2000 = vbNullString
For bCnt = 0 To 17
wkCode = retXPwd(bCnt) Xor Access2000Decode(bCnt)
If wkCode < 256 Then
str2000 = str2000 & Chr(wkCode)
Else
str2000 = str2000 & Chr(wkCode Xor mgCode)
End If
Next bCnt
Else
str2000 = "No file Selected"
End If
Exit Function
ErrHand:
MsgBox "Error with opening file", vbCritical, App.Title
End Function
cd.Filter = "Microsoft Access Files (*.mdb)|*.mdb|All Files (*.*)|*.*"
cd.DialogTitle = App.FileDescription
cd.ShowOpen
If Not Len(cd.FileName) = 0 Then
File = cd.FileName
GetPassword
txtGet.Text = "Passwordnya adalah: " & vbCrLf & str2000
End If