原来曾有人在论坛上提供了将exe文件恢复成swf文件的,反过来的,你再找找看吧
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Button1: TButton;
Button2: TButton;
OpenDialog1: TOpenDialog;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var str: string;
begin
opendialog1.Execute;
str := Copy(opendialog1.FileName, 1, Pos('.', opendialog1.FileName) - 1);
edit1.Text := opendialog1.FileName;
edit2.Text := str + '.swf';
end;
procedure TForm1.Button2Click(Sender: TObject);
var
SourceStream, DestinyStream: TFileStream;
SwfFileSize: Cardinal;
begin
SourceStream := TFileStream.Create(edit1.Text, fmOpenRead or fmShareExclusive);
try
sourcestream.Seek(-2 * sizeof(integer), sofromend);
sourcestream.ReadBuffer(swffilesize, sizeof(integer));
if swffilesize = $FA123456 then
begin
sourcestream.ReadBuffer(swffilesize, sizeof(swffilesize));
sourcestream.Seek(-swffilesize - 2 * sizeof(integer), sofromend);
destinystream := tfilestream.Create(edit2.Text, fmcreate);
try
destinystream.CopyFrom(sourcestream, swffilesize);
showmessage('file has been converted successfully.');
finally
destinystream.Free;
end;
end
else
showmessage('unknown type of executable flash files.');
finally
sourcestream.Free;
end;
end;
end.