Hex file processing method and application

A file processing and file technology, applied in the field of Hex file processing, can solve problems such as program cracking or rewriting, and achieve the effect of consistent format and length, low memory requirements, and accurate control

Active Publication Date: 2020-01-24
SHAANXI FAST GEAR CO
View PDF7 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003]The main purpose of the present invention is to solve the problem in the prior art that the file in Hex format is directly used for program flashing, and the program is easily cracked or rewritten due to data outflow , providing a Hex file processing method and application

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Hex file processing method and application

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0037] Process the Hex file that needs to be flashed in the car TCU, specifically:

[0038] Step 1, perform CRC32 check on every 4 Blocks of the Hex file, get the corresponding CRC32 check code, put it into the specified address position according to the Intel format, that is, the reverse order of placing the most significant bit on the high address;

[0039] Step 2, perform AES128 encryption on the data field in each Record, keep the data length field, load address field, data type field, checksum field, etc., and set the corresponding decryption program in the TCU internal startup program;

[0040] Step 3, recalculate the checksum of each encrypted Record;

[0041] Step 4, write the Hex file processed in steps 1 to 3 to the TCU, and start the program inside the TCU to decrypt it;

[0042] Step 5: The TCU calculates the CRC32 check code. If they are consistent, the data in the Hex file is correct and stored in the TCU memory; otherwise, the data in the Hex file is incorrect ...

Embodiment 2

[0044] Process the Hex file that needs to be flashed in the car TCU, specifically:

[0045] Step 1, perform byte padding on each Record in the Hex file, so that the format and length of each Record are consistent, which is convenient for subsequent data processing;

[0046] Step 2, perform CRC32 check on each Block of the Hex file to obtain the corresponding CRC32 check code, and put it into the specified address position according to the Intel format, that is, the reverse order in which the most significant bit is placed on the high address;

[0047] Step 3, perform AES128 encryption on the data field in each Record, keep the data length field, address field, data type field and checksum field unchanged, and set the corresponding decryption program in the TCU internal startup program;

[0048] Step 4, recalculate the checksum of each encrypted Record;

[0049] Step 5, write the Hex file processed in steps 1 to 4 to the TCU, and start the program inside the TCU to decrypt it;...

Embodiment 3

[0052] Process the Hex file that needs to be flashed in the car ESC, specifically:

[0053] Step 1. Group the Blocks of the Hex file. The number of blocks in each group varies according to the needs. Perform CRC16 check on the specified address segment of each group of Blocks to obtain the corresponding CRC16 check code, and put it into the specified address location according to the Intel format. , that is, the reverse order in which the most significant bit is placed on the high address;

[0054]Step 2, perform AES192 encryption on the data field in each Record, keep the data length field, address field, data type field and checksum field unchanged, and set the corresponding decryption program in the ESC internal startup program;

[0055] Step 3, recalculate the checksum of each encrypted Record;

[0056] Step 4, write the Hex file processed in steps 1 to 3 to the ESC, and start the program inside the ESC to decrypt it;

[0057] Step 5: The ESC calculates the CRC16 check c...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention belongs to an embedded system file processing method. The invention particularly relates to a Hex file processing method and application. The method comprises the following steps: step 1, grouping Blocks of a Hex file, each group comprising at least one Block, performing CRC check on a specified address field of each group of Blocks to obtain a corresponding CRC check code, and putting the CRC check code into a specified address position, namely a CRC placement address, according to an Intel format; wherein the specified address field does not contain a CRC placement address; step 2, encrypting a data domain in each Record, and setting a corresponding decryption program in a controller pre-flashed by the Hex file; step 3, recalculating the checksum of each encrypted Record; step 4, flashing the processed Hex file into the pre-flashed controller, and decrypting the pre-flashed controller through a decryption program; and step 5, accounting the CRC check code by the pre-flashed controller. By means of the Hex file processing method, the problem that in the prior art, a file in the Hex format is directly used for program flashing, and a program is prone to being crackedor rewritten due to data outflow is solved.

Description

technical field [0001] The invention belongs to an embedded system file processing method, in particular to a Hex file processing method and its application. Background technique [0002] The Hex file is a file format created for a specific MCU. This file records the programs and data required for the operation of the MCU's internal PROM. This format file is currently a file format commonly used in the embedded system industry. The code developed in the embedded development environment will eventually generate a Hex file through a series of steps such as compilation and linking. The Hex file generated by the compilation process records the code and data stored in the controller PROM in plain text. If Directly used for program flashing can easily cause data outflow, which in turn leads to the program being cracked or rewritten. Contents of the invention [0003] The main purpose of the present invention is to solve the problem in the prior art that the file in Hex format i...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F11/10G06F21/60H04L9/06
CPCG06F11/1004G06F21/602H04L9/0631
Inventor 何亚楠徐旭毕乾坤郝海洋
Owner SHAANXI FAST GEAR CO
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products