本文整理自网络,侵删。
{**********}
{ }
{ 映像劫持编辑器 }
{ }
{ 版权所有 (C) 2009 Abbey_Studio }
{ }
{ 作者:Servite }
{ }
{ QQ: 2261206 }
{ }
{ Blog: http://abbey_studio.blog.163.com }
{ }
{ }
{**********}
unit Main;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, ComCtrls, Registry;
type
TIFEO_Form = class(TForm)
AppName: TLabeledEdit;
AppPath: TLabeledEdit;
Add_LAdd_Name: TButton;
Add_LAdd_Path: TButton;
IFEO_LIST: TListView;
IFEO_Btn: TButton;
RE_BTN: TButton;
Del_Btn: TButton;
Open_File: TOpenDialog;
procedure Add_LAdd_NameClick(Sender: TObject);
procedure Add_LAdd_PathClick(Sender: TObject);
procedure IFEO_BtnClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure RE_BTNClick(Sender: TObject);
procedure Del_BtnClick(Sender: TObject);
private
{ Private declarations }
procedure ViewIfeo;
public
{ Public declarations }
end;
var
IFEO_Form: TIFEO_Form;
implementation
{$R *.dfm}
procedure TIFEO_Form.ViewIfeo;
const
VL = 'Debugger';
key_ = 'SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\';
var
REG: TRegistry;
Strs: TStringList;
I: Byte;
Path: string;
begin
REG:= TRegistry . Create; Strs:= TStringList . Create;
try
with REG do
begin
RootKey:= HKEY_LOCAL_MACHINE;
if OpenKey( key_, False ) then
begin
GetKeyNames( Strs );
for I := 0 to Strs.Count - 1 do
begin
CloseKey;
if OpenKey( key_ + Strs[I], False ) then
begin
Path:= ReadString( VL );
if FileExists( Path ) then
begin
with IFEO_LIST . Items . Add do
begin
Caption:= Strs[I];
SubItems . Add( Path );
end;
end;
end;
end;
end;
end;
finally
REG . Free; Strs . Free;
end;
end;
//----------
function SetOrDel ( AName, APath: string; SW_BOOL: Boolean ): Boolean;
const
VL = 'Debugger';
key_ = 'SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\';
var
REG: TRegistry;
begin
REG:= TRegistry . Create;
try
with REG do
begin
RootKey:= HKEY_LOCAL_MACHINE;
if SW_BOOL then
begin
if CreateKey( key_ + AName ) then
begin
if OpenKey( key_ + AName, false ) then
begin
WriteString( VL, APath );
Result:= True;
end;
end;
end else begin
if OpenKey( key_, False ) then
begin
if DeleteKey( AName ) then
Result:= True;
end;
end;
end;
finally
REG . Free;
end;
end;
//----------
procedure TIFEO_Form.Add_LAdd_NameClick(Sender: TObject);
VAR
Str: string;
begin
if Open_File . Execute() then
begin
Str:= ExtractFileName( Open_File . FileName );
AppName . Text:= Str;
end;
end;
procedure TIFEO_Form.Add_LAdd_PathClick(Sender: TObject);
begin
if Open_File . Execute() then
begin
AppPath . Text:= Open_File . FileName
end;
end;
procedure TIFEO_Form.Del_BtnClick(Sender: TObject);
var
Item: TListItem;
begin
Item:= IFEO_LIST . Selected;
if SetOrDel( Item . Caption, '', False ) then
begin
Item . Destroy;
MessageDlg('删除完成~!', mtInformation, [mbOK], 0);
end;
end;
procedure TIFEO_Form.FormShow(Sender: TObject);
begin
ViewIfeo;
end;
procedure TIFEO_Form.IFEO_BtnClick(Sender: TObject);
begin
if (AppName . Text <> '')and ( FileExists( AppPath . Text ) ) then
begin
if SetOrDel( AppName . Text, AppPath . Text, True ) then
begin
with IFEO_LIST . Items . Add do
begin
Caption:= AppName . Text;
SubItems . Add ( AppPath . Text );
end;
MessageDlg('劫持成功~!', mtInformation, [mbOK], 0);
end;
end else MessageDlg('输入要劫持程序 + 替换执行程序路径~!', mtError, [mbOK], 0);
end;
procedure TIFEO_Form.RE_BTNClick(Sender: TObject);
begin
IFEO_LIST . Clear;
ViewIfeo;
end;
end.
相关阅读 >>
Delphi richedit 的scrollbar自动向下滚动
更多相关阅读请进入《Delphi》频道 >>