A file verification method and device
A verification method and verification algorithm technology, applied in the field of information security, can solve problems such as occupying storage space
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0053] see figure 1 , which shows a method for file verification provided by an embodiment of the present invention, the method can be applied to a device capable of running a target ELF file, and the method can include:
[0054] S101: When running the target ELF file, obtain the actual check value of the target ELF file according to a preset check algorithm;
[0055] S102: During the process of running the target ELF file, read the verification reference value of the target ELF file from the preset gap byte of the target ELF file;
[0056] S103: comparing the actual verification value with the verification reference value;
[0057] S104: When the actual verification value is consistent with the verification reference value, it is determined that the verification is successful;
[0058] S105: When the actual verification value is inconsistent with the verification reference value, it is determined that the verification fails.
[0059] It should be noted that the preset veri...
Embodiment 2
[0064] to combine figure 1 The technical solution shown, such as figure 2 The overall format of the ELF file is shown, and the ELF file is a segment-based data structure. For an ELF file, the file begins with the ELF Header field information; then the program header table (Program Header Table); then the content information of each section Segment; then the section header table (SectionHeader Table), the section header table There are fields to record information such as the actual length of each Segment. The location of the section header table can be indicated by the value in the ELF Header field. In order to improve the access speed of the CPU, the length of each segment segment in the ELF file has a size alignment requirement. Therefore, the actual length of the Segment data in each section is usually less than or equal to the size of the Segment, which creates a gap between sections. In addition, in the ELF file format, the reserved fields reserved for each section ar...
Embodiment 3
[0072] In combination with the first two embodiments, before step S101, refer to Figure 4 , the method also includes the process of writing the verification reference value of the target ELF file into the gap byte in the target ELF file, which may specifically include:
[0073] S100A: traverse the target ELF file, and obtain the gap bytes in the target ELF file;
[0074] S100B: Write the verification reference value of the target ELF file into the gap bytes according to a preset writing rule.
[0075] It can be understood that step S100A and step S100B can be executed by the device for generating the target ELF file, which is not specifically limited in this embodiment of the present invention.
[0076] In conjunction with the preset gap bytes of the target ELF file described in Embodiment 2, it may specifically include: the space between each section in the target ELF file and the reserved reserved field of each section of the ELF file; correspondingly, step S100A may inclu...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


