Limitations of software trial times

Source: Internet
Author: User
Tags error code reset

There are many ways to limit the number of software trials, and the key is to store the number of times that value. This article describes a method that restricts the trial of software by changing the time of the file to store the number of trials.

To limit the number of software trials by changing the file time

In MS-DOS, the time of the file is saved by a 16-bit value, the bit 15~11 is used to save the number of hours, the bit 10~5 is used to hold the minutes, and the bit 4~0 is used to hold the number of seconds. This 16-bit value is exactly what we can use to save the trial count. For example, in the following sample program, the author uses a bit to save the number of minutes to save the trial count. Run the sample program, we can see that only the number of minutes of file time added 1, the average person is difficult to detect, this method has a better concealment.

Ii. interrupts involved in the sample program

1. Interrupt 21H function 3DH

Purpose: Open file for reading. Write or supplement.

Call Register: ah=3dh,al=00h,ds:dx= filename;

Return Register: CF Reset--Successful, ax= file handle.

CF Position-Error, ax= error code.

2. Interrupt 21H function 3EH

Purpose: Forcibly clears all buffers, updates the directory, and invalidates the file handle.

Call Register: ah=3eh,bx= file handle;

Return Register: CF Reset--successful, Ax destroyed,

CF Position-Error, ax= error code.

3. Interrupt 21H function 57H, sub function 00H

Purpose: read out the date and time the file was last modified.

Call Register: ax=5700h,bx= file handle;

Return registers: CF Reset--Successful, cx= file time, dx= file date,

CF Position-Error, ax= error code.

4. Interrupt 21H function 57H, sub function 01H

Purpose: Changes the date and time information that the file was last modified to the specified value.

Call Register: ax=5701h,bx= file handle, cx= new time, dx= new date;

Return Register: CF Reset--Successful,

CF Position-Error, ax= error code.

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.