CN107194210B - A kind of anti-crack method of single-chip microcontroller code - Google Patents
A kind of anti-crack method of single-chip microcontroller code Download PDFInfo
- Publication number
- CN107194210B CN107194210B CN201710310694.2A CN201710310694A CN107194210B CN 107194210 B CN107194210 B CN 107194210B CN 201710310694 A CN201710310694 A CN 201710310694A CN 107194210 B CN107194210 B CN 107194210B
- Authority
- CN
- China
- Prior art keywords
- eerom
- code
- chip microcontroller
- data address
- equal
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 12
- 230000001681 protective effect Effects 0.000 claims abstract description 6
- 238000012795 verification Methods 0.000 claims description 19
- 230000001256 tonic effect Effects 0.000 claims description 4
- 230000002159 abnormal effect Effects 0.000 claims description 3
- 238000010438 heat treatment Methods 0.000 claims description 3
- 238000005336 cracking Methods 0.000 abstract description 8
- 239000000758 substrate Substances 0.000 abstract description 3
- 230000006870 function Effects 0.000 description 7
- 230000006399 behavior Effects 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 241000208340 Araliaceae Species 0.000 description 1
- 235000005035 Panax pseudoginseng ssp. pseudoginseng Nutrition 0.000 description 1
- 235000003140 Panax quinquefolius Nutrition 0.000 description 1
- 230000005856 abnormality Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 235000008434 ginseng Nutrition 0.000 description 1
- 230000036651 mood Effects 0.000 description 1
- 238000012827 research and development Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000003860 storage Methods 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/10—Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
- G06F21/12—Protecting executable software
- G06F21/121—Restricting unauthorised execution of programs
- G06F21/125—Restricting unauthorised execution of programs by manipulating the program code, e.g. source code, compiled code, interpreted code, machine code
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Computer Security & Cryptography (AREA)
- Theoretical Computer Science (AREA)
- Multimedia (AREA)
- Technology Law (AREA)
- Computer Hardware Design (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Storage Device Security (AREA)
Abstract
The present invention relates to a kind of anti-crack methods of single-chip microcontroller code; it is implanted into protective program in the single-chip microcontroller code with EEROM function; the data that can be read in EEROM are performed in single-chip microcontroller code to be verified; it is cracking code or genuine code that program, which can judge automatically out; if it is genuine code; then execute normal function; then start corresponding service life countdown function if it is cracking code; it fails after so that substrate is worked normally a period of time; leading to cracker is the negative cost painful out of the behavior that cracks, and eventually leads to and cracks in vain.
Description
Technical field
The invention belongs to single-chip microcontroller code protection technical fields, more particularly to a kind of anti-side of cracking of single-chip microcontroller code
Method.
Background technique
Existing electronic product Innovation Input is increasing, iterates and is getting faster, and many factories are because lack Innovation Input
It is precipitated with technology, will pass through plagiarism hardware and the mode for cracking chip code and achieve the purpose that quick volume production, it is serious to destroy
The justice in market and the interests for compromising research and development company.
The mode that cracks that there are mainly two types of of current chip: non-intrusion type and intrusive mood.Non-intrusion type is set using chip
Loophole in meter or program timing sequence cracks chip, and with the development of chip technology, such case is fewer and fewer at present.It invades
The mode for entering formula is to destroy chip package, finds chip protection point using instruments such as semiconductor testing apparatus and is repaired, so
Recordable paper is read using special programming device afterwards.Both the above mode can quickly crack out the program of single-chip microcontroller, can be direct
Realize volume production.
China Patent Publication No. CN103761456A, publication date on April 30th, 2014, a kind of entitled single-chip microcontroller of invention
The anti-method cracked of core code has single-chip microcontroller inner core code specifically with ciphertext form this application discloses a kind of
Storage region, MPU memory protective module generates an interruption, in interruption, using AES module by ciphertext code decryption in plain text
Plaintext code after CRC check is correct, is passed back to particular memory region, interrupts and return, single-chip microcontroller executes specific memory section by code
The plaintext code in domain, after code is finished, the plaintext code of particular memory region is encrypted to ciphertext code, CRC by AES module
After verification is correct, ciphertext code is passed back into particular memory region.Disadvantage is that: the above patent is that core algorithm is cut
Block and encrypting storing, algorithm need subregion to store and encrypt, and need when execution to decrypt and verify again, extremely waste program is empty
Between, and algorithm complexity is not particularly suited for most of single chip application.
Summary of the invention
The present invention is intended to provide a kind of anti-crack method of single-chip microcontroller code, existing single-chip microcontroller can be efficiently solved
Deficiency existing for the anti-crack method of code.For this purpose, the specific technical solution that the present invention uses is as follows:
A kind of anti-crack method of single-chip microcontroller code, comprising the following steps:
After S1, single-chip microcontroller power on, the verification data saved in the verification data address in its EEROM are read;
S2, the verification data that step S1 is read are judged, if being equal to after expression SCM program burning for the first time
The numerical value powered on, then enter step S3;If entering step not equal to the numerical value for indicating to first power on after SCM program burning
Rapid S6;
S3, single-chip microcontroller wait the predetermined time, if unlocking successfully, to enter step S4 to determine whether unlocking motion;If
It unlocks unsuccessful and has been more than unlocked time, enter step S5;
S4, setting value is updated into the verification data address of EEROM, ordinary life value is updated into the service life to EEROM
In data address, S8 is entered step;
S5, exceptional value is updated into the verification data address of EEROM, if being entered by S3 step, by ordinary life
Value is assigned in the lifetime data address into EEROM, if being entered by remaining step, the lifetime data of lifetime data address subtracts
One, enter step S8;
S6: judging whether the verification data of the verification data address in EEROM are equal to setting value, if unequal, enters
Step S5 enters step S7 if equal;
S7: ordinary life value is assigned into the lifetime data address of EEROM, S8 is entered step;
S8: reading the lifetime data of the lifetime data address in EEROM, judges whether to be equal to abnormal life value, if equal,
Then enter step S9;If unequal, S10 is entered step;
S9: starting protection program;
S10: it works normally.
Further, the unlocking motion in the step S3 can include: keyboard numerical ciphers input, key click or
The data-signal etc. that multi-hit combination or specified I/O port receive.
Further, the protective program of the step S9 can include: the stopping function of tonic chord starting, starting hardware burns mode,
Open heating function until Thermal Cutoffs is burnt or nonstop switch motor etc. it is one or more.
The present invention by adopting the above technical scheme, has the beneficial effect that the present invention can judge automatically out in single-chip microcontroller
Code be that cracking code or genuine code if it is genuine code then execute normal function, then opened if it is cracking code
Corresponding service life countdown function is moved, is failed after so that substrate is worked normally a period of time, leading to cracker is that the behavior that cracks is negative out
Painful cost eventually leads to and cracks in vain.
Detailed description of the invention
Fig. 1 is the flow chart of the embodiment of the present invention.
Specific embodiment
To further illustrate that each embodiment, the present invention are provided with attached drawing.These attached drawings are that the invention discloses one of content
Point, mainly to illustrate embodiment, and the associated description of specification can be cooperated to explain the operation principles of embodiment.Cooperation ginseng
These contents are examined, those of ordinary skill in the art will be understood that other possible embodiments and advantages of the present invention.
Now in conjunction with the drawings and specific embodiments, the present invention is further described.Referring to Fig.1, specific step of the invention is described
Suddenly, comprising:
S1: after single-chip microcontroller powers on, reading the verification data of the designated position saved in EEROM, such as: it reads in EEROM
Address 02H in data as examine use, that is, address 02H as verification data address, read address 03H in data do
Judge to use for the service life, that is, address 03H is as lifetime data address, subsequently into S2 step.
S2: the data of the address 02H read are judged, if it is 0, indicate that single-chip microcontroller is the after burning program
It once powers on, carries out step S3;If not being 0, indicates that single-chip microcontroller is not to power on for the first time, enter step S6.
S3: single-chip microcontroller can normally be shown at this moment, but the function of tonic chord waits predetermined time (for example, 3S), is with determination
It is no to have unlocking motion.Unlocking motion can be keyboard numerical ciphers input or key click or multi-hit combination unlock grasp
Make, the data-signal that even specified I/O port receives.It unlocks successfully, enters step S4, unlock unsuccessful and be more than when unlocking
Between, enter step S5.Without unlocking motion it also hold that being that unlock is unsuccessful within the predetermined time of waiting.
S4: in the address 02H for updating setting value 80H to EEROM, the address 03H in lifetime data 50H to EEROM is updated
In, enter step S8.
S5: in the address 02H of update abnormal value FFH to EEROM, lifetime data 50H is then updated by the entrance of S3 step and is arrived
In the address 03H in EEROM, remaining step enters then lifetime data and subtracts one, enters step S8.
S6: judging whether the verification data of the address 02H in EEROM are equal to 80H, unequal, is expressed as cracking code,
Enter step S5.Equal, expression is legitimate code, enters step S7.
S7: program has confirmed that the code is legitimate code, in the address 03H in assignment lifetime data 50H to EEROM, with
As long as this guarantees legitimate code, the service life be will not change, and enter step S8.
S8: judge the lifetime data of the address 03H in the EEROM read, if be decremented to 05H, if being, expression is
Cracking code, and the service life has arrived, and needs to be implemented protective program, enters step S9.Words that no, expression is can to continue normal work
Make, enters step S10.
S9: starting protection program.Wherein, protective program can be off the function of tonic chord and start and prompt abnormality, start
Hardware burns mode, leads to substrate operation irregularity, opens heating function until Thermal Cutoffs burns, nonstop switch motor etc.
It is one or more of.Final purpose is that cracker is allowed to be to crack behavior to pay painful cost.
S10: it works normally.
It will be understood by those of skill in the art that specific verification data address involved in above embodiments description and
Its numerical value and lifetime data address and its numerical value are understood not to simply to illustrate that the present invention to the scope of the invention
Limitation.
Although specifically showing and describing the present invention in conjunction with preferred embodiment, those skilled in the art should be bright
It is white, it is not departing from the spirit and scope of the present invention defined by the appended claims, it in the form and details can be right
The present invention makes a variety of changes, and is protection scope of the present invention.
Claims (3)
1. a kind of anti-crack method of single-chip microcontroller code, which comprises the following steps:
After S1, single-chip microcontroller power on, the verification data saved in the verification data address in its EEROM are read;
S2, the verification data that step S1 is read are judged, if being first powered on after being equal to expression SCM program burning
Numerical value, then enter step S3;If being entered step not equal to the numerical value for indicating to first power on after SCM program burning
S6;
S3, single-chip microcontroller wait the predetermined time, if unlocking successfully, to enter step S4 to determine whether unlocking motion;If unlock
It is unsuccessful and be more than unlocked time, enter step S5;
S4, setting value is updated into the verification data address of EEROM, ordinary life value is updated into the lifetime data to EEROM
In address, S8 is entered step;
S5, exceptional value is updated into the verification data address of EEROM, if entering step S5 by S3 step, by positive Changshou
Life value is assigned in the lifetime data address into EEROM, if entering step S5, the service life number of lifetime data address by S6 step
According to subtracting one, S8 is entered step;
S6: judging whether the verification data of the verification data address in EEROM are equal to setting value, if unequal, enters step
S5 enters step S7 if equal;
S7: ordinary life value is assigned into the lifetime data address of EEROM, S8 is entered step;
S8: reading the lifetime data of the lifetime data address in EEROM, judges whether to be equal to abnormal life value, if equal, into
Enter step S9;If unequal, S10 is entered step;
S9: starting protection program;
S10: it works normally.
2. the anti-crack method of single-chip microcontroller code as described in claim 1, which is characterized in that the unlock in the step S3 is dynamic
Work include: the numerical ciphers input of keyboard, key click or multi-hit combination or the data-signal that receives of specified I/O port.
3. the anti-crack method of single-chip microcontroller code as described in claim 1, which is characterized in that the protective program of the step S9
Include: stop function of tonic chord starting, starting hardware burns mode, opens heating function until Thermal Cutoffs burns, nonstop switch
One of motor is a variety of.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710310694.2A CN107194210B (en) | 2017-05-05 | 2017-05-05 | A kind of anti-crack method of single-chip microcontroller code |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710310694.2A CN107194210B (en) | 2017-05-05 | 2017-05-05 | A kind of anti-crack method of single-chip microcontroller code |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107194210A CN107194210A (en) | 2017-09-22 |
CN107194210B true CN107194210B (en) | 2019-07-30 |
Family
ID=59873130
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710310694.2A Active CN107194210B (en) | 2017-05-05 | 2017-05-05 | A kind of anti-crack method of single-chip microcontroller code |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107194210B (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102087684A (en) * | 2009-12-04 | 2011-06-08 | 徐峰 | Method for encrypting consumable items through radio frequency identification electronic tag |
CN102163269A (en) * | 2011-04-02 | 2011-08-24 | 刘俊 | Method for preventing singlechip program from being decrypted and reused |
CN103745167A (en) * | 2013-12-31 | 2014-04-23 | 广东岭南通股份有限公司 | IAP method and device of single chip microcomputer |
CN103761456A (en) * | 2013-10-12 | 2014-04-30 | 利尔达科技集团股份有限公司 | Anti-cracking method for core code of singlechip |
CN103838997A (en) * | 2012-11-20 | 2014-06-04 | 海尔集团公司 | Single-chip microcomputer password verification method and device |
CN105678117A (en) * | 2014-11-19 | 2016-06-15 | 比亚迪股份有限公司 | Safety protection method for flash program of single-chip computer and protection device and single-chip computer |
-
2017
- 2017-05-05 CN CN201710310694.2A patent/CN107194210B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102087684A (en) * | 2009-12-04 | 2011-06-08 | 徐峰 | Method for encrypting consumable items through radio frequency identification electronic tag |
CN102163269A (en) * | 2011-04-02 | 2011-08-24 | 刘俊 | Method for preventing singlechip program from being decrypted and reused |
CN103838997A (en) * | 2012-11-20 | 2014-06-04 | 海尔集团公司 | Single-chip microcomputer password verification method and device |
CN103761456A (en) * | 2013-10-12 | 2014-04-30 | 利尔达科技集团股份有限公司 | Anti-cracking method for core code of singlechip |
CN103745167A (en) * | 2013-12-31 | 2014-04-23 | 广东岭南通股份有限公司 | IAP method and device of single chip microcomputer |
CN105678117A (en) * | 2014-11-19 | 2016-06-15 | 比亚迪股份有限公司 | Safety protection method for flash program of single-chip computer and protection device and single-chip computer |
Also Published As
Publication number | Publication date |
---|---|
CN107194210A (en) | 2017-09-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3132979B1 (en) | Vehicle-mounted network system, invalidity detection electronic control unit, and invalidity detection method | |
CN104969468B (en) | It is verified using the integrated circuit identification of physics unclonable function and burn-in test circuit based on ring oscillator and reliability | |
EP2613421B1 (en) | Semiconductor-based device authentication | |
CN107871068A (en) | Firmware burning method, cd-rom recorder and computer-readable recording medium | |
CN104040555B (en) | A smart card reader with a secure logging feature | |
CN101504705B (en) | Trusted platform module and its computer starting control method | |
CN101620656B (en) | Safety JTAG module and method for protecting safety of information inside chip | |
US8793810B2 (en) | Semiconductor-based device authentication | |
CN107423638A (en) | A kind of password management system and application method based on order detection type Modify password | |
CN105871558B (en) | A kind of digital control system right management method based on USB flash disk physical serial numbers | |
CN110968844A (en) | Software authorization method in off-line state, server and readable storage medium | |
TW201635186A (en) | System and method for computing device with improved firmware service security using credential-derived encryption key | |
CN107948155A (en) | Cryptographic check method, apparatus, computer equipment and computer-readable recording medium | |
CN106156635A (en) | Method for starting terminal and device | |
CN101667239B (en) | Protection method permitted by webmaster and device therefor | |
US9081963B1 (en) | Protecting against use of unauthorized electronic hardware devices | |
JP6457471B2 (en) | Operator identification system | |
CN102456102A (en) | Method for carrying out identity recertification on particular operation of information system by using Usb key technology | |
CN203773549U (en) | Chip identifier-based software security application device | |
CN107194210B (en) | A kind of anti-crack method of single-chip microcontroller code | |
CN100596058C (en) | System and method for managing credible calculating platform key authorization data | |
CN102413243B (en) | A kind of phone information safety protection mechanism realize method and system | |
KR20180007717A (en) | Soc having double security features, and double security method for soc | |
CN109886685A (en) | A kind of commodity tracing system and method based on block chain | |
Macher et al. | An automotive signal-layer security and trust-boundary identification approach |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
PE01 | Entry into force of the registration of the contract for pledge of patent right | ||
PE01 | Entry into force of the registration of the contract for pledge of patent right |
Denomination of invention: An anti cracking method of single chip microcomputer code Effective date of registration: 20211105 Granted publication date: 20190730 Pledgee: Xiamen Huli District Financing Guarantee Co., Ltd Pledgor: Xiamen Xinyang Technology Co., Ltd Registration number: Y2021980011992 |