Compile prob.
Jeg vide ikke hvorfor jeg ikke kan compile denne kode?-------------------------------------------
program MSNPass;
uses
Forms,
unit1 in 'unit1.pas' {Form1};
{$R *.RES}
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
-------------------------------------------------------
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls,registry;
type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
type
PassParts = array [0..6,0..3] of byte;
DecPassArray = array [0..24] of byte;
var
PassSize:integer;
function EquivalentPositions(EncByte:byte):byte;
var
DecByte:byte;
begin
Case EncByte of
$41..$5A:DecByte:=EncByte-$41;
$61..$7A:DecByte:=(EncByte-$61)+$1A;
$30..$39:DecByte:=(EncByte-$30)+$34;
$2B:DecByte:=$3E;
$2F:DecByte:=$3F;
$3D:DecByte:=$40;
else
DecByte:=$FF;
end;
EquivalentPositions:=DecByte;
end;
function GetRegPassword():DecPassArray;
const
PassKey='\Software\Microsoft\MessengerService';
PassVal='Password.NET Messenger Service';
var
MyRegistry:TRegistry;
RegDatum:DecPassArray;
begin
MyRegistry:=TRegistry.Create;
MyRegistry.OpenKey(PassKey,False);
PassSize:=MyRegistry.GetDataSize(PassVal);
MyRegistry.ReadBinaryData(PassVal,RegDatum,PassSize);
GetRegPassword:=RegDatum;
end;
function SortPassBytes(Pass:DecPassArray):PassParts;
var
Temp:PassParts;
i,i2:integer;
begin
For i:=0 to (PassSize-1) div 4 do
For i2:=0 to 3 do
Temp[i,i2]:=Pass[i*4+i2];
SortPassBytes:=Temp;
end;
function DecodePassword():string;
var
PassPart: PassParts;
iPart: integer;
GI, FC, SC, TC: byte;
FCValInSet, FCPosInSet: integer;
SCValInSet, SCPosInSet: integer;
TCPosInSet: integer;
C1, C2, C3: char;
Password: DecPassArray;
Temp: string;
begin
Password:=GetRegPassword;
PassPart:=SortPassBytes(GetRegPassword);
for iPart:=0 to (PassSize div 4)-1 do
begin
GI:=EquivalentPositions(PassPart[iPart,0]);
FC:=EquivalentPositions(PassPart[ipart,1]);
SC:=EquivalentPositions(PassPart[ipart,2]);
TC:=EquivalentPositions(PassPart[ipart,3]);
C2:=#0;
C3:=#0;
FCPosInSet:=FC div $10;
FCValInSet:=FC mod $10;
C1:=Char(GI*$4+FCPosInSet);
If SC < $40 then
begin
SCPosInSet:=SC div $4;
SCValInSet:=SC mod $4;
C2:=Char(FCValInSet*$10+SCPosInSet);
end;
If TC < $40 then
begin
TCPosInSet:=TC;
C3:=Char(SCValInSet*$40+TCPosInSet);
end;
Temp:=Temp+C1+C2+C3;
end;
DecodePassword:=Temp;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Edit1.Text:=DecodePassword;
end;
end.
-------------------------------------------------------
some help plz :)
