Original: C # hack Access database Password method
Using system;using system.collections.generic;using system.io;using system.linq;using System.Text;using System.windows.forms;namespace demo{class Program {[STAThread] static void Main (string[] args) {OpenFileDialog F = new OpenFileDialog (); if (F.showdialog ()! = DialogResult.OK) return; MessageBox.Show ("Password: [" + GetPassword (f.filename) + "]", "password"); }//Get password static string GetPassword (string file) {///unencrypted file 0x42 every interval before start to 0x61 Section value byte[] Basebyte = {0xbe, 0xec, 0x65, 0x9c, 0xFE, 0x28, 0x2b, 0x8a, 0x6c, 0x7b, 0xCD, 0XDF, 0x4f, 0x13, 0x F7, 0xb1,}; byte flagbyte = 0x0c; The value of the flag 0x62 string password = ""; try {FileStream fs = File.openread (File); Fs. Seek (0x14, Seekorigin.begin); BYTE ver = (byte) fs. ReadByte (); Get version, 1 is Access2000, 0 is ACCESS97 fs. Seek (0x42, Seekorigin.begin); Byte[] bs = new byte[33]; if (fs. Read (BS, 0,)! =) return ""; BYTE flag = (Byte) (bs[32] ^ flagbyte); for (int i = 0; i < i++) {byte b = (byte) (Basebyte[i] ^ (bs[i * 2])); if (i% 2 = = 0 && ver = = 1) b ^= flag; Access + if (B > 0) {var ch = (char) b; Password +=ch; }}} catch {} return password; } }}
C # Hack Access database Password method