ACCESS2000資料庫檔案密碼的提取(來源程式c++builder5)(推薦大家轉換成C#版本)

來源:互聯網
上載者:User
access|c++|程式|資料|資料庫|轉換 #include <vcl.h>
#pragma hdrstop

#include "dolACCESS.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
Tform1 *form1;
//---------------------------------------------------------------------------
__fastcall Tform1::Tform1(TComponent* Owner)
       : Tform(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall Tform1::SpeedButton1Click(TObject *Sender)
{
  if( OpenDialog1->Execute())
      edtFileName->Text=OpenDialog1->FileName;
  else
      Application->MessageBoxA("沒有選定有效檔案名稱!","訊息",IDOK);     
              
}
//---------------------------------------------------------------------------
void __fastcall Tform1::Button1Click(TObject *Sender)
{
   int iFileHandle;
   int iByteRead;
   int i,j;
   char *pszBuffer;
   char Code[0x27]={0x10,0xEC,0xCB,0x9C,0x50,0x28,0x85,0x8A,0xC2,0x7B,
                    0x63,0xDF,0xE1,0x13,0x59,0xB1,0xA2,0x79,0x04,0x7C};
   if(edtFileName->Text.Length()!=0)
   {
       try
       {
               iFileHandle=FileOpen(edtFileName->Text,fmOpenRead);
               FileSeek(iFileHandle,0x42,0);
               pszBuffer=new char[0x27];
               iByteRead=FileRead(iFileHandle,pszBuffer,0x27);
               FileClose(iFileHandle);
               i=iByteRead/2;
               for(j=0;j<=i;j++)
               {
                  Code[j]=Code[j]^pszBuffer[2*j];
               }
               delete [] pszBuffer;
               edtPassword->Text=Code;
               if(edtPassword->Text.Length()==0)
                  edtPassword->Text="此資料庫未設定密碼!";
       }
       catch(const Exception& e)
       {
               Application->MessageBoxA("讀取檔案錯誤!!!","錯誤!",IDOK);
       }
   }
   else
   {
       Application->MessageBoxA("沒有輸入有效檔案名稱","注意!",IDOK);
   }


相關文章

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。