Security profiling of CMOS Data

Source: Internet
Author: User

Text/SuperVirus
 
I wonder if you have written some prank or little "virus" experiences? I used to play this thing before and never thought about how to contribute and earn living expenses. However, after reading several articles, I feel that no one has discussed this in detail. In this issue, I am going to make an ugly look, hey. The pen name of the original "web technical expert" is too exaggerated. The experts want to laugh at me, so we should keep a low profile and call it the name on the blog. This article focuses on the backup of CMOS information.
Next, let's start with the question. Virus (here mainly refers to some boring spam prank software), after entering the computer, for some self-protection considerations, CMOS is often changed to an all-in-one view, some of my friends who often install the software have the same experience as me. When I felt that the machine was weird one day, I found that some settings were tampered with so I could not believe my eyes.
CMOS stores information necessary for starting the instance, such as clock data, date, basic memory, extended memory, various driver information, and the CMOS password for starting the instance. Once the SETUP is modified by malware or cainiao, it will affect the normal operation of the computer, and it will be a waste of time to reset the settings. If a technical level of malware is encountered, it will not be changed. Therefore, the backup and restoration of CMOS is critical.
The software used to recover CMOS Data has appeared. However, after I downloaded the software and tested it back, it was either unavailable or not enough. Therefore, I wrote a cmos.exe file in C language to operate CMOS. The following is a brief introduction.
Basic Function: Read the CMOS Data. Create a CMOS. DAT file under the current drive letter to save the data information. Write the CMOS data, that is, to reply to the CMOS settings.
Principle of software read/write operation: Read data through the cmos ram data register with the I/O port address of h; write the backed-up data to CMOS through the cmos ram address register with the I/O port address of 70 h.
This program is compiled and compiled in the vcpus +6.0environment. After connecting, use exe2bin.exeto convert cmos.exe to cmos.com and then run it. During the backup operation, you can save the data to the cmos.datfile through cmos.exe, Save the data file and the cmo.exe program to a portable USB flash drive or burn it to the CD, and recover the data later. The following is my implementation code. You can read it by yourself. It's not hard, hey!
 
# Include <stdio. h>
# Include <stdlib. h>
# Include <conio. h>
# Include <dos. h>

Int l;
FILE * fp;
Void hfcmos (void );
Void savecmos (void );
Void wtcmos (void );
Int main ()
{
System ("CLS ");
Printf ("Save CMOS data & Restore CMOS data program ");
Printf ("Save CMOS data to file: CMOS. DAT ");
Printf ("Restore CMOS data from file: CMOS. DAT ");
Printf ("By SuperVirus www.supervirus.51.com ");
Printf ("Input your choice :");
Scanf ("% d", & l );
Switch (l ){
Case 1:
Hfcmos ();
Break;
Case 2:
Wtcmos ();
Break;
Default:
Printf ("Pig choice! Check your choice! ");
Exit (1 );
Break;
} Return 0;
}

Void hfcmos (void)
{
If (fp = fopen ("CMOS. DAT", "rb "))! = NULL ){
Printf ("File: CMOS. DAT already exist, overwrite (Y/N? ");
L = getche ();
If (l = 89lii (l-122 )){
Fclose (fp );
System ("if exist CMOS. BAK del CMOS. BAK ");
System ("ren CMOS. dat cmos. BAK );
Savecmos ();
Else
Exit (1 );
}
}
Else
Savecmos ();
}
Void savecmos (void)
{
If (fp = fopen ("CMOS. DAT", "wb") = NULL ){
Printf ("Can not open file: CMOS. DAT ");
Exit (1 );
}
Fclose (fp );
}
For (I = 0; l <256; l ++ ){
Outportb (0 × 70, I), fp );
}
Fclose (fp );
}
Void wtcmos (void)
{
If (fp = fopen ("CMOS. DAT", "rb")-NULL)
{
Printf ("File: CMOS. DAT dos not exit! ")
EXIT (1 );
}
For (I = 0; l <256; l ++ ){
Outportb (0 × 70, l );
Outportb (0 × 71, fgetc (fp ));
}
Fclose (fp );
}

Now the source code is over. People who understand it will think it is actually very simple. When it comes to the key, let's take it out. The main purpose of this article is to give a reference and hope to attract everyone's interest in CMOS programming. If you have any questions about this article, welcome to the anti-DDoS forum.

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.