A method and system for generating binary code summaries based on knowledge transfer
By leveraging knowledge transfer and semantic information from source code, a binary code-source code association library is established. A pre-trained source code summarization generation model encoder is used to generate high-quality binary code summaries, solving the problem of binary code summarization and achieving fast and accurate matching and summarization generation between binary code and source code.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NO 30 INST OF CHINA ELECTRONIC TECH GRP CORP
- Filing Date
- 2023-02-15
- Publication Date
- 2026-07-17
Smart Images

Figure CN116069386B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of binary code security, and in particular to a method and system for rapidly and accurately generating code summaries from binary code through binary-source code matching and knowledge transfer. Background Technology
[0002] Code summarization is a natural language description of code, helping developers and maintainers quickly read and understand existing code. Currently, the mainstream model structure for code summarization generation is encoder-decoder based attention. An encoder encodes extracted code features into state vectors, an attention mechanism aggregates several state vectors from the encoder into a single state vector, and a decoder decodes the aggregated state vector into individual words, ultimately producing a summary describing the function of the input code. Binary code summarization provides a high-level natural language description of the functions executed by binary code, which is beneficial for software maintenance, binary classification, and retrieval. However, binary code is difficult to read, and the same source code can produce significantly different binary results under different compilation environments, making binary code classification and summarization challenging. Current research in code summarization mainly focuses on generating summaries from source code, with relatively little research on generating summaries from binary code.
[0003] Binary code is typically compiled from program source code. Binary code (usually referring to the disassembled code of a binary program) and source code have a natural correlation, and binary code-source code matching is one of the key research directions in the field of information security. However, the source code and binary code differ significantly in form: source code is written in high-level languages, has a flexible and diverse format, contains richer program information, and usually has excellent cross-platform compatibility; binary code loses some information compared to its corresponding source code and incorporates features such as compiler optimizations and instruction set architecture.
[0004] Most existing code summarization methods are designed for source code. While these methods offer some general applicability to both source and binary code, significant differences exist between the two. Binary code exhibits reduced natural language characteristics compared to source code, and compilation results in the loss of some source code information and the addition of compiler optimizations and instruction set architecture features. Regarding training data acquisition, source code is inherently more readable and often contains comments, allowing for efficient training data acquisition. However, large-scale training data is often difficult to obtain for binary code summarization. Furthermore, the substantial structural and representational differences between binary and source code make source code summarization methods less suitable for binary code summarization. Summary of the Invention
[0005] To address the problems existing in the prior art, a binary code digest generation method and system based on knowledge transfer is provided. Through knowledge transfer, the semantic information of the source code can be used to help the model understand binary code, enhance the model's ability to extract functional semantic information of binary code, and improve the quality of binary code digest generation.
[0006] The technical solution adopted in this invention is as follows: A binary code digest generation method based on knowledge transfer, comprising:
[0007] Step 1: Parse the input binary file to obtain binary code characteristics;
[0008] Step 2: Perform similarity detection on binary code based on binary code features. Obtain the source code corresponding to similar binary code in the binary code-source code association library, and then obtain the source code features.
[0009] Step 3: Encode the binary code and source code features to obtain the corresponding feature vectors;
[0010] Step 4: Input the feature vectors of the binary code and the source code into the pre-trained binary code summarization generation model to generate binary code summary text;
[0011] The binary code digest generation model includes an encoder and a decoder. The encoder includes a source code feature encoding module and a binary code feature encoding module. The source code feature encoding module is derived from the encoder of the source code digest generation model.
[0012] Furthermore, in step 2, a binary similarity detection model is used for detection, wherein the training method for the binary similarity detection model is as follows:
[0013] Step 2.1.1: Use two identical fully connected neural networks to form a twin architecture detection model. The two neural networks use the same hyperparameters and share parameters.
[0014] Step 2.1.2: Using supervised binary analysis tools, extract the middle representation esil character from the two binary code function control flow graphs (CFGs) for use as input to the detection model; the detection model performs word segmentation and word embedding on the esil character to obtain the vector representation of the word, which is then input into the neural network.
[0015] Step 2.1.3: Output two semantic feature vectors, calculate the cosine similarity between the two semantic feature vectors to determine whether the two binary codes are similar, update the neural network parameters through backpropagation and stochastic gradient descent, and complete the training of the detection model.
[0016] Furthermore, in step 2, the method for establishing the binary code-source code association library is as follows:
[0017] Step 2.2.1: Obtain the source code of a large-scale open-source project, compile the source code in debug mode, and obtain the corresponding binary files;
[0018] Step 2.2.2: Parse the binary file to obtain binary function-level information;
[0019] Step 2.2.3: Construct a dataset of <function source code, binary code> based on binary function information, thereby building a function-level binary-source code association library.
[0020] Furthermore, in step 4, the method for obtaining the binary code digest generation model is as follows:
[0021] Step 4.1: Extract the functional description text from the function source code, use it as the function source code summary, and construct a training dataset consisting of <function source code, binary code, summary>.
[0022] Step 4.2: Based on the encoder-decoder based attention model, establish a source code digest generation model and a binary code digest model respectively. The encoder and decoder structures of the two models are the same.
[0023] Step 4.3: Extract the dataset consisting of <function source code, summary> from the training dataset to complete the training of the source code summary generation model;
[0024] Step 4.4: Transfer the encoder structure and parameters from the trained source code summarization model to the binary code summarization model, superimpose them with the original encoder structure to form a new encoder, extract the dataset consisting of <binary code, summary> from the training dataset, and complete the training of the binary code summarization model.
[0025] Furthermore, in the encoder of the binary code digest model, the source code feature encoding module performs semantic encoding on the feature vector of the input source code to obtain the source code semantic vector; the binary code feature encoding module performs semantic encoding on the feature vector of the input binary code to obtain the binary code semantic vector.
[0026] Furthermore, in the binary code digest model, an attention mechanism is used to perform a weighted summation of the source code semantic vector and the binary code semantic vector obtained at time step t to obtain the fused semantic vector of the two encoding modules, which is the input semantic vector of the decoder at the corresponding time step position.
[0027] Furthermore, in the binary code digest model, the decoder decodes the fused semantic vector of the input and uses a cluster search method to generate binary code digest text.
[0028] This invention also proposes a binary code digest generation system based on knowledge transfer, comprising:
[0029] The binary code parsing module is used to parse the input binary code file to obtain binary code features, and encode the binary code features into binary code feature vectors.
[0030] The binary code similarity detection module is used to obtain binary code features from the binary code parsing module, perform similarity detection, and obtain similar binary code.
[0031] The binary-source code matching module retrieves the source code corresponding to similar binary codes from the established binary-source code association library.
[0032] The source code parsing module parses the source code to obtain source code features and encodes these features into source code feature vectors.
[0033] The encoder includes a source code encoding module and a binary code encoding module, which are used to perform semantic encoding on the source code feature vector and the binary code feature vector, respectively, to obtain the source code semantic vector and the binary code semantic vector.
[0034] The decoder is used to fuse source code semantic vectors and binary code semantic vectors, and to decode and search to generate binary code summary text.
[0035] Furthermore, the source code encoding and binary encoding modules have the same structure, only the parameter network parameters are different, including parallel multi-path sequentially connected embedding layer, encoding layer and weighted summation layer.
[0036] Furthermore, the binary-source code association library is constructed from the <function source code, binary code> dataset. The <function source code, binary code> dataset is obtained by compiling the source code of a large-scale open-source project to obtain the corresponding binary file, parsing the binary file to obtain binary function-level information, and thus establishing the <function source code, binary code> dataset.
[0037] Compared with the prior art, the beneficial effects of adopting the above technical solution are as follows: the present invention utilizes the concept of knowledge transfer, which can be well compatible with existing source code digest generation methods and generate binary code digests quickly and accurately. Attached Figure Description
[0038] Figure 1 This is a schematic diagram illustrating the binary code digest generation proposed in this invention.
[0039] Figure 2 This is a schematic diagram of binary code similarity detection in one embodiment of the present invention.
[0040] Figure 3 This is a schematic diagram of the construction of a binary-source code association library in one embodiment of the present invention.
[0041] Figure 4 This is a schematic diagram illustrating the generation of source code digests in one embodiment of the present invention.
[0042] Figure 5 This is a schematic diagram of another binary code digest generation method proposed in this invention. Detailed Implementation
[0043] The embodiments of this application are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar modules or modules having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application. Rather, the embodiments of this application include all variations, modifications, and equivalents falling within the spirit and scope of the appended claims.
[0044] Binary code is compiled from source code, and there is a natural correlation between binary code and source code. Theoretically, the source code digest corresponding to binary code is the same as the binary code digest. By converting binary code into source code, existing source code digest generation methods can be fully utilized to generate digests. However, obtaining accurate source code corresponding to binary code suitable for source code digest generation models is very difficult. Therefore, this embodiment proposes a knowledge transfer-based binary code digest generation method, which achieves binary code digest generation through knowledge transfer based on source code digest generation.
[0045] Knowledge transfer applies knowledge gained from solving one problem to solving another related or similar problem, aiming to achieve better results in the new task. It is generally applied in scenarios where the source domain has a large amount of data while the target domain has relatively scarce data, allowing knowledge learned from an information-rich source domain to be transferred to a data-scarce target domain. Based on the characteristics of knowledge transfer and the correlation between source code and binary code, knowledge transfer can be effectively utilized in binary code summarization tasks. The semantic information of the source code can assist the model in understanding the binary code, enhance the model's ability to extract functional semantic information from the binary code, and improve the quality of binary code summarization. The specific solution is as follows:
[0046] like Figure 1 As shown, a binary code digest generation method based on knowledge transfer includes:
[0047] Step 1: Parse the input binary file to obtain binary code characteristics;
[0048] Step 2: Perform similarity detection on binary code based on binary code features. Obtain the source code corresponding to similar binary code in the binary code-source code association library, and then obtain the source code features.
[0049] Step 3: Encode the binary code and source code features to obtain the corresponding feature vectors;
[0050] Step 4: Input the feature vectors of the binary code and the source code into the pre-trained binary code summarization generation model to generate binary code summary text;
[0051] The binary code digest generation model includes an encoder and a decoder. The encoder includes a source code feature encoding module and a binary code feature encoding module. The source code feature encoding module is derived from the encoder of the source code digest generation model.
[0052] In this embodiment, for the source code, function slicing is performed, that is, function code is extracted, and source code features are extracted at the function granularity, mainly including text (character) features, abstract syntax tree (AST), immediate value features, etc.; for binary code, the binary file is parsed using the Radare2 binary reverse analysis tool to obtain binary features, mainly including the source code corresponding to the binary function, the assembly code of the binary function, the control flow chart of the binary function, etc.
[0053] Step 2 involves similarity detection and binary code-source code association libraries, specifically:
[0054] Binary code similarity refers to the similarity of different binary codes obtained by compiling the same or similar source code. The same source code, when compiled in different compilation environments, with different compilation parameters and different instruction architectures, will produce different binary codes for different hardware platforms.
[0055] In this embodiment, similarity detection is implemented through a similarity detection model. A data format of <source code, binary code 1, binary code 2, ..., binary code n> is constructed, where each binary code is pairwise similar, and this data is used to train instances for the binary similarity detection model.
[0056] like Figure 2 As shown, the similarity detection model uses two identical fully connected neural networks to form a Siamese architecture. Both neural networks use the same hyperparameters and share parameters. The neural networks are trained using a supervised method, with training samples consisting of sample pairs labeled with similarity.<f1,f2,±1> The cosine similarity is used to determine whether two binary codes are similar.
[0057] The training process of the model is as follows:
[0058] 1) Use a binary analysis tool to extract the intermediate representation esil character of the binary code function control flow graph (CFG) for model input; in this embodiment, the binary analysis tool can be Radare2.
[0059] 2) Segment and embed the esil characters of the function control flow graph to obtain the vector representation of the words, input them into the neural network, and complete the model training;
[0060] 3) Output two semantic feature vectors, calculate the cosine similarity between the two semantic feature vectors, determine whether the two binary codes are similar, and update the neural network parameters through backpropagation and stochastic gradient descent.
[0061] The construction of a binary code-source code association library mainly includes two parts: source code compilation and binary parsing, such as... Figure 3 As shown, specifically:
[0062] 1) Compiling the source code in debug mode will result in a binary file containing source code information;
[0063] 2) Use the binary analysis tool Radare2 to parse the binary data and obtain binary function-level information, including function source code, function assembly code, control flow diagram, etc.
[0064] By compiling and parsing open-source projects on a large scale, a massive dataset consisting of <function source code and binary code> can be obtained, allowing the construction of a function-level binary code-source code association library. Here, the binary code refers to the function assembly code within the binary function-level information.
[0065] Meanwhile, the functional description text of the function source code is extracted using regular expression matching and used as a function source code digest to construct a training dataset of <function source code, binary code, digest>, which is used to train subsequent source code digest generation models and binary code digest generation models based on the Encoder / decoder (Seq2Seq) pattern.
[0066] Based on the similarity detection model and binary code-source code association library proposed above, the specific process of obtaining the source code corresponding to the binary code is as follows:
[0067] 1) Constructing a binary function ES index library: For binary code obtained from large-scale compilation and parsing, the feature vector of the binary code is calculated using a similarity detection model, and then stored in the ES database to construct a binary code ES index library.
[0068] 2) Retrieval: For the input binary code, the feature vector is calculated using a similarity detection model, and similar binary codes are retrieved from the binary code ES index based on cosine similarity.
[0069] 3) Binary-Source Code Matching: Match source code in the binary-source code association library based on similar binary code.
[0070] In this embodiment, training data of <binary code, digest> is extracted from the <function source code, binary code, digest> training dataset for training purposes. Figure 1 The model incorporates a knowledge transfer-based binary code summarization generation model to generate binary code summaries. Simultaneously, an attention mechanism is introduced, fusing intermediate vectors generated by the source code encoder and binary code encoder with different weights based on a hybrid attention mechanism. The weighted summed fused vector is then used as the input semantic vector for the decoder at time t, which is used by the decoder to generate the binary code summary. The specific method is as follows:
[0071] Step 4.1: Extract the functional description text from the function source code, use it as the function source code summary, and construct a training dataset consisting of <function source code, binary code, summary>.
[0072] Step 4.2: Based on the encoder-decoder based attention model, establish a source code digest generation model and a binary code digest model respectively. The encoder and decoder structures of the two models are the same.
[0073] Step 4.3: Extract the dataset consisting of <function source code, summary> from the training dataset to complete the training of the source code summary generation model;
[0074] Step 4.4: Transfer the encoder structure and parameters from the trained source code summarization model to the binary code summarization model, superimpose them with the original encoder structure to form a new encoder, extract the dataset consisting of <binary code, summary> from the training dataset, and complete the training of the binary code summarization model.
[0075] In the encoder of the binary code digest model in this embodiment, the source code feature encoding module performs semantic encoding on the feature vector of the input source code to obtain the source code semantic vector; the binary code feature encoding module performs semantic encoding on the feature vector of the input binary code to obtain the binary code semantic vector.
[0076] It should be noted that, Figure 1 The encoding module only reflects text sequence features. In practical applications, text sequence features can be extracted from control flow graphs (CFG), abstract syntax trees (AST), etc., before being input into the model.
[0077] In the binary code digest model of this embodiment, the attention mechanism is used to perform a weighted summation of the source code semantic vector and the binary code semantic vector obtained at time step t to obtain the fused semantic vector of the two encoding modules, that is, the input semantic vector of the decoder at the corresponding time step position.
[0078] In the binary code digest model of this embodiment, the decoder decodes the input fused semantic vector and uses a cluster search method to generate binary code digest text.
[0079] For the source code digest generation model in step 4.4, the <function source code, digest> dataset is extracted from the <function source code, binary code, digest> training dataset for model training. The trained model is as follows: Figure 4 As shown, its working process is as follows:
[0080] 1) Extract features from the function source code (such as text (character) features, abstract syntax tree (AST), immediate value features, or graph features), encode various features of the function source code, and obtain various feature vector representations;
[0081] 2) Input the feature vector representation into the encoder model for encoding. Networks such as RNN, LSTM, GRU, CNN, and GNN can be used.
[0082] 3) For all hidden states of the encoder, calculate the correlation of the current hidden state of the decoder, and use it as attention weights to perform a weighted summation of the hidden states of the encoder to obtain the semantic vector C of each feature. i ;
[0083] 4) Utilize the attention mechanism to process the various feature semantic vectors C obtained at time step t. i By performing weighted summation, we obtain the fused semantic vector C of various feature encoders in the source code. know That is, the input semantic vector of the decoder at the corresponding time step position;
[0084] 5) The decoder processes the input semantic vector C. know Decode the code and simultaneously generate a code digest text using a cluster search method.
[0085] It should be noted that the source code digest generation model is not the focus of this embodiment. Existing source code digest generation models can also be used. The method proposed in this embodiment is mainly to obtain the encoding part of the source code digest generation model and transfer it to the encoder of the binary code digest generation model. This enables knowledge transfer from the background knowledge related to the source code to the binary code digest generation task. The semantic information of the source code can help the model understand the binary code, enhance the model's ability to extract the functional semantic information of the binary code, and improve the quality of binary code digest generation.
[0086] Therefore, the method proposed in this embodiment can be implemented using another method, such as... Figure 5 As shown, this method includes a source code digest model (source code encoding module and source code digest decoding module) and a binary code digest generation model (binary code encoding module and binary code digest decoding module). The source code digest model is trained using large-scale source code files, and the binary code digest model is trained using binary files.
[0087] When inputting a binary file, the binary code is parsed and then input into the encoding module of the binary code digest model. Simultaneously, similarity detection is performed, and the corresponding source code is matched in the binary code-source code association library and input into the source code encoding module. The outputs of the source code encoding module and the binary code encoding module are input together into the binary code digest decoding module for fusion, decoding, and searching, thus generating the binary code digest.
[0088] In this approach, similarity detection and binary code-source code association library matching are the same as those described above. The source code digest generation model learns background knowledge related to the functions of the source code, and the knowledge is transferred and output to the decoding module of the binary code digest generation model, which can also achieve fast and accurate generation of binary code digests.
[0089] Example 2
[0090] This embodiment also proposes a binary code digest generation system based on knowledge transfer, according to Embodiment 1, including:
[0091] The binary code parsing module is used to parse the input binary code file to obtain binary code features, and encode the binary code features into binary code feature vectors.
[0092] The binary code similarity detection module is used to obtain binary code from the binary code parsing module, perform similarity detection, and obtain similar binary code.
[0093] The binary-source code matching module retrieves the source code corresponding to similar binary codes from the established binary-source code association library.
[0094] The source code parsing module parses the source code to obtain source code features and encodes these features into source code feature vectors.
[0095] The encoder includes a source code encoding module and a binary code encoding module, which are used to perform semantic encoding on the source code feature vector and the binary code feature vector, respectively, to obtain the source code semantic vector and the binary code semantic vector.
[0096] The decoder is used to fuse source code semantic vectors and binary code semantic vectors, and to decode and search to generate binary code summary text.
[0097] The source code encoding and binary encoding modules have the same structure, only the parameter network parameters are different, including parallel multi-path sequentially connected embedding layer, encoding layer and weighted summation layer.
[0098] In this embodiment, the binary-source code association library is constructed from the <function source code, binary code> dataset. The <function source code, binary code> dataset is obtained by compiling the source code of a large-scale open-source project to obtain the corresponding binary file, parsing the binary file to obtain binary function-level information, and thus establishing the <function source code, binary code> dataset.
[0099] The binary code digest generation system based on knowledge transfer proposed in this embodiment combines the correlation between source code and binary code, makes reasonable use of knowledge transfer in the binary code digest generation task, and uses the semantic information of source code to help the model understand binary code, enhance the model's ability to extract functional semantic information of binary code, and improve the quality of binary code digest generation.
[0100] It should be noted that, in the description of the embodiments of the present invention, unless otherwise explicitly specified and limited, the terms "set" and "connection" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a direct connection or an indirect connection through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms in the present invention based on the specific circumstances. The accompanying drawings in the embodiments are used to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0101] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.
Claims
1. A binary code digest generation method based on knowledge transfer, characterized in that, include: Step 1: Parse the input binary file to obtain binary code characteristics; Step 2: Perform similarity detection on binary code based on binary code features. Obtain the source code corresponding to similar binary code in the binary code-source code association library, and then obtain the source code features. Step 3: Encode the binary code features and source code features to obtain the corresponding feature vectors; Step 4: Input the feature vectors of the binary code and the source code into the pre-trained binary code summarization generation model to generate binary code summary text; The binary code digest generation model includes an encoder and a decoder. The encoder includes a source code feature encoding module and a binary code feature encoding module. The source code feature encoding module is obtained by transferring the encoder of the source code digest generation model. In step 4, the method for obtaining the binary code digest generation model is as follows: Step 4.1: Extract the functional description text from the function source code, use it as the function source code summary, and construct a training dataset consisting of <function source code, binary code, summary>. Step 4.2: Based on the encoder-decoder based attention model, establish a source code digest generation model and a binary code digest model respectively. The encoder and decoder structures of the two models are the same. Step 4.3: Extract the dataset consisting of <function source code, summary> from the training dataset to complete the training of the source code summary generation model; Step 4.4: Transfer the encoder structure and parameters from the trained source code summarization model to the binary code summarization model, superimpose them with the original encoder structure to form a new encoder, extract the dataset consisting of <binary code, summary> from the training dataset, and complete the training of the binary code summarization model; In the encoder of the binary code digest model, the source code feature encoding module performs semantic encoding on the feature vector of the input source code to obtain the source code semantic vector; the binary code feature encoding module performs semantic encoding on the feature vector of the input binary code to obtain the binary code semantic vector. In the binary code digest model, an attention mechanism is used to perform a weighted summation of the source code semantic vector and the binary code semantic vector obtained at time step t to obtain a fused semantic vector of the two encoding modules. In the binary code digest model, the decoder decodes the input fused semantic vector and uses a cluster search method to generate binary code digest text.
2. The binary code digest generation method based on knowledge transfer according to claim 1, characterized in that, In step 2, a binary similarity detection model is used for detection. The training and detection methods for the binary similarity detection model are as follows: Step 2.1.1: Use two identical fully connected neural networks to form a twin architecture detection model. The two neural networks use the same hyperparameters and share parameters. Step 2.1.2: Using supervised binary analysis tools, extract the middle representation esil character from the two binary code function control flow graphs (CFGs) for use as input to the detection model; the detection model performs word segmentation and word embedding on the esil character to obtain the vector representation of the word, which is then input into the neural network to complete model training; Step 2.1.3: Output two semantic feature vectors, calculate the cosine similarity between the two semantic feature vectors, determine whether the two binary codes are similar, and update the neural network parameters through backpropagation and stochastic gradient descent.
3. The binary code digest generation method based on knowledge transfer according to claim 1 or 2, characterized in that, In step 2, the method for establishing the binary code-source code association library is as follows: Step 2.2.1: Obtain the source code of a large-scale open-source project, compile the source code in debug mode, and obtain the corresponding binary files; Step 2.2.2: Parse the binary file to obtain binary function-level information; Step 2.2.3: Construct a dataset of <function source code, binary code> based on binary function information, thereby building a function-level binary code-source code association library.
4. A binary code digest generation system based on knowledge transfer, used to apply the binary code digest generation method based on knowledge transfer as described in any one of claims 1 to 3, characterized in that, include: The binary code parsing module is used to parse the input binary code file to obtain binary code features, and encode the binary code features into binary code feature vectors. The binary code similarity detection module is used to obtain binary code features from the binary code parsing module, perform similarity detection, and obtain similar binary code. The binary-to-source code matching module retrieves the source code corresponding to similar binary codes from the established binary-to-source code association library. The source code parsing module parses the source code to obtain source code features and encodes these features into source code feature vectors. The encoder includes a source code feature encoding module and a binary code feature encoding module, which are used to perform semantic encoding on the source code feature vector and the binary code feature vector, respectively, to obtain the source code semantic vector and the binary code semantic vector. The decoder is used to fuse source code semantic vectors and binary code semantic vectors, and to decode and search to generate binary code summary text.
5. The binary code digest generation system based on knowledge transfer according to claim 4, characterized in that, The source code feature encoding module and the binary code feature encoding module have the same structure, only the network parameters are different. The source code feature encoding module includes parallel multi-path sequentially connected embedding layer, encoding layer and weighted summation layer.
6. The binary code digest generation system based on knowledge transfer according to claim 4 or 5, characterized in that, The binary code-source code association library is constructed from the <function source code, binary code> dataset. The <function source code, binary code> dataset is obtained by compiling the source code of a large-scale open-source project to obtain the corresponding binary file, parsing the binary file to obtain binary function-level information, and constructing the <function source code, binary code> dataset based on the binary function information.