A Method, Device, Equipment and Medium for Identifying VxWorks Library Functions
By identifying VxWorks library functions through sequence comparison of selected function sets, the method addresses inefficiencies in existing tools, enhancing recognition speed and accuracy.
Patent Information
- Application Number
- CN202310153449.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-17
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2043-02-17
AI Technical Summary
The existing VxWorks library function recognition methods are inefficient, especially when the system version, CPU architecture, end order and compilation methods of the target VxWorks binary file are inconsistent, it is difficult for existing tools to accurately identify library functions.
By determining the specific functions in the sample VxWorks file, select the library function collection in the VxWorks file to be identified according to the specific functions, and determine whether the arrangement order between the library functions is the same. If the same, confirm that the library functions are consistent, otherwise feature recognition is performed to determine the library function.
It greatly reduces the number of library functions recognition, improves the efficiency and accuracy of VxWorks library functions recognition, and avoids the recognition and verification of all library functions one by one.
Smart Images

Figure CN116107701B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technologies, and in particular, to a method, device, equipment, and medium for identifying VxWorks library functions. Background Art
[0002] The real-time operating system (VxWorks, VXW) is an embedded real-time operating system designed and developed by Wind River System (WRS) in the United States. Due to its good reliability and excellent real-time performance, it is widely used in fields with high real-time requirements such as military, aerospace, and communication. Most manufacturers using the VxWorks system often remove the symbol files of VxWorks when releasing the firmware to avoid reverse analysis of their device firmware, resulting in security researchers being unable to know the functions of functions from the function names, which causes certain difficulties for reverse analysis. There are generally more than 10,000 functions in the compiled VxWorks binary file. To identify the library functions among them, it is generally necessary to analyze the implementation algorithms of each function, and it is undoubtedly very inefficient to identify library functions by manually analyzing the algorithms of each function.
[0003] In response to the above problems, the current methods for automatically identifying library functions include the Interactive Disassembler Professional (IDA) signature and the BinDiff tool. Among them, the IDA signature is a library function recognition mechanism dedicated to IDA. Using relevant tools, some.a files related to VxWorks can be generated into IDA signatures, and these IDA signatures are used to identify library functions in VxWorks. Since its recognition algorithm is based on specific assembly-level instructions, this method has strict requirements on the system version, Central Processing Unit (CPU) architecture, endianness, and compilation method of the target VxWorks binary file, and they must be exactly the same to be recognized. Additionally, since VxWorks is a closed-source system, it is difficult to collect a large number of available.a files on the network. Therefore, the available signature files that can be made are very limited, resulting in a low efficiency of identifying library functions through IDA signatures. The algorithm of the BinDiff tool is based on the abstract results of processing binary files, rather than specific assembly-level instructions. Therefore, it does not strictly limit the CPU architecture, endianness, and compilation method. However, the BinDiff tool relies on some VxWorks samples with symbols. That is to say, the recognition algorithm of the BinDiff tool depends on the function associations in the entire binary file. Therefore, it is almost impossible to accurately identify library functions when two VxWorks binary files are not from the same source. In the real scenario, it is almost impossible to find VxWorks binary files that are from the same source and have symbols. Therefore, the efficiency of the BinDiff tool in identifying library functions is low.
[0004] In summary, the current methods for automatically identifying library functions have low recognition efficiency. Summary of the Invention
[0005] Embodiments of the present application provide a method, device, equipment, and medium for identifying VxWorks library functions to solve the problem of low efficiency in identifying library functions in the prior art.
[0006] In a first aspect, embodiments of the present application provide a method for identifying VxWorks library functions, and the method includes:
[0007] Determine a specific function for positioning according to the characteristics of library functions in a sample VxWorks file;
[0008] Determine a target function corresponding to the specific function among the library functions of the VxWorks file to be identified according to the specific function;
[0009] Select a set of the first library functions with a set number according to the set selection rules based on a specific function in the sample VxWorks file, and select a set of the second library functions with a set number according to the set selection rules based on a target function in the VxWorks file to be recognized;
[0010] Determine whether the arrangement order among the library functions in the first library function set is the same as the arrangement order among the library functions in the second library function set;
[0011] If so, determine each library function included in the sample VxWorks file as each library function included in the VxWorks file to be recognized; if not, identify the characteristics of the library functions in the sample VxWorks file and the characteristics of the library functions in the VxWorks file to be recognized, and determine each library function included in the VxWorks file to be recognized among each library function included in the sample VxWorks file according to the recognition result.
[0012] In a second aspect, an embodiment of the present application further provides a VxWorks library function recognition device, and the device includes:
[0013] A first determination module, configured to determine a specific function for positioning according to the characteristics of the library functions in the sample VxWorks file;
[0014] A second determination module, configured to determine a target function corresponding to the specific function among the library functions of the VxWorks file to be recognized according to the specific function;
[0015] A selection module, configured to select a set of the first library functions with a set number according to the set selection rules based on the specific function in the sample VxWorks file, and select a set of the second library functions with a set number according to the set selection rules based on the target function in the VxWorks file to be recognized;
[0016] A judgment module, configured to judge whether the arrangement order among the library functions in the first library function set is the same as the arrangement order among the library functions in the second library function set;
[0017] A third determination module, configured to, if so, determine each library function included in the sample VxWorks file as each library function included in the VxWorks file to be recognized; if not, identify the characteristics of the library functions in the sample VxWorks file and the characteristics of the library functions in the VxWorks file to be recognized, and determine each library function included in the VxWorks file to be recognized among each library function included in the sample VxWorks file according to the recognition result.
[0018] In a third aspect, an embodiment of the present application further provides an electronic device, which at least includes a processor and a memory. When the processor executes a computer program stored in the memory, the steps of the VxWorks library function recognition method described in any one of the above are implemented.
[0019] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the VxWorks library function recognition method described in any one of the above are implemented.
[0020] In the embodiment of the present application, according to the characteristics of the library functions in the sample VxWorks file, a specific function for positioning is determined; according to the specific function, a target function corresponding to the specific function is determined among the library functions of the VxWorks file to be recognized; in the sample VxWorks file, a set of first library functions with a set number is selected according to the set selection rule based on the specific function, and in the VxWorks file to be recognized, a set of second library functions with a set number is selected according to the set selection rule based on the target function; it is determined whether the arrangement order of the library functions in the first library function set is the same as the arrangement order of the library functions in the second library function set; if so, each library function included in the sample VxWorks file is determined to be each library function included in the VxWorks file to be recognized; if not, the characteristics of the library functions in the sample VxWorks file and the characteristics of the library functions in the VxWorks file to be recognized are identified, and according to the recognition result, each library function included in the sample VxWorks file is determined to be each library function included in the VxWorks file to be recognized. Since in the present application, the specific function for positioning and the corresponding target function are first determined, and the first library function set and the second library function set are respectively determined based on the specific function and the target function, and the first library function set and the second library function set are recognized, there is no need to identify and verify with all the library functions in the sample VxWorks file one by one, which greatly reduces the number of function identifications and improves the efficiency of VxWorks library function recognition. Description of the Drawings
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0022] Figure 1 It is a schematic diagram of a VxWorks library function recognition process provided for some embodiments of the present application;
[0023] Figure 2 Schematic diagram of recognition code corresponding to the getxfrm function feature provided for some embodiments of the present application;
[0024] Figure 3 Schematic diagram of determining a target function in a file to be recognized provided for some embodiments of the present application;
[0025] Figure 4 Schematic diagram of determining the name of a library function to be recognized provided for some embodiments of the present application;
[0026] Figure 5 Schematic diagram of determining the version of a VxWorks file to be recognized provided for some embodiments of the present application;
[0027] Figure 6 Schematic diagram of determining the architecture and compilation parameters of a VxWorks file to be recognized provided for some embodiments of the present application;
[0028] Figure 7 Schematic diagram of determining a sample VxWorks file provided for some embodiments of the present application;
[0029] Figure 8 Schematic diagram of a library function with string processing function and memory processing function among library functions to be recognized provided for some embodiments of the present application;
[0030] Figure 9 Schematic diagram of the verification process of a library function to be recognized provided for some embodiments of the present application;
[0031] Figure 10 One of the structural schematic diagrams of a VxWorks library function recognition device provided for some embodiments of the present application;
[0032] Figure 11 Another structural schematic diagram of a VxWorks library function recognition device provided for some embodiments of the present application;
[0033] Figure 12 Another structural schematic diagram of a terminal device provided for some embodiments of the present application. Detailed implementation manners
[0034] To make the objectives and implementation manners of the present application clearer, the following will clearly and completely describe the exemplary implementation manners of the present application with reference to the accompanying drawings in the exemplary embodiments of the present application. Obviously, the described exemplary embodiments are only a part rather than all of the embodiments of the present application.
[0035] Note that the brief description of terms in this application is only for facilitating the understanding of the following described embodiments, rather than intending to limit the embodiments of this application. Unless otherwise specified, these terms should be understood in their ordinary and common meanings.
[0036] In this application, terms such as "first", "second", "third", etc. in the specification, claims and the above-mentioned drawings are used to distinguish similar or like objects or entities, and do not necessarily mean to limit a specific order or sequence, unless otherwise noted. It should be understood that such terms can be interchanged under appropriate circumstances.
[0037] The terms "comprising" and "having" and any variations thereof are intended to cover but not exclusively include. For example, a product or device comprising a series of components does not necessarily have to be limited to all the components clearly listed, but may include other components not clearly listed or inherent to these products or devices.
[0038] The term "module" refers to any known or later-developed hardware, software, firmware, artificial intelligence, fuzzy logic, or a combination of hardware or / and software code that can perform functions related to that element.
[0039] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of this application, rather than limiting them; although this application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of this application.
[0040] For the sake of convenience of explanation, the above description has been made in conjunction with specific embodiments. However, the above exemplary discussion is not intended to be exhaustive or to limit the embodiments to the specific forms disclosed above. According to the above teachings, various modifications and variations can be obtained. The selection and description of the above embodiments are for better explaining the principles and practical applications, so that those skilled in the art can better use the embodiments and various different variations of the embodiments suitable for specific use considerations.
[0041] The embodiments of the present application provide a method, apparatus, device and medium for identifying VxWorks library functions. In this method, according to the characteristics of the library functions in the sample VxWorks file, a specific function for positioning is determined; according to the specific function, the target function corresponding to the specific function is determined among the library functions of the VxWorks file to be identified; with the specific function as the benchmark in the sample VxWorks file, a set of a specified number of first library functions is selected according to the set selection rules, and with the target function as the benchmark in the VxWorks file to be identified, a set of a specified number of second library functions is selected according to the set selection rules; it is judged whether the arrangement order among the library functions in the first library function set is the same as the arrangement order among the library functions in the second library function set; if so, each library function included in the sample VxWorks file is determined as each library function included in the VxWorks file to be identified; if not, the characteristics of the library functions in the sample VxWorks file and the characteristics of the library functions in the VxWorks file to be identified are identified, and according to the identification results, each library function included in the VxWorks file to be identified is determined among each library function included in the sample VxWorks file. Since in the present application, the specific function for positioning and the corresponding target function are first determined, and the first library function set and the second library function set are respectively determined based on the specific function and the target function, and the first library function set and the second library function set are identified, there is no need to identify and verify one by one with all the library functions in the sample VxWorks file, greatly reducing the number of function identifications and improving the efficiency of VxWorks library function identification.
[0042] Embodiment 1:
[0043] Figure 1 FIG. is a schematic diagram of a VxWorks library function identification process provided for some embodiments of the present application. The process includes:
[0044] S101: According to the characteristics of the library functions in the sample VxWorks file, determine the specific function for positioning.
[0045] Exemplarily, the library functions in the sample VxWorks file can be VxWorks library functions. Specifically, common VxWorks library functions can be classified by function. For example, library functions for network communication: shutdown, getpeername, getsockname, getsockopt, setsockopt, recvmsg, recv, recvfrom, sendmsg, send, sendto, connectWithTimeout, connect, listen, bind, accept, socket; library functions for memory handling: memcmp, memcpy, memmove, memset; library functions for string operations: strcat, strchr, strcmp, getxfrm, strcoll, strcpy, strcspn, strerrorIf, strerror_r, strerror, strlen, strncat, strncmp, strncpy, strpbrk, strrchr, strspn, strstr, strtok, strtok_r.
[0046] According to the characteristics of the library functions to be recognized in the sample VxWorks file, compare the characteristics of each sample library function, and determine the library functions with obvious characteristics, easy to recognize and not prone to false alarms as the specific functions for positioning.
[0047] Illustrated with a specific example, in the embodiments of the present application, the library functions for string processing and memory processing functions in the target VxWorks are recognized. Among the library functions for string processing and memory processing functions, the getxfrm function with the most obvious characteristics and the highest recognition efficiency is determined as the specific function for positioning, where the characteristics of the library function are determined according to the function of the library function to be recognized. Among them, the characteristics of the getxfrm function include that the getxfrm function is only called twice by the same function, and the function calling the getxfrm function is adjacent to the getxfrm function; the getxfrm function has only one function call, and the second parameter of the function called by the getxfrm function is of numerical type 32, as Figure 2 shown, the second parameter of the function called by the getxfrm function in the code on line 14 is of numerical type 32.
[0048] S102: According to the specific function, determine the target function corresponding to the specific function among the library functions of the VxWorks file to be recognized.
[0049] Exemplarily, the library functions in the VxWorks file to be recognized can be VxWorks library functions.
[0050] According to the specific function determined in the sample VxWorks file, in the library functions of the VxWorks file to be recognized, identify the library function that is the same as the specific function, and determine the library function that is the same as the specific function as the target function corresponding to the specific function. Taking a specific example, if the specific function determined in the sample VxWorks file is the getxfrm function, then in the library functions of the VxWorks file to be recognized, the getxfrm function in the VxWorks file to be recognized is determined as the target function corresponding to the specific function.
[0051] Specifically, according to the characteristics of the target function, use a disassembly tool (such as IDA Python, Ghidra, etc.) to write recognition code, open the VxWorks file to be recognized, execute the recognition code, and determine the target function in the VxWorks file to be recognized. For example, when using IDA Python, use IDA to open the VxWorks file to be recognized, execute the IDA Python script, and determine the target function in the VxWorks file to be recognized. As Figure 3 shown, in the VxWorks system file to be recognized, it is recognized that the "sub_80255288" function therein is the getxfrm function.
[0052] S103: Based on the specific function in the sample VxWorks file, select a set of first library functions with a set number according to the set selection rules, and based on the target function in the VxWorks file to be recognized, select a set of second library functions with a set number according to the set selection rules.
[0053] Based on the specific function in the sample VxWorks file, select a set number of library functions according to the set selection rules and determine them as the first library function set. Among them, the set selection rules in the sample VxWorks file can be to select library functions with the same function as the specific function, and the selected library functions can be arranged in descending order of memory; the set number selected in the sample VxWorks file can be the same as the number of library functions to be recognized.
[0054] In the sample VxWorks file, according to the specific function used for positioning and the target function in the corresponding VxWorks file to be recognized, a set number of library functions are selected according to the arrangement of the library functions in the VxWorks file to be recognized and determined as the first set of library functions. Specifically, assuming that the library functions to be recognized in the VxWorks file to be recognized include the target function, the first b library functions of the target function, and the last n - b library functions of the target function, then in the sample VxWorks file, according to the specific function used for positioning and the arrangement of the library functions in the VxWorks file to be recognized, the specific function, the first b library functions of the specific function, and the last n - b library functions of the specific function are determined as the first set of library functions.
[0055] In the VxWorks file to be recognized, based on the target function, a set number of library functions are selected according to the set selection rule and determined as the second set of library functions. Among them, the set selection rule in the VxWorks file to be recognized can be to select library functions with the same function as the target function; the set number selected in the VxWorks file to be recognized can be the same number as the library functions to be recognized.
[0056] Taking the library functions with string processing functions and memory processing functions among the library functions to be recognized as an example, according to the functions of the library functions to be recognized, in the sample VxWorks file, the library functions with string processing functions and memory processing functions are included in the first set of library functions determined based on the specific function, and there are no other library functions in the area corresponding to the library functions with string processing functions and memory processing functions in the sample VxWorks file, that is, only the library functions with string processing functions and memory processing functions exist in this area. In addition, the arrangement order of the library functions with string processing functions and memory processing functions from low memory to high is: memcmp, memcpy, memmove, memset, strcat, strchr, strcmp, getxfrm, strcoll, strcpy, strcspn, strerrorIf, strerror_r, strerror, strlen, strncat, strncmp, strncpy, strpbrk, strrchr, strspn, strstr, strtok, strtok_r, _strxfrm, strxfrm, strlcpy, strdup, strcasecmp, strncasecmp.
[0057] S104: Determine whether the arrangement order among the library functions in the first set of library functions is the same as the arrangement order among the library functions in the second set of library functions. If so, execute S105; if not, execute S106.
[0058] Generally, the library functions included in a VxWorks file are fixed and usually do not change. Also, the VxWorks file arranges the library functions according to the functions they implement. Therefore, there is a certain pattern in the arrangement order of the library functions. Thus, in order to identify each library function included in the VxWorks file to be identified, in this step, it can be identified by judging whether the arrangement order of the library functions in two library function sets (i.e., the first library function set and the second library function set) is the same. Among them, if the arrangement order of the library functions in the two library function sets is the same, it can indicate that the library functions included in the sample VxWorks file and the VxWorks file to be identified are the same and the positions of each library function are the same, that is, the library functions in the sample VxWorks file and the VxWorks file to be identified are arranged according to the same rules, which is conducive to accurately identifying each library function of the VxWorks file to be identified.
[0059] Exemplarily, assuming that the arrangement order of the library functions in the first library function set is the same as that of the corresponding library functions in the second library function set, then by judging whether the library functions in the same positions in the first library function set and the second library function set are the same, it is judged whether the arrangement order of the library functions in the first library function set is the same as that of the library functions in the second library function set, so as to determine whether the assumption holds.
[0060] Specifically, the characteristics of the a-th library function in the first library function set and the a-th library function in the second library function set can be used to verify the a-th library function in the first library function set and the corresponding a-th library function in the second library function set. If the characteristics of the two library functions are the same, it is determined that the a-th library function in the first library function set and the a-th library function in the second library function set are the same, that is, it is determined that the assumption holds, which means that the arrangement order of the library functions in the first library function set is the same as that of the corresponding library functions in the second library function set; otherwise, it is determined that the a-th library function in the first library function set and the a-th library function in the second library function set are different, that is, the assumption does not hold, which means that the arrangement order of the library functions in the first library function set is different from that of the corresponding library functions in the second library function set. Among them, a is a positive integer, and the value range of a is within 0 and the number of library functions in the second library function set.
[0061] S105: Determine each library function included in the sample VxWorks file as each library function included in the VxWorks file to be identified.
[0062] If it is determined that the arrangement order among the library functions in the first set of library functions is the same as the arrangement order among the library functions in the second set of library functions, then each library function included in the first set of library functions is determined to be each library function included in the second set of library functions.
[0063] The sample VxWorks file may contain multiple first sets of library functions, and the VxWorks file to be recognized may contain multiple second sets of library functions. For each first set of library functions and the second set of library functions, if each library function included in each first set of library functions can be determined to be each library function included in the corresponding second set of library functions, then each library function included in the sample file can be determined to be each library function included in the file to be recognized, and it can also be determined that the library functions in the VxWorks file to be recognized have the same function names as the library functions in the sample VxWorks file.
[0064] Exemplarily, determining each library function included in the sample VxWorks file to be each library function included in the VxWorks file to be recognized may be to determine the function name of each library function included in the sample VxWorks file to be the function name of the corresponding library function included in the VxWorks file to be recognized. As Figure 4 shown, Functionname is the function name of each library function included in the VxWorks file to be recognized, including Figure 4 the function names starting with sub in ; the function names of the library functions included in the sample VxWorks file such as memcmp, memcpy, memmove, memset, strcat, strchr, strcmp, getxfrm, strcoll, strcpy, strcspn, strerrorlf, strerror_r. Determining each library function included in the VxWorks file to be recognized to be the function name of the corresponding library function in the sample VxWorks file, as Figure 4 in, determining the function name of sub_80255288 in the VxWorks file to be recognized to be the getxfrm function.
[0065] S106: Identify the characteristics of the library functions in the sample VxWorks file and the characteristics of the library functions in the VxWorks file to be recognized. According to the recognition results, determine each library function included in the VxWorks file to be recognized among each library function included in the sample VxWorks file.
[0066] If it is determined that the arrangement order of the library functions in the first library function set is different from the arrangement order of the library functions in the second library function set, then accurately identify the characteristics of the library functions in the sample VxWorks file and the characteristics of the library functions in the VxWorks file to be recognized. According to the recognition result of whether the characteristics of the library functions in the sample VxWorks file and the characteristics of the library functions in the VxWorks file to be recognized are the same, if the characteristics are the same, then determine that the library functions in the sample VxWorks file with the same characteristics as the library functions in the VxWorks file to be recognized are the same as the corresponding library functions in the VxWorks file to be recognized; it is also possible to determine the function names of the library functions with the same characteristics of the library functions in the sample VxWorks file and the library functions in the VxWorks file to be recognized as the function names of the corresponding library functions in the VxWorks file to be recognized.
[0067] Specifically, accurately identifying the characteristics of the library functions in the sample VxWorks file and the characteristics of the library functions in the VxWorks file to be recognized may include: one or more of algorithm characteristics, instruction characteristics, call relationships, or string characteristics.
[0068] Since in this application, the specific functions for positioning and the corresponding target functions are first determined, and the first library function set and the second library function set are respectively determined based on the specific functions and the target functions, and the first library function set and the second library function set are identified, there is no need to identify and verify each library function in the sample VxWorks file one by one, which greatly reduces the number of function identifications and improves the efficiency of VxWorks library function identification.
[0069] Embodiment 2:
[0070] In order to improve the accuracy of VxWorks library function identification, based on the above embodiment, in the embodiment of the present application, determining whether the arrangement order of the library functions in the first library function set is the same as the arrangement order of the library functions in the second library function set includes:
[0071] For each library function, determine whether the characteristics of the library functions in the first library function set are the same as the characteristics of the corresponding library functions in the second library function set. The characteristics of the library functions include one or more of the following: algorithm characteristics, instruction characteristics, call relationships, or string characteristics.
[0072] For each library function, in the embodiment of the present application, the library functions in the first library function set and the corresponding library functions in the second library function set can be verified whether they are the same through characteristics in multiple dimensions, that is, the library functions can be verified through one or more of algorithm characteristics, instruction characteristics, call relationships, or string characteristics.
[0073] Exemplarily, the algorithm features for determining the library functions in the first set of library functions and the corresponding library functions in the second set of library functions may include: generating first pseudocode for the library functions in the first set of library functions, generating second pseudocode for the corresponding library functions in the second set of library functions, determining the similarity between the first pseudocode and the second pseudocode based on the first pseudocode and the second pseudocode, and when the similarity between the first pseudocode and the second pseudocode is greater than a set threshold, determining that the library functions in the first set of library functions are the same as the corresponding library functions in the second set of library functions.
[0074] In another example, the instruction features for determining the library functions in the first set of library functions and the corresponding library functions in the second set of library functions may include: for each library function, determining the specific first instruction operations existing in the library functions in the first set of library functions, and the specific second instruction operations existing in the corresponding library functions in the second set of library functions, and when the first instruction operations and the second instruction operations are the same, determining that the library functions in the first set of library functions are the same as the corresponding library functions in the second set of library functions.
[0075] In another example, the call relationships for determining the library functions in the first set of library functions and the corresponding library functions in the second set of library functions may include: for each library function, determining the first call relationship of the library functions in the first set of library functions, and the second call relationship of the corresponding library functions in the second set of library functions, and when the first call relationship and the second call relationship are the same, determining that the library functions in the first set of library functions are the same as the corresponding library functions in the second set of library functions. Among them, the first call relationship and the second call relationship include the called relationship and the call relationship. The called relationship indicates the library functions that can call this library function, and the call relationship includes the library functions that this library function can call.
[0076] In another example, the string features for determining the library functions in the first set of library functions and the corresponding library functions in the second set of library functions may include: for each library function, determining the first string feature of the library functions in the first set of library functions, and the second string feature of the corresponding library functions in the second set of library functions, and when the first string feature and the second string feature are the same, determining that the library functions in the first set of library functions are the same as the corresponding library functions in the second set of library functions. Among them, string features exist only in very few library functions.
[0077] For each library function, if the library function in the first library function set is the same as the corresponding library function in the second library function set, it can be determined that all library functions in the first library function set are the same as all corresponding library functions in the second library function set. Since the sample file can contain multiple first library function sets and the file to be recognized can contain multiple second library function sets, for each first library function set and second library function set, if each library function included in each first library function set can be determined to be each library function included in the corresponding second library function set, then each library function included in the sample file can be determined to be each library function included in the file to be recognized.
[0078] By verifying each library function in the first library function set and the corresponding library function in the second library function set through multiple dimensional features, the accuracy of VxWorks library function recognition is improved.
[0079] Embodiment 3:
[0080] In order to further improve the efficiency of VxWorks library function recognition, based on the above embodiments, in the embodiments of the present application, the features of the library functions in the sample VxWorks file and the features of the library functions in the file to be recognized are recognized, and according to the recognition results, each library function included in the file to be recognized is determined among each library function included in the sample VxWorks file, including:
[0081] For each library function, according to the set number of library functions in the second library function set, a set of third library functions with the set number is selected in the sample VxWorks file according to the set selection rule;
[0082] The features of the library functions in the second library function set and the library functions in the third library function set are recognized, and the library functions with the same features as the library functions in the second library function set are determined in the third library function set;
[0083] According to the library functions in the third library function set with the same features as the library functions in the second library function set, each library function included in the file to be recognized is determined among the library functions in the sample VxWorks file.
[0084] If it is determined that there are differences in the features of all library functions in the first library function set and all corresponding library functions in the second library function set, that is, if the arrangement order of the library functions in the first library function set is different from the arrangement order of the library functions in the second library function set, then according to the set number of library functions in the second library function set, that is, according to the number of library functions to be recognized, based on a specific function in the sample VxWorks file, multiple library functions adjacent to the specific function and more than the number of library functions to be recognized are selected and determined as the third library function set.
[0085] For each library function in the second set of library functions, identify the characteristics of the library function with the characteristics of each library function in the third set of library functions, determine the library function in the third set of library functions that has the same characteristics as the library function in the second set of library functions, and determine the library function in the third set of library functions that has the same characteristics as the library function as the corresponding library function of the library function in the third set of library functions.
[0086] Since the sample VxWorks file can contain multiple third sets of library functions and the VxWorks file to be identified can contain multiple second sets of library functions, for each third set of library functions and the second set of library functions, if there is a library function in each third set of library functions that has the same characteristics as each library function contained in the corresponding second set of library functions, then each library function contained in the VxWorks file to be identified can be determined among the library functions in the sample VxWorks file according to the library function in the third set of library functions that has the same characteristics as the library function in the second set of library functions.
[0087] Since in this application, the second set of library functions and the third set of library functions are identified without having to identify and verify each one with all the library functions in the sample VxWorks file, the number of function identifications is greatly reduced, and the efficiency of VxWorks library function identification is further improved.
[0088] Example 4:
[0089] To further improve the efficiency and accuracy of VxWorks library function identification, based on the above embodiments, in the embodiments of this application, before determining the specific function for positioning among the library functions of the sample VxWorks file, the method further includes:
[0090] In the VxWorks file, obtain the version of the VxWorks file to be identified by searching for the string starting with "VxWorks";
[0091] In the header of the VxWorks file, obtain the architecture and compilation parameters of the VxWorks file to be identified;
[0092] Determine the sample VxWorks file corresponding to the VxWorks file to be identified according to the version, architecture, and compilation parameters of the VxWorks file to be identified.
[0093] In the VxWorks binary file, the version of the VxWorks file to be identified can be obtained by searching for the string starting with "VxWorks". For example Figure 5As shown, in the VxWorks binary file, search for the string starting with "VxWorks", and the VxWorks system version of the VxWorks file to be recognized is VxWorks 6.1.
[0094] In the VxWorks binary file, the architecture and compilation parameters of the VxWorks file to be recognized can be obtained by identifying the header of the VxWorks file. For example, identify the header of the VxWorks file through the file command. As Figure 6 shown, by using the file command to identify the header of the VxWorks file, the architecture of the VxWorks file to be recognized is obtained as 32-bit single-word length fixed-point instruction average execution speed (Million Instructions Per Second, MIPS) big-endian, that is Figure 6 the architecture Format in is ELE for MIPS (Executable), and the compilation parameters Options include --opsex, --abi2, -mips64r2, xlr.
[0095] According to the version, architecture, and compilation parameters of the VxWorks file to be recognized, determine the sample VxWorks file corresponding to the VxWorks file to be recognized by taking the file with a version similar to that of the VxWorks file to be recognized. As Figure 7 shown, taking the version of the VxWorks file to be recognized as VxWorks 6.1 as an example, in the VxWorks binary file, the VxWorks 6.8 version file with a version similar to that of the VxWorks file to be recognized is determined as the sample VxWorks file.
[0096] Since the arrangement rules of library functions in VxWorks binary files with more similar versions are more similar, determining the sample VxWorks file with a version similar to that of the VxWorks file to be recognized in the VxWorks file further improves the efficiency and accuracy of VxWorks library function recognition.
[0097] Example 5:
[0098] In order to further improve the accuracy and efficiency of VxWorks library function recognition, based on the above embodiments, in the embodiments of the present application, according to a set number of library functions in the second library function set, select a set number of third library function sets in the sample VxWorks file according to the set selection rules, including:
[0099] According to the set number of library functions in the second set of library functions, in the sample VxWorks file, taking a specific function as a reference, the first n library functions adjacent to the specific function, the last n library functions adjacent to the specific function, and the specific function are determined as the third set of library functions; where the set number is 2n + 1.
[0100] In some possible cases, since, based on a specific function, in the sample VxWorks file, when selecting the set number of library functions in the first set of library functions according to the set rules, there may be library functions with other functions, that is, it cannot be guaranteed that the first set of library functions includes all the library functions to be recognized. Taking the library functions with string processing functions and memory processing functions as the library functions to be recognized as an example, as Figure 8 shown, the library functions with corresponding string processing functions and memory processing functions in the sample VxWorks file are library function c1 to library function c n , where library function c3 is the specific function; the library functions to be recognized with corresponding string processing functions and memory processing functions are library function c1 to library function c n , and the number of library functions to be recognized is n; Figure 8 Among them, library function d m-1 , d m and library functions e1, e2 are library functions with other functions. Since the number of library functions to be recognized is n, the first set of library functions with the set number determined based on the specific function and according to the set rules includes n library functions, but there may be a situation where, for example, the library functions included in the determined first set of library functions are library function d m to library function c n-1 . That is to say, although the number of library functions in the first set of library functions is also n, there are library functions with other functions in the first set of library functions and it does not include the library function c n to be recognized.
[0101] Therefore, for the above possible situations, in the sample VxWorks file, taking the specific function as a reference, the first n library functions adjacent to the specific function, the last n library functions adjacent to the specific function, and the specific function, the above 2n + 1 library functions are determined as the third set of library functions. Among them, n + 1 is the same as the set number of the second set of library functions, that is, the same as the number of library functions to be recognized. Since VxWorks library functions are divided according to functions, and there are no other library functions in the area corresponding to the library functions included in each function, so among the first n library functions and the last n library functions selected according to the specific function, all the library functions to be recognized must be included, that is, all the library functions to be recognized must be included in the third set of library functions, ensuring that all the library functions to be recognized can be recognized.
[0102] On the basis of the above embodiments, Figure 9It is a schematic diagram of the verification process for the library functions to be recognized. This process includes: based on the target function a in the VxWorks file to be recognized x and the specific function b in the sample VxWorks file x , determine that the target function a x is the same as the specific function b x , that is, locate a x =b x ; Assume that the arrangement order of the library functions b1~b in the first library function set corresponding to the sample VxWorks file n is the same as the arrangement order of the library functions a1~a in the second library function set corresponding to the VxWorks file to be recognized n , that is, assume that a1 and b1, a n and b n correspond one by one. For the library function a n in the second library function set and the corresponding library function b n in the first library function set, verify them one by one through the characteristics of the library functions; if the verification passes, determine that the first library function set is the second library function set; if the verification fails, according to the characteristic that VxWorks library functions can be divided by function, determine the first n library functions adjacent to the specific function, the last n library functions and the specific function as the third library function set; according to the characteristics of the library functions, accurately identify the characteristics of the first n library functions adjacent to the specific function, the last n library functions and the library functions in the second library function set, and obtain the corresponding relationship between the library functions in the final third library function set and the library functions in the second library function set. Among them, accurate identification can include verifying the characteristics of multiple dimensions, such as one or more of algorithm characteristics, instruction characteristics, call relationships, or string characteristics.
[0103] Since all the library functions to be recognized are included in the third library function set, it can be ensured that all the library functions to be recognized can be identified in the third library function set, further improving the accuracy of VxWorks library function recognition; in addition, determine the third library function set in the sample VxWorks file, and verify the library functions to be recognized according to the third library function set, without having to identify and verify all the library functions in the sample VxWorks file one by one, greatly reducing the number of function identifications and further improving the efficiency of VxWorks library function recognition.
[0104] Example 6:
[0105] In order to further improve the efficiency of VxWorks library function recognition, based on the above embodiments, in the embodiments of the present application, with the specific function as the benchmark in the sample VxWorks file, select a set number of the first library function sets according to the set selection rules, including:
[0106] Based on a specific function as a reference, the library functions in the sample VxWorks file that have the same function as the library functions in the VxWorks file to be recognized are determined as the library functions in the first library function set; where the number of library functions in the first library function set is the same as the number of library functions corresponding to the function of the library functions in the VxWorks file to be recognized.
[0107] Based on a specific function as a reference in the sample VxWorks file, in the area where the specific function is located, the library functions that have the same function as the library functions to be recognized are determined as the library functions included in the first library function set. Specifically, if the library functions to be recognized are library functions with string processing functions and memory processing functions, the library functions with string processing functions and memory processing functions in the sample VxWorks file are determined as the library functions included in the first library function set.
[0108] According to the number of library functions corresponding to the function of the library functions in the VxWorks file to be recognized, the number of library functions in the VxWorks file to be recognized that have the same function as this function is determined as the number of library functions in the first library function set. Specifically, still taking the library functions with string processing functions and memory processing functions as an example of the library functions to be recognized, if the number of library functions with string processing functions and memory processing functions in the VxWorks file to be recognized is 30, then the number of library functions in the first library function set is determined to be 30.
[0109] Since in this application, the first library function set is determined, and the first library function set and the second library function set are recognized, there is no need to identify and verify each library function in the sample VxWorks file one by one, which greatly reduces the number of function identifications and further improves the efficiency of VxWorks library function identification.
[0110] Embodiment 7:
[0111] Based on the same technical concept, on the basis of the above embodiments, this application provides a VxWorks library function identification device. Figure 10 As a schematic structural diagram of a VxWorks library function identification device provided by some embodiments of this application, as Figure 10 shown, the device includes:
[0112] A first determination module 1001, configured to determine a specific function for positioning according to the characteristics of the library functions in the sample VxWorks file;
[0113] A second determination module 1002, configured to determine a target function corresponding to the specific function among the library functions of the VxWorks file to be recognized according to the specific function.
[0114] A selection module 1003 is configured to select a set of a preset number of first library functions in a sample VxWorks file based on a specific function according to a set selection rule, and select a set of a preset number of second library functions in a VxWorks file to be recognized based on a target function according to the set selection rule;
[0115] A judgment module 1004 is configured to judge whether the arrangement order among the library functions in the first library function set is the same as the arrangement order among the library functions in the second library function set;
[0116] A third determination module 1005 is configured to, if so, determine each library function included in the sample VxWorks file as each library function included in the VxWorks file to be recognized; if not, identify the features of the library functions in the sample VxWorks file and the features of the library functions in the VxWorks file to be recognized, and determine each library function included in the VxWorks file to be recognized from each library function included in the sample VxWorks file according to the identification result.
[0117] In a possible implementation manner, the judgment module 1004 is specifically configured to, for each library function, judge whether the features of the library functions in the first library function set are the same as the features of the corresponding library functions in the second library function set, where the features of the library functions include one or more of the following: algorithm features, instruction features, call relationships, or string features.
[0118] In a possible implementation manner, the judgment module 1004 is further configured to, for each library function, select a set of a preset number of third library functions in the sample VxWorks file according to the set selection rule based on the preset number of library functions in the second library function set; identify the features of the library functions in the second library function set and the features of the library functions in the third library function set, and determine the library functions in the third library function set whose features are the same as those of the library functions in the second library function set; and determine each library function included in the file to be recognized from the library functions in the sample VxWorks file according to the library functions in the third library function set whose features are the same as those of the library functions in the second library function set.
[0119] In a possible implementation manner, the judgment module 1004 is specifically configured to, according to the preset number of library functions in the second library function set, determine, in the sample VxWorks file based on a specific function, the first n library functions adjacent to the specific function, the last n library functions adjacent to the specific function, and the specific function as the third library function set; where the preset number is 2n + 1.
[0120] In a possible implementation, the selection module 1003 is specifically configured to determine, based on a specific function, the library functions in the sample VxWorks file that have the same function as the library functions in the VxWorks file to be recognized as the library functions in the first library function set; where the number of library functions in the first library function set is the same as the number of library functions corresponding to the function of the library functions in the VxWorks file to be recognized.
[0121] Based on Figure 10 , referring to Figure 11 , the above device may further include a preprocessing module 1006, configured to obtain the version of the VxWorks file to be recognized by searching for a string starting with VxWorks in the VxWorks file; obtain the architecture and compilation parameters of the VxWorks file to be recognized in the header of the VxWorks file; and determine the sample VxWorks file corresponding to the VxWorks file to be recognized according to the version, architecture, and compilation parameters of the VxWorks file to be recognized.
[0122] Embodiment 8:
[0123] Based on the same technical concept, the present application further provides an electronic device, Figure 12 which is a schematic structural diagram of an electronic device provided by an embodiment of the present application, as Figure 12 shown, including: a processor 1201, a communication interface 1202, a memory 1203, and a communication bus 1204, where the processor 1201, the communication interface 1202, and the memory 1203 communicate with each other through the communication bus 1204;
[0124] A computer program is stored in the memory 1203, and when the program is executed by the processor 1201, the processor 1201 is caused to execute the following steps:
[0125] Determine a specific function for positioning according to the characteristics of the library functions in the sample VxWorks file;
[0126] Determine the target function corresponding to the specific function among the library functions of the VxWorks file to be recognized according to the specific function;
[0127] Select a set of a set number of first library functions based on the specific function in the sample VxWorks file according to a set selection rule, and select a set of a set number of second library functions based on the target function in the VxWorks file to be recognized according to the set selection rule;
[0128] Determine whether the arrangement order of the library functions in the first library function set is the same as the arrangement order of the library functions in the second library function set;
[0129] If so, each library function included in the sample VxWorks file is determined as each library function included in the VxWorks file to be recognized; if not, the features of the library functions in the sample VxWorks file and the features of the library functions in the VxWorks file to be recognized are identified, and according to the recognition result, each library function included in the VxWorks file to be recognized is determined from each library function included in the sample VxWorks file.
[0130] In a possible implementation manner, the processor 1201 is specifically configured to, for each library function, determine whether the features of the library function in the first library function set are the same as the features of the corresponding library function in the second library function set. The features of the library function include one or more of the following: algorithm features, instruction features, call relationships, or string features.
[0131] In a possible implementation manner, the processor 1201 is further configured to, for each library function, select a set of third library functions with a set number in the sample VxWorks file according to a set selection rule based on the set number of library functions in the second library function set; identify the features of the library functions in the second library function set and the features of the library functions in the third library function set, and determine the library functions in the third library function set whose features are the same as those of the library functions in the second library function set; and determine each library function included in the file to be recognized from the library functions in the sample VxWorks file according to the library functions in the third library function set whose features are the same as those of the library functions in the second library function set.
[0132] In a possible implementation manner, the processor 1201 is further configured to, in the VxWorks file, obtain the version of the VxWorks file to be recognized by searching for a string starting with VxWorks; obtain the architecture and compilation parameters of the VxWorks file to be recognized in the header of the VxWorks file; and determine the sample VxWorks file corresponding to the VxWorks file to be recognized according to the version, architecture, and compilation parameters of the VxWorks file to be recognized.
[0133] In a possible implementation manner, the processor 1201 is specifically configured to, according to the set number of library functions in the second library function set, take a specific function as a reference in the sample VxWorks file, and determine the first n library functions adjacent to the specific function, the last n library functions adjacent to the specific function, and the specific function as the third library function set; where the set number is 2n + 1.
[0134] In a possible implementation, the processor 1201 is specifically configured to, based on a specific function, determine the library functions in the sample VxWorks file that have the same function as the library functions in the VxWorks file to be recognized as the library functions in the first library function set; where the number of library functions in the first library function set is the same as the number of library functions corresponding to the functions of the library functions in the VxWorks file to be recognized.
[0135] The communication bus mentioned in the above electronic device may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of easy representation, only a thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0136] The communication interface 1202 is used for communication between the above electronic device and other devices.
[0137] The memory may include a RAM (Random Access Memory), or may also include an NVM (Non-Volatile Memory), such as at least one disk memory. Optionally, the memory may also be at least one storage device located far from the aforementioned processor.
[0138] The above processor may be a general-purpose processor, including a central processing unit, an NP (Network Processor), etc.; it may also be a DSP (Digital Signal Processing), an application-specific integrated circuit, a field programmable gate array, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0139] Embodiment 9:
[0140] Based on the same technical concept, an embodiment of the present application provides a computer-readable storage medium, in which a computer program executable by an electronic device is stored. When the program runs on the electronic device, the electronic device is caused to perform the following steps when executed:
[0141] Determine a specific function for positioning according to the characteristics of the library functions in the sample VxWorks file;
[0142] According to the specific function, determine the target function corresponding to the specific function among the library functions of the VxWorks file to be recognized;
[0143] In the sample VxWorks file, based on a specific function, select a set number of the first library function sets according to the set selection rules, and in the VxWorks file to be recognized, based on the target function, select a set number of the second library function sets according to the set selection rules;
[0144] Judge whether the arrangement order among the library functions in the first library function set is the same as the arrangement order among the library functions in the second library function set;
[0145] If so, determine each library function included in the sample VxWorks file as each library function included in the VxWorks file to be recognized; if not, identify the characteristics of the library functions in the sample VxWorks file and the characteristics of the library functions in the VxWorks file to be recognized, and according to the recognition results, determine each library function included in the VxWorks file to be recognized among each library function included in the sample VxWorks file.
[0146] In a possible implementation manner, judging whether the arrangement order among the library functions in the first library function set is the same as the arrangement order among the library functions in the second library function set includes:
[0147] For each library function, judge whether the characteristics of the library function in the first library function set are the same as the characteristics of the corresponding library function in the second library function set. The characteristics of the library function include one or more of the following: algorithm characteristics, instruction characteristics, call relationship, or string characteristics.
[0148] In a possible implementation manner, identifying the characteristics of the library functions in the sample VxWorks file and the characteristics of the library functions in the VxWorks file to be recognized, and according to the recognition results, determining each library function included in the VxWorks file to be recognized among each library function included in the sample VxWorks file includes:
[0149] For each library function, according to the set number of library functions in the second library function set, select a set number of the third library function sets in the sample VxWorks file according to the set selection rules;
[0150] Identify the characteristics of the library functions in the second library function set and the library functions in the third library function set, and determine the library functions in the third library function set with the same characteristics as the library functions in the second library function set;
[0151] According to the library functions in the third library function set with the same characteristics as the library functions in the second library function set, determine each library function included in the file to be recognized among the library functions in the sample VxWorks file.
[0152] In a possible implementation, before determining a specific function for positioning in the library functions of a sample VxWorks file, it includes:
[0153] In the VxWorks file, obtain the version of the VxWorks file to be recognized by searching for the string starting with VxWorks.
[0154] In the header of the VxWorks file, obtain the architecture and compilation parameters of the VxWorks file to be recognized.
[0155] According to the version, architecture, and compilation parameters of the VxWorks file to be recognized, determine the sample VxWorks file corresponding to the VxWorks file to be recognized.
[0156] In a possible implementation, according to a set number of library functions in the second set of library functions, select a set number of third library function sets in the sample VxWorks file according to the set selection rule, including:
[0157] According to a set number of library functions in the second set of library functions, in the sample VxWorks file, taking a specific function as a reference, determine the previous n library functions, the next n library functions adjacent to the specific function, and the specific function as the third library function set; where the set number is 2n + 1.
[0158] In a possible implementation, in the sample VxWorks file, taking a specific function as a reference, select a set number of first library function sets according to the set selection rule, including:
[0159] Taking a specific function as a reference, determine the library functions in the sample VxWorks file that have the same function as the library functions in the VxWorks file to be recognized as the library functions in the first library function set; where the number of library functions in the first library function set is the same as the number of library functions corresponding to the function of the library functions in the VxWorks file to be recognized.
[0160] The above computer-readable storage medium can be any available medium or data storage device accessible by the processor in an electronic device, including but not limited to magnetic memories such as floppy disks, hard disks, magnetic tapes, MO (magneto-optical disks), etc., optical memories such as CDs, DVDs, BDs, HVDs, etc., and semiconductor memories such as ROM, EPROM, EEPROM, NAND FLASH (non-volatile memory), SSD (solid-state drive), etc.
[0161] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0162] The present application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in Figure 1 one or more of the flows Figure 1 or blocks or combinations of blocks.
[0163] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means that implement the functions specified in Figure 1 one or more of the flows Figure 1 or blocks or combinations of blocks.
[0164] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in Figure 1 one or more of the flows Figure 1 or blocks or combinations of blocks.
[0165] Obviously, those skilled in the art can make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.
Claims
1. A method for identifying VxWorks library functions, characterized in that, The method includes: Determine a specific function for positioning according to the characteristics of library functions in the sample VxWorks file; Determine a target function corresponding to the specific function in the library functions of the VxWorks file to be recognized according to the specific function; Select a set of first library functions with a set number according to the set selection rule based on the specific function in the sample VxWorks file, and select a set of second library functions with the set number according to the set selection rule based on the target function in the VxWorks file to be recognized; Judge whether the arrangement order among the library functions in the first library function set is the same as the arrangement order among the library functions in the second library function set; If so, determine each library function included in the sample VxWorks file as each library function included in the VxWorks file to be recognized; if not, identify the characteristics of the library functions in the sample VxWorks file and the characteristics of the library functions in the VxWorks file to be recognized, and determine each library function included in the VxWorks file to be recognized in each library function included in the sample VxWorks file according to the recognition result.
2. The method according to claim 1, wherein The judging whether the arrangement order among the library functions in the first library function set is the same as the arrangement order among the library functions in the second library function set includes: For each library function, judge whether the characteristics of the library function in the first library function set are the same as the characteristics of the corresponding library function in the second library function set, and the characteristics of the library function include one or more of the following: algorithm characteristics, instruction characteristics, call relationship, or string characteristics.
3. The method according to claim 1, characterized in that, The identifying the characteristics of the library functions in the sample VxWorks file and the characteristics of the library functions in the VxWorks file to be recognized, and determining each library function included in the VxWorks file to be recognized in each library function included in the sample VxWorks file according to the recognition result includes: For each library function, select a set of third library functions with a set number according to the set selection rule in the sample VxWorks file according to the set number of library functions in the second library function set; Identify the characteristics of the library functions in the second library function set and the characteristics of the library functions in the third library function set, and determine the library functions with the same characteristics as the library functions in the second library function set in the third library function set; Determine each library function included in the VxWorks file to be recognized in the library functions in the sample VxWorks file according to the library functions in the third library function set with the same characteristics as the library functions in the second library function set.
4. The method according to claim 1, wherein Before determining a specific function for positioning in the library functions of the sample VxWorks file, the method further includes: In the VxWorks file, obtain the version of the VxWorks file to be recognized by searching for a string starting with VxWorks; In the header of the VxWorks file, obtain the architecture and compilation parameters of the VxWorks file to be recognized. According to the version, architecture, and compilation parameters of the VxWorks file to be recognized, determine the sample VxWorks file corresponding to the VxWorks file to be recognized.
5. The method according to claim 3, characterized in that, The step of selecting a set of third library functions with a set number in the sample VxWorks file according to the set number of library functions in the second library function set includes: According to the set number of library functions in the second library function set, in the sample VxWorks file, taking the specific function as a reference, determine the previous n library functions and the next n library functions adjacent to the specific function and the specific function as the set of third library functions; where the set number is 2n + 1.
6. The method according to claim 1, characterized in that, The step of selecting a set of first library functions with a set number in the sample VxWorks file according to the set selection rule with the specific function as a reference includes: Taking the specific function as a reference, determine the library functions in the sample VxWorks file that have the same function as the library functions in the VxWorks file to be recognized as the library functions in the set of first library functions; where the number of library functions in the set of first library functions is the same as the number of library functions corresponding to the functions of the library functions in the VxWorks file to be recognized.
7. A VxWorks library function recognition device, characterized in that, The device includes: A first determination module for determining a specific function for positioning according to the characteristics of the library functions in the sample VxWorks file. A second determination module for determining the target function corresponding to the specific function in the library functions of the VxWorks file to be recognized according to the specific function. A selection module for selecting a set of first library functions with a set number in the sample VxWorks file with the specific function as a reference according to the set selection rule, and selecting the set of second library functions with the set number in the VxWorks file to be recognized with the target function as a reference according to the set selection rule. A judgment module for judging whether the arrangement order of the library functions in the set of first library functions is the same as the arrangement order of the library functions in the set of second library functions. A third determination module for, if so, determining each library function included in the sample VxWorks file as each library function included in the VxWorks file to be recognized; if not, identifying the characteristics of the library functions in the sample VxWorks file and the characteristics of the library functions in the VxWorks file to be recognized, and determining each library function included in the VxWorks file to be recognized from each library function included in the sample VxWorks file according to the identification result.
8. The device according to claim 7, characterized in that, The judgment module is specifically configured to, for each library function, judge whether the characteristics of the library function in the set of first library functions are the same as the characteristics of the corresponding library function in the set of second library functions, and the characteristics of the library function include one or more of the following: algorithm characteristics, instruction characteristics, call relationship, or string characteristics.
9. An electronic device, characterized in that, The electronic device at least includes a processor and a memory. When the processor executes a computer program stored in the memory, the steps of a VxWorks library function recognition method according to any one of claims 1-6 are implemented.
10. A computer storage medium, characterized in that, It stores a computer program executable by the electronic device. When the program runs on the electronic device, the electronic device is caused to execute the steps of a VxWorks library function recognition method according to any one of claims 1-6.
Citation Information
Patent Citations
VxWorks system network sensing method
CN112165446A
Method to identify known compilers functions, libraries and objects inside files and data items containing an executable code
US20170372068A1