Delphi plus registry self-starting code

xiaoxiao2021-03-05  27

Program EXE

;

Uses Windows

;

// Registry New key value function Procedure CreateKey (const rootkey: HKey; key, value, value: string

);

Var Handle: HKey

RES

, Disposition: INTEGER

;

Begin Res: = RegcreateKeyex (rootkey, pchar (key), 0, ''

, Reg_option_non_volatile, key_all_access, nil, handle, @disposition

); If res = 0

Then Begin Res: = RegSetValueex (Handle, Pchar (Valuename), 0

, REG_SZ, PCHAR (VALUE), Length (Value) 1

Regclosekey (Handle

) End

; END

Begin

// With the position name file path CreateKey (HKEY_LOCAL_MACHINE, 'Software / Microsoft / Windows / CurrentVersion / Run', 'Autorun', 'C: /Windows/regedit.exe'

); END

.

Previous code, use registry, not suitable for writing Trojans, have a few K

What about it. Title Delphi plus registry self-starting simple code selection from Jondynet

Blog Key Delphi

Plus registry self-starting the simplest code home USES registry

; Var REG: TREGISTRY

;

Begin reg: = Tregistry.create

Reg.RootKey: = HKEY_LOCAL_MACHINE

Reg.openkey ('Software / Microsoft / Windows / CurrentVersion / Run', TRUE

); reg.writestring ('scanregistry ",' mir47.exe '

Reg.closekey

; Reg.free

; END

.

转载请注明原文地址:https://www.9cbs.com/read-33766.html

New Post(0)