Multimedia Delphi

Title: how to extract swf from Flash Projector (EXE)
procedure ExtractSWF;
var
p:pointer;
f:file;
sz,
swfsize:integer;
const
SWF_FLAG:integer=$FA123456;
begin
if not fileexists('test.exe') then begin
messagebox(handle,pchar('File not found'),pchar('Error'),MB_ICONERROR);
exit;
end;
assignfile(f,'test.exe');
reset(f,1);
seek(f,filesize(f)-(2*sizeof(integer)));
blockread(f,sz,sizeof(integer));
if szswf_flag then begin
messagebox(handle,pchar('Not a valid Projector Exe'),pchar('Error'),MB_ICONERROR);
closefile(f);
exit;
end;
blockread(f,swfsize,sizeof(integer));
seek(f,filesize(f)-(2*sizeof(integer))-swfsize);
getmem(p,swfsize);
blockread(f,p^,swfsize);
closefile(f);
assignfile(f,'test.swf'));
rewrite(f,1);
blockwrite(f,p^,swfsize);
closefile(f);
freemem(p,swfsize);
messagebox(handle,pchar('SWF Extracted'),pchar('Succes'),MB_ICONINFORMATION);
end;
end.