用EXE生成另一个EXE的问题 我现在有二个EXE文件A.exe 有一个FLASH播放器,并加载了一个a.swfB.exe 要求能够替换A.exe中的a.swf 更改成 b.swf 然后生成C.exe谁能帮我想想有什么办法实现这个流程 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 exe和asf分开进行,直接替换asf即可,不用生成b.exe 分离出a.exe中的a.swf,使用流操作可以实现。N久前的代码(Exe文件中提取Flash文件),供你参考:function Exe2Swf ( SourceFile : String ) : Boolean;var SourceStream : TFileStream; DestStream : TMemoryStream; TmpBuf : Array [0..3] of Byte; SWFLength : DWORD;begin if not FileExists ( SourceFile ) then exit; SourceStream := TFileStream.Create( SourceFile, fmOpenRead or fmShareExclusive ); DestStream := TMemoryStream.Create; try SourceStream.Seek ( SourceStream.Size - 8, soFromBeginning ); SourceStream.Read ( TmpBuf, 4 ); //Check the flash of flash exe file! if ( Byte ( TmpBuf [0] ) <> $56 ) or ( Byte ( TmpBuf [1] ) <> $34 ) or ( Byte ( TmpBuf [2] ) <> $12 ) or ( Byte ( TmpBuf [3] ) <> $FA ) then begin Application.MessageBox('The file you selected is not a flash exe file!', 'File format error!', MB_OK+MB_ICONINFORMATION ); Result := false; exit; end; SourceStream.Seek ( SourceStream.Size - 4, soFromBeginning ); SourceStream.Read ( TmpBuf, 4 ); Try SWFLength := Ord ( Byte ( TmpBuf[3] ) ); SWFLength := SWFLength shl 8 + Ord ( Byte ( TmpBuf[2] ) ); SWFLength := SWFLength shl 8 + Ord ( Byte ( TmpBuf[1] ) ); SWFLength := SWFLength shl 8 + Ord ( Byte ( TmpBuf[0] ) ); except Application.MessageBox('Error!', 'Error!', MB_OK ); Result := false; end; SourceStream.Seek ( SourceStream.Size - 8 - SWFLength, soFromBeginning ); DestStream.CopyFrom( SourceStream, SWFLength ); DestStream.SaveToFile ( ChangeFileExt ( SourceFile, '.swf') ); finally SourceStream.Free; DestStream.Free; end; Result := true;end;至于a.swf到c.exe,反过来就可以了! 不知道楼上的理解了楼主的意思,还是我理解了楼主的意思.a.swf 应该是独立的. b.exe 只需要替换掉 a.exe 调用的a.swf 即可. 也就不用生成c.exe . 如果a.exe在运行. 就用b.exe 先关闭a.exe , 再替换a.swf. 再打开a.exe . 我用了vclskin皮肤,在vista上面跑的时候,发现主菜单位置变到右边去了 Range Check Error paradox能否当分布式数据库系统用 代码编辑器的状态栏中的Diagram的作用 如何提取mp3文件里的id信息 一个关于不同的数据类型符值的问题!!! 请教各位,如何计算超过20的阶乘? 》》》》》》明天回家,下午2点的火车,特散分! 哪里有关于TTreeView 和 TListView控件的使用例程,还请网友指点! Help!如何使用EPSON 的Cash drawer? ADO连接产生'验证失败'错误? 大家帮忙看看这段查询代码,谢谢!
function Exe2Swf ( SourceFile : String ) : Boolean;
var
SourceStream : TFileStream;
DestStream : TMemoryStream;
TmpBuf : Array [0..3] of Byte;
SWFLength : DWORD;
begin
if not FileExists ( SourceFile ) then
exit; SourceStream := TFileStream.Create( SourceFile, fmOpenRead or fmShareExclusive );
DestStream := TMemoryStream.Create; try
SourceStream.Seek ( SourceStream.Size - 8, soFromBeginning );
SourceStream.Read ( TmpBuf, 4 ); //Check the flash of flash exe file!
if ( Byte ( TmpBuf [0] ) <> $56 ) or
( Byte ( TmpBuf [1] ) <> $34 ) or
( Byte ( TmpBuf [2] ) <> $12 ) or
( Byte ( TmpBuf [3] ) <> $FA ) then
begin
Application.MessageBox('The file you selected is not a flash exe file!', 'File format error!', MB_OK+MB_ICONINFORMATION );
Result := false;
exit;
end; SourceStream.Seek ( SourceStream.Size - 4, soFromBeginning );
SourceStream.Read ( TmpBuf, 4 ); Try
SWFLength := Ord ( Byte ( TmpBuf[3] ) );
SWFLength := SWFLength shl 8 + Ord ( Byte ( TmpBuf[2] ) );
SWFLength := SWFLength shl 8 + Ord ( Byte ( TmpBuf[1] ) );
SWFLength := SWFLength shl 8 + Ord ( Byte ( TmpBuf[0] ) );
except
Application.MessageBox('Error!', 'Error!', MB_OK );
Result := false;
end; SourceStream.Seek ( SourceStream.Size - 8 - SWFLength, soFromBeginning );
DestStream.CopyFrom( SourceStream, SWFLength ); DestStream.SaveToFile ( ChangeFileExt ( SourceFile, '.swf') );
finally
SourceStream.Free;
DestStream.Free;
end; Result := true;
end;至于a.swf到c.exe,反过来就可以了!