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 PDF

Info

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
Application number
CN201710310694.2A
Other languages
Chinese (zh)
Other versions
CN107194210A (en
Inventor
刘家斌
刘全喜
魏肃
柴智
刘双春
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiamen Polytron Technologies Inc
Original Assignee
Xiamen Polytron Technologies Inc
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Xiamen Polytron Technologies Inc filed Critical Xiamen Polytron Technologies Inc
Priority to CN201710310694.2A priority Critical patent/CN107194210B/en
Publication of CN107194210A publication Critical patent/CN107194210A/en
Application granted granted Critical
Publication of CN107194210B publication Critical patent/CN107194210B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/12Protecting executable software
    • G06F21/121Restricting unauthorised execution of programs
    • G06F21/125Restricting unauthorised execution of programs by manipulating the program code, e.g. source code, compiled code, interpreted code, machine code

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

A kind of anti-crack method of single-chip microcontroller code
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.
CN201710310694.2A 2017-05-05 2017-05-05 A kind of anti-crack method of single-chip microcontroller code Active CN107194210B (en)

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)

* Cited by examiner, † Cited by third party
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

Patent Citations (6)

* Cited by examiner, † Cited by third party
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
CN110968844B (en) Software authorization method in off-line state, server and readable storage medium
EP3132979B1 (en) Vehicle-mounted network system, invalidity detection electronic control unit, and invalidity detection method
CN104040555B (en) A smart card reader with a secure logging feature
CN107871068A (en) Firmware burning method, cd-rom recorder and computer-readable recording medium
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
CN108885675A (en) Encryption ASIC including circuit code transforming function transformation function
CN105871558B (en) A kind of digital control system right management method based on USB flash disk physical serial numbers
US20060080537A1 (en) Illegal analysis / falsification preventing system
US20130176104A1 (en) Semiconductor-Based Device Authentication
WO2013177304A2 (en) Systems and methods for verifying uniqueness in anonymous authentication
CN106156635A (en) Method for starting terminal and device
CN107948155A (en) Cryptographic check method, apparatus, computer equipment and computer-readable recording medium
CN101667239B (en) Protection method permitted by webmaster and device therefor
CN104321776A (en) Offline authentication with embedded authorization attributes
JP6457471B2 (en) Operator identification system
CN102456102A (en) Method for carrying out identity recertification on particular operation of information system by using Usb key technology
CN107194210B (en) A kind of anti-crack method of single-chip microcontroller code
CN107784226A (en) The method and system that code is maliciously tampered are prevented using rivest, shamir, adelman
KR101954439B1 (en) Soc having double security features, and double security method for soc
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
CN109886685A (en) A kind of commodity tracing system and method based on block chain
US10788809B2 (en) Method for the enabling of machine functions on a spinning-mill machine
CN103916243B (en) The dynamic encrypting method and encryption system of a kind of controller

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