function GetAccessPassword(FilePath:string):string;<br>const<br>xorString:array[0..12]of byte=<br>( $86, $FB, $EC, $37,<br>$5D, $44, $9C, $FA,<br>$C6, $5E, $28, $E6,$13 );<br>var<br>passBuf:array[0..14]of byte;<br>pass:array[0..14]of char;<br>resultPass:string;<br>B:Byte;<br>F:TFileStream;<br>i:integer;<br>begin<br>F:=TFileStream.Create(FilePath,fmShareDenyNone);<br>//office 97 <br>try <br>F.Seek($42,soFromBeginning);<br>F.Read(passBuf,14);<br>for I:=0 to 13 do<br>begin<br>B := passBuf xor xorString;<br>pass:=char(B);<br>end;<br>pass[sizeof(pass) - 1] := #0;<br>resultPass:=StrPas(Pass);<br>finally<br>F.Free;<br>end;<br>result:=resultPass;<br>end;<br>*************<br>[FOR ACCESS97]<br>predef97:array[0..12] of byte=<br>($86,$fb,$ec,$37,<br>$5d,$44,$9c,$fa,<br>$c6,$5e,$28,$e6,$13);<br><br>[FOR ACCESS2000]<br>predef2k:array [0..20]of byte=<br>($d3,$ec,$08,$9c,<br>$93,$28,$46,$8a,<br>$01,$7b,$a0,$df,<br>$22,$13,$9a,$b1,<br>$61,$79,$c7,$7c,$5b);