A small program simulating Kingsoft drug overlord and other software virus detection Processes

Source: Internet
Author: User

// -- A small process used to simulate the detection of Kingsoft drug overlord and other software virusesProgram
// -- Refer to jiurl's friend Program
// -- 04/28/2006 Friday
// -- Computer lab
// -- Micro_lee
# Include <stdio. h>
# Include <windows. h>
# Include <stdlib. h>
# Include <conio. h>
# Include <time. h>

Void main ()
{
Handle Hout;
Hout = getstdhandle (std_output_handle );
Setconsoletextattribute (Hout, foreground_green); // set the color.

Int I = 0;
Int interval = 5000;
Srand (unsigned) Time (null ));

While (1 ){

Setconsoletextattribute (Hout, foreground_green );

If (RAND () % 10 = 0) setconsoletextattribute (Hout, foreground_intensity | foreground_green );
If (RAND () % 2) printf (""); // print at a time: half may be blank
Else printf ("% d", Rand () % 2); // print at a time: 1/4 may be 1, 1/4 may be 0.

For (I = 0; I <rand (); I ++)
{
_ ASM NOP
}
// Use for to control the time without sleep (),
// The reason is that sleep () does not work when the interval is very small.
// Of course, when sleep () is used, the for loop like sleep () is very expensive for CPU resources.

If (kbhit () break; // click to exit
}

Return;
}

// -- Download the source code and use VC to build the project of the Win32 console application for compilation.

Related Article

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.