Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Locked out by password... 1

Status
Not open for further replies.

JennyPeters

Programmer
Oct 29, 2001
228
US
I've put a password on my code using Tools > Database Properties > Protection Tab. Now I've forgotten it. I can't get to the code, not even by opening a blank db and trying to import them!

If anyone knows a backdoor, you would really help me out!

Thanks,

Jenny
 
Hi Jenny

I have a program that will do this, however the prog. is copyrigthed so I can not mail you the program - however if you mail me z zip of the base ofline on hl@wfbutik.dk I can give you the password.
 
Thanks for your help. Unfortunately taking up your offer would cause problems with my confidentiality clause I signed.

Can you tell me the name of the program and I will purchase it myself?

I have found a lot of software that cracks codes, but these are only for the database passwords and not the passwords for the VBA code. Is your program any different than these?

Thanks,

Jenny
 
Jenny-

Don't spend your money until you've tried these. Access password crackers are available in the public domain. Try placing the applicable (97 or 2000) function in another database (not the one you're trying to open, and then call it with the path to your database, e.g.:

from debug window:
? Access2000Password(&quot;c:\My Documents\myApp.mdb&quot;. True) <enter>

Please post back with your results.

Bob

Public Function Access2000Password(ByVal Filename As String, Optional bTrimNulls As Boolean = True) As String

' AUTHOR: JTRockville@programmer.net
' TERMS OF USE: Freeware

' This function will return the password of an Access
' 2000 database, and optionally, trim the nulls.

' The parameter Filename should contain the full name and
' location of the database for which you want the password.

Dim iFileNumber As Integer
Dim iFilePosition As Integer
Dim iKeyPosition As Integer
Dim iDecryptKey(13) As Integer
Dim strInputChar As String
Dim strPassword As String

' These 14 values are used to decrypt the value stored
' in the .mdb, in order to produce the password.
' Even though the values are entered in hexadecimal
' format, what is stored in the iDecryptKey variable is
' the ascii value.

iDecryptKey(0) = (&HEF)
iDecryptKey(1) = (&HEC)
iDecryptKey(2) = (&H34)
iDecryptKey(3) = (&H9C)
iDecryptKey(4) = (&HAF)
iDecryptKey(5) = (&H28)
iDecryptKey(6) = (&H7A)
iDecryptKey(7) = (&H8A)
iDecryptKey(8) = (&H3D)
iDecryptKey(9) = (&H7B)
iDecryptKey(10) = (&H9C)
iDecryptKey(11) = (&HDF)
iDecryptKey(12) = (&H1E)
iDecryptKey(13) = (&H13)

iKeyPosition = 0
iFileNumber = FreeFile
Open Filename For Binary Access Read As #iFileNumber ' Open file for input.

' Read every other character stored in positions 67-93
' of the input file.

For iFilePosition = 67 To 93 Step 2 'Read in Encrypted Password

Seek #iFileNumber, iFilePosition ' Set position.
strInputChar = Input(1, #iFileNumber) ' Read character.

' Take each of those 14 characters,
' do an xor bitwise comparison to it's corresponding
' &quot;iDecryptKey&quot; key, and store the resulting character.

' The xor operator accepts and returns ascii values,
' but does the comparison using binary values. So,
' for example:
' The first value to translate is asc(242).
' The first decryption code, iDecryptKey(0), is 134.
' In binary,
' The value to translate: 11110010
' The decryption code is: 10000110
' Xor compares each digit: If they're the same,
' the result is 0, if they're different, the result is 1.
' So the result, in our example, is binary 1110100.
' Xor returns the ascii value, 116, or lower case &quot;t&quot;.

strPassword = strPassword & Chr(Asc(strInputChar) Xor iDecryptKey(iKeyPosition)) 'Decrypt using Xor
iKeyPosition = iKeyPosition + 1 'increment pointer

Next iFilePosition
Close #iFileNumber ' Close file.

Access2000Password = strPassword
'IIf(bTrimNulls, Replace(strPassword, Chr(0), &quot;&quot;), strPassword)

End Function

Function AccessPassword(ByVal Filename As String) As String
'find Access97 password

Dim MaxSize, NextChar, MyChar, secretpos, TempPwd
Dim secret(13)
secret(0) = (&H86)
secret(1) = (&HFB)
secret(2) = (&HEC)
secret(3) = (&H37)
secret(4) = (&H5D)
secret(5) = (&H44)
secret(6) = (&H9C)
secret(7) = (&HFA)
secret(8) = (&HC6)
secret(9) = (&H5E)
secret(10) = (&H28)
secret(11) = (&HE6)
secret(12) = (&H13)

secretpos = 0
Open Filename For Input As #1 ' Open file for input.

For NextChar = 67 To 79 Step 1 'Read in Encrypted Password

Seek #1, NextChar ' Set position.
MyChar = Input(1, #1) ' Read character.
TempPwd = TempPwd & Chr(Asc(MyChar) Xor secret(secretpos)) 'Decrypt using Xor
secretpos = secretpos + 1 'increment pointer

Next NextChar
Close #1 ' Close file.

AccessPassword = TempPwd

End Function
 
raskew,

The result came out as:
Ï Ï Ï Ï Ï Ï Ï

I know the password is 8 characters, so I'm not sure how close this is, as it is 7 characters. However, this is the most promising result yet.

None of the above mentioned programs have been able to crack the VBA project code. Everyone keeps trying to show me crackers that give the user, admin, or database passwords.

Again, this password is set in the Visual Basic Editor under tools > db properties > protection tab.

You are so close. Any other tips?

Jenny!
 
Hi Jenny
I have had a look at the code above and, I am sorry to say, I got nothing but jibirish, however it still looks to like the code is looking for the base password not the vba password that you are looking for.

So as I see it you have 2 options, goto the adress the QKE has provided or mail the thing to me, sorry
 
Use the following script from another db.

'From debugwindow:
'Print AccessPassword(&quot;c:\my documents\db1.mdb&quot;)
'substituting your path and database name

Function AccessPassword(ByVal Filename As String) As String

Dim MaxSize, NextChar, MyChar, secretpos, TempPwd
Dim secret(13)
secret(0) = (&H86)
secret(1) = (&HFB)
secret(2) = (&HEC)
secret(3) = (&H37)
secret(4) = (&H5D)
secret(5) = (&H44)
secret(6) = (&H9C)
secret(7) = (&HFA)
secret(8) = (&HC6)
secret(9) = (&H5E)
secret(10) = (&H28)
secret(11) = (&HE6)
secret(12) = (&H13)

secretpos = 0
Open Filename For Input As #1 ' Open file for input.

For NextChar = 67 To 79 Step 1 'Read in Encrypted Password

Seek #1, NextChar ' Set position.
MyChar = Input(1, #1) ' Read character.
TempPwd = TempPwd & Chr(Asc(MyChar) Xor secret(secretpos)) 'Decrypt using Xor
secretpos = secretpos + 1 'increment pointer

Next NextChar
Close #1 ' Close file.

AccessPassword = TempPwd

End Function

I've used it a number of times and it worked like a charm.

P.S. I think it was copied from the Accessweb site, so all credits go to them..... Grtz,

Kalin
 
Kalin,

The result I got was: ¦‘ ¦‘ ¦‘ ¦

which isn't the password.

Again, we're very close.

Any other thoughts?

Jenny

And thanks hermanlaksko, but the confidentiality still holds me back. However, I do appreciate your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top