⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 getapass.pas

📁 ACCESS密码提取
💻 PAS
📖 第 1 页 / 共 2 页
字号:
    	Result.FileType:='';
    	Exit;                                                                                           //不是MDB格式则直接返回,不计算密码
    end else
	if Buf[$14] = 0 then																				//2000的前身,呵呵
	begin
    	PassCode := '';
    	Stream.Seek($42, 00); Stream.Read(Buf[0], 20);
		for i := 0 to 19 do
        Begin
        	N:=Buf[i] xor InCode97[i];
            If N>128 then                                          										//如果是中文件密码(字符ASCII大于128)
            	PassCode := PassCode + Widechar(N)                                 						//返回中文件字符
            Else
				PassCode := PassCode + chr(N);                                     						//普通ASCII字符
        End;
        Result.PassCode := PassCode;
		Result.FileType := 'ACCESS-97';																	//置为97数据库
		Exit; // 按Access97版本处理
    end;
    Date0 := EncodeDate(1978, 7, 01);
  	Date1 := EncodeDate(1989, 9, 17);
  	Date2 := EncodeDate(2079, 6, 05);
    Stream.Seek($42, 00); Stream.Read(ReaderArray[0], 40);												//读文件流(第66起的40位数据)
  	Stream.Seek($75, 00); Stream.Read(BaseDate, 4);                                                     //时间校验位(第177位的一个"字"长度)
  	Stream.Free;
  	if (BaseDate >= $90000000) and (BaseDate < $B0000000) then
    begin
    	WSec := BaseDate xor $903E6C94;
    	WTime := Date2 + WSec / 8192 * 2;
  	end else
    begin
    	WSec := BaseDate xor $803E6C94;
    	WTime := Date1 + WSec / 8192;
    	if WSec and $30000000 <> 0 then
        begin
      		WSec := $40000000 - WSec;
      		WTime := Date1 - WSec / 8192 / 2;
    	end;
  	end;
  	if WTime < Date1 then
    begin
    	for i := 0 to 9 do
        begin
      		InhereArray[i * 2] := (Trunc(WTime) - Trunc(Date0)) xor UserCode[i] xor $F000;
      		InhereArray[i * 2 + 1] := InhereCode[i];
    	end;
  	end else
    begin
    	if WTime >= Date2 then
        begin //2076.6.5之后
      		for i := 0 to 9 do
            begin
        		InhereArray[i * 2] := (Trunc(WTime) - Trunc(Date1)) xor UserCode[i];
        		InhereArray[i * 2 + 1] := InhereCode2[i];
      		end;
    	end else
        begin //2076.6.5之前
      		for i := 0 to 9 do
            begin
        		InhereArray[i * 2] := (Trunc(WTime) - Trunc(Date1)) xor UserCode[i];
        		InhereArray[i * 2 + 1] := InhereCode[i];
      		end;
    	end;
  	end;
  	PassCode := '';
  	for i := 0 to 19 do
    begin
    	N := InhereArray[i] xor ReaderArray[i];
    	if N <> 0 then
    	begin
    		If N>128 then
        		PassCode := PassCode +WideChar(N)														//返回中文字符
        	else
    			PassCode := PassCode + Chr(N);                                                          //返回ASCII字符
    	end;
  	end;
  	Result.FileType := 'ACCESS-2000';
  	Result.PassCode := PassCode;
  Except
  	Begin
  		PassCode:='';
	    Result.PassCode:='';
    	Result.FileType:='';
    End;
  End;
end;

procedure TPassForm.ListView1SelectItem(Sender: TObject; Item: TListItem;
  Selected: Boolean);
begin
	If Item<>Nil then Edit2.Caption:=Item.SubItems[2];
    If Item.SubItems[2]<>'' then
	    LB_LEN.Caption:='  密码长度:  '+Inttostr(LENGTH(WideString(Item.SubItems[2])))+' 位  '
    Else LB_LEN.Caption:='  ';
    H1.Enabled:=Not((Item.SubItems[1]='文件夹') or (Item.SubItems[1]='应用程序'));
end;

procedure TPassForm.Edit2DblClick(Sender: TObject);
begin
	If Edit2.Caption<>'' then
    begin
		Clipboard.Clear;
    	Clipboard.AsText:=Edit2.Caption;
        ShowMessage('密码已复制到剪粘板!');
    End;
end;

procedure TPassForm.ListView1DblClick(Sender: TObject);
begin
	If ListView1.SelCount=0 then exit;
	If ListView1.Selected=Nil then exit;
    If (ListView1.Selected.SubItems[1]='ACCESS-97') or (ListView1.Selected.SubItems[1]='ACCESS-2000') then
    begin
        Try                        
	        ACCDB:=CreateOleObject('Access.Application');                                               //用OLE打开可能带密码的ACCESS数据库
            ACCDB.OpenCurrentDatabase(LastPath+Trim(ListView1.Selected.Caption),True,Edit2.caption);
            ACCDB.visible:=True;
        Except ON E:Exception do
        	Begin
            	Application.MessageBox(Pchar('打开文件失败:'+#13+E.Message),'提示',MB_OK+48);
                VarClear(ACCDB);
            End;
        End;
    end else
    begin
    	//  类型为文件夹 ,则双击后直接进入
    	If (pos('文件夹',ListView1.Selected.SubItems[1])>0) And (LeftStr(ListView1.Selected.Caption,1)=' ') then
        begin
        	Edit1.text:=LastPath+Trim(ListView1.Selected.Caption);
            Button1.click;
        End Else
        //已知文件类型,直接打开文件
		Case ShellExecute(Handle,'OPEN',Pchar(LastPath+Trim(ListView1.Selected.Caption)),'',Pchar(LastPath),SW_SHOW) of
    		5:WinExec(PChar(LastPath+Trim(ListView1.Selected.Caption)), SW_SHOWNORMAL);
    		6..31:H1.Click;																				//未知类型,采用打开方式打开文件
    	END;
    end;
end;

procedure TPassForm.Button3Click(Sender: TObject);
var
	Paths_:String;
begin
	//清空历史路径
    VisitDir.Clear; 
    Edit1.SetFocus;
	Paths_:=LastPath;
	If SelectDirectory('请选择路径:','',Paths_) then
    begin
    	Edit1.Text:=Paths_;
        If Edit1.text='' then Edit1.text:='C:\';
		Button1.Click;
    End;
end;

procedure TPassForm.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
	If Key=#13 then Button1.Click;
end;           
{
	打开方式
}
procedure TPassForm.H1Click(Sender: TObject);
begin
	//调用WIN系统的打开方式
	WinExec(PChar(Format('rundll32.exe shell32.dll,OpenAs_RunDLL %S',[LastPath+Trim(ListView1.Selected.Caption)])), SW_SHOWNORMAL);
end;

{
	属性对话框
}
procedure TPassForm.P1Click(Sender: TObject);
procedure SHOWPRO;                                        												//调用WIN系统的属性对话框
var
	SEI: PShellExecuteInfoA;
begin
	New(SEI);
 	try
   		with SEI^ do
   		begin
     		cbSize := SizeOf(SEI^);
     		FMask := SEE_MASK_NOCLOSEPROCESS or SEE_MASK_INVOKEIDLIST or SEE_MASK_FLAG_NO_UI;
     		Wnd := Handle;
     		lpVerb := 'properties';
     		lpFile := Pchar(LastPath+Trim(ListView1.Selected.Caption));
     		lpParameters := nil;
     		lpDirectory := nil;
     		nShow := 0;
     		hInstApp := HInstance;
     		lpIDList := nil;
        end;
   		ShellExecuteEx(SEI);
    finally
   		Dispose(PShellExecuteInfoA(SEI));
    end;
end;
begin
  	SHOWPRO;
end;

procedure TPassForm.ListView1MouseDown(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin     
    If button<>mbRight then exit;
	If ListVIew1.Selected=Nil then exit;
    If ListView1.ItemIndex<0 then exit;
    PopupM.Popup(Mouse.CursorPos.X,Mouse.CursorPos.Y );
end;

{
	返回至上级目录
}
procedure TPassForm.SPB_TOPClick(Sender: TObject);
begin
	If Length(LastPath)<4 then exit;
    Edit1.text:=LastPath+'..\';
    Button1.click;
end;

procedure TPassForm.FormCreate(Sender: TObject);
begin
	VisitDir:=TStringList.Create;            														//记录历史访问列表
end;

procedure TPassForm.FormDestroy(Sender: TObject);
begin
	FreeAndNil(VisitDir);
end;

procedure TPassForm.SPB_PRIMouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var
	Lis_:integer;
    MITM:TMenuItem;
begin
	Case Button of
    mbLeft:
    	begin
			If VisitDir.Count =0 then exit;				//没有历史访问路径
	    	Edit1.Text:=VisitDir.Strings[VisitDir.Count-1];
		    VisitDir.Delete(VisitDir.Count-1);
    		Button1.Click;
		    VisitDir.Delete(VisitDir.Count-1);
    	End;
    mbRight:
	    begin
    		PopupList.Items.Clear;
        	For Lis_:=0 to VisitDir.Count-1 do
	        begin
    	    	MITM:=TMenuItem.Create(PopupList);
        	    With MITM do
            	begin
                	Tag:=Lis_;
	            	Caption:=VisitDir.Strings[Lis_];
                    onClick:=PopupListClick;
    	        End;
        	    PopupList.Items.Add(MITM);
	        End;
    		PopupList.Popup(Mouse.CursorPos.X,Mouse.CursorPos.Y );
		End;
    End;
end;

procedure TPassForm.PopupListClick(Sender: TObject);
begin
	Edit1.text:=TMenuItem(Sender).Caption;
    Button1.Click;
    While VisitDir.Count>TMenuItem(Sender).Tag do
    begin
		 VisitDir.Delete(TMenuItem(Sender).Tag);
    End;
end;

procedure TPassForm.Button2Click(Sender: TObject);
begin
	Close;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -