Code:
{*******************************************************}
{ }
{ Decrypt ATT file }
{ }
{ Copyright (C) 2010 Gunz }
{ }
{ www.Cheats.lv }
{ }
{*******************************************************}
unit Unit3;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
const
LoginKeys : array [0..2] of Byte = ($FC, $CF, $AB);
XorKeys : Array[0..15]of Byte = ($D1, $73, $52, $F6, $D2, $9A, $CB, $27,
$3E, $AF, $59, $31, $37, $B3, $E7, $A2);
type
TForm3 = class(TForm)
Browse: TOpenDialog;
Button1: TButton;
Panel1: TPanel;
Map: TImage;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form3: TForm3;
implementation
{$R *.dfm}
procedure Decrypt3Bytes(Data: TStream);
var
CIn,COut: Byte;
i: Integer;
begin
for i := 0 to Data.Size - 1 do
begin
Data.Position := i;
Data.Read(CIn,1);
COut := CIn xor LoginKeys[i mod 3];
Data.Position := i;
Data.Write(COut,1)
end;
end;
procedure DecryptAtt(Data: TStream);
var
CIn,COut,Key: Byte;
i: Integer;
begin
Key := $5E;
for i := 0 to Data.Size - 1 do
begin
Data.Position := i;
Data.Read(CIn,1);
COut := CIn xor XorKeys[i mod 16] - Key;
key := CIn + $3D;
Data.Position := i;
Data.Write(COut,1)
end;
end;
function GetColor(Get:Byte):TColor;
begin
case Get of
$00:Result := clGreen;
$01:Result := clOlive;
$04:Result := clNavy;
else
Result := clBlack;
end;
end;
procedure TForm3.Button1Click(Sender: TObject);
var
Fs,Ms: TStream;
i,j: Integer;
Tmp,x,y: Byte;
begin
if Browse.Execute then
begin
try
Fs := TFileStream.Create(Browse.FileName,fmOpenRead);
except
on e: Exception do
begin
MessageDlg('Failed to open file with error: '+E.Message, mtError, [mbOK], 0);
Exit;
end;
end;
x := 0;
y := 0;
Ms := TMemoryStream.Create;
try
Ms.CopyFrom(Fs,Fs.Size);
Ms.Position := 0;
DecryptAtt(Ms);
Ms.Position := 0;
Decrypt3Bytes(Ms);
Ms.Position := 0;
for i := 4 to Ms.Size - 1 do
begin
Ms.Position := i;
Ms.Read(Tmp,1);
Map.Canvas.Pixels[x,y] := GetColor(Tmp);
Inc(y);
if y = 0 then
Inc(x)
end;
finally
Ms.Free;
Fs.Free;
end;
end
end;
end.
in Atachament project source and binary