Malicious software analysis system and method based on semantic embedding

By generating semantic embeddings and performing similarity searches, this approach addresses the challenges of malware variants and bypass techniques across CPU architectures, enabling the detection and classification of malware binaries across multiprocessor architectures and providing a robust malware analysis framework.

CN121569295APending Publication Date: 2026-02-24HONG KONG APPLIED SCI & TECH RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202580003163.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2025-10-17
Filing Date
2025-10-22
Publication Date
2026-02-24

AI Technical Summary

Technical Problem

Existing technologies are insufficient to effectively address malware variants and bypass techniques across CPU architectures, resulting in low efficiency for manual analysis and difficulty for automated analysis in identifying complex or covert malware.

Method used

By generating semantic embeddings and performing similarity searches, malware binary file detection and classification across multiprocessor architectures are achieved. The analysis is performed using an input interface, a file parser, a cross-CPU architecture disassembler, a similarity analysis module, and a malware similarity model training module to generate malware reports.

Benefits of technology

It achieves unified analysis across CPU architectures, features a file parser with intelligent enhancements, can detect and crack bypass techniques, and provides a scalable and robust malware analysis framework applicable to multiple platforms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121569295A_ABST
    Figure CN121569295A_ABST
Patent Text Reader

Abstract

The invention provides a malicious software analysis system based on semantic embedding. The system comprises an input interface, a file parser, a cross-CPU architecture disassembling module, a deployed and similarity analysis module, an output interface and a malicious software similarity model training module. The input interface receives and converts suspicious malware into a machine readable format. A file parser pre-processes a binary file to generate a normalized binary file by detecting and reversing a bypass technique in a sandbox. The cross-CPU disassembly module lifts the binary file to an intermediate representation (IR), extracts and normalizes the function, and generates a function base block (NF). The deployed embedding model translates the function base block into semantic embedding. And the similarity analysis module queries the malicious sample library by using the embedded vector, calculates a similarity score and generates an analysis result containing a potential malicious software family. The output interface generates a malware report. The training module is used for offline training, and the trained model is used for runtime analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a method for performing semantic malware analysis. In particular, this invention relates to a malware binary file analysis process with cross-CPU architecture capabilities and anti-bypass capabilities. Background Technology

[0002] Malware analysis aims to understand the behavior and purpose of samples to prevent future cyberattacks. Human analysis is inefficient and struggles to handle the massive number of variant threats. While human analysis can provide in-depth analysis, it is too time-consuming. Automated analysis, though faster, struggles to identify complex or covert malware. A hybrid approach combining human and automated techniques is often the most effective.

[0003] Control flow graphs (CFGs) illustrate the execution flow of a program. By analyzing CFGs, security analysts can identify characteristic patterns and behaviors of malware. Traditional malware analysis relies on CFG-based syntax signatures, but such signatures are ineffective against bypass techniques and cross-architecture variants.

[0004] Many malware variants share the same source code but adapt to different devices by compiling for different architectures. Cross-architecture malware variants are recompiled, resulting in a shift in syntax patterns, but the malicious intent is retained.

[0005] Therefore, there is an urgent need for a scalable semantic malware analysis system to deal with cross-architecture variants and bypass techniques. Summary of the Invention

[0006] According to a first aspect of the invention, a system for semantic embedding-based malware analysis is provided, which achieves malware binary detection and classification across multiprocessor architectures by generating semantic embeddings and performing similarity searches. The system includes an input interface, a file parser, a cross-CPU architecture disassembler module, a deployment similarity analysis module, an output interface, and a malware similarity model training module. The input interface is configured to receive suspicious malware from an external source and parse at least one file or document of the malware into a machine-readable form (such as structured digital data) recognizable by the file parser. The file parser is configured to preprocess the suspicious malware binaries received from the input interface, generating one or more normalized binaries by detecting and reversing bypass techniques in a controlled or sandboxed environment. The file parser is also configured to perform malware intelligence enhancement by updating the malware sample library through metadata analysis. The cross-CPU architecture disassembler module is configured to elevate the normalized binaries from the file parser to an intermediate representation (IR), extract program functions, and normalize the functions into normalized functions (NFs) that provide an architecture-independent semantic representation of the program. The deployed embedding model is configured to extract one or more functional relationships (NFs) from the normalized IR and convert the NFs into one or more semantic embeddings. The similarity analysis module is configured to query a malicious sample library using the semantic embeddings, calculate one or more similarity scores, and generate similarity analysis results containing one or more of the highest-probability malware families. The output interface is configured to receive the analysis results and generate a malware report containing the analysis results. The malware similarity model training module is configured to operate in an offline training process to generate a trained embedding model. This trained model is then adopted as the deployed embedding model in the runtime process.

[0007] According to a second aspect of the present invention, a method for semantic embedding-based malware analysis is provided, which enables malware binary file detection and classification across multiple processor architectures by generating semantic embeddings and performing similarity searches. The method includes the following steps: receiving suspected malware through an input interface and parsing the suspected malware binary file into a machine-readable form; preprocessing the suspected malware binary file in a controlled or sandbox environment by a file parser to detect and reverse bypass techniques, generating one or more normalized binary files; at least by a cross-CPU architecture disassembly module to elevate the normalized binary file to an IR (Integral Reference Array), extracting one or more program functions, and normalizing the program functions into one or more NFs (Non-Functional Functions); subsequently, embedding the NFs into one or more semantic embeddings by a deployed embedding model to capture instruction meaning, instruction context, and instruction intent; querying a malware sample library using semantic embeddings through a similarity analysis module, calculating one or more similarity scores, and generating similarity analysis results; and outputting similarity analysis results containing one or more malware families with the highest probability in a malware report.

[0008] Through the above configuration, the solution of the present invention achieves: (1) cross-CPU architecture binary file decompilation and normalization processing to achieve unified analysis; (2) semantic malware similarity model based on embedding technology; (3) file parser with intelligent enhancement function, which can detect and crack bypass technology, thereby providing a scalable and robust malware analysis framework applicable to multiple platforms. Attached Figure Description

[0009] The embodiments of the present invention will now be described in detail below with reference to the accompanying drawings, wherein:

[0010] Figure 1 This paper illustrates a semantic embedding-based malware analysis system architecture in certain embodiments of the present invention;

[0011] Figure 2 A file parser with anti-bypass capability is shown in some embodiments of the present invention;

[0012] Figure 3A and 3B This illustrates the tasks performed by the cross-CPU architecture decompilation module of the malware similarity model training module in some embodiments of the present invention;

[0013] Figure 4 The training process of a semantic malware similarity model according to certain embodiments of the present invention is illustrated;

[0014] Figure 5 The process of generating an extensible malware sample library according to certain embodiments of the present invention is illustrated;

[0015] Figure 6 The similarity analysis process according to certain embodiments of the present invention is illustrated; and

[0016] Figure 7 Exemplary similarity analysis results are provided according to certain embodiments of the present invention. Detailed Implementation

[0017] In the following description, systems and methods for semantic embedding-based malware analysis are illustrated as preferred examples. Those skilled in the art will understand that modifications, including additions and / or substitutions, can be made without departing from the scope and spirit of the invention. Specific details may be omitted to avoid obscuring the invention; however, this specification is intended to enable those skilled in the art to practice the invention without unnecessary experimentation.

[0018] Reference Figure 1 The following description is provided. System 100 is provided for semantic embedding-based malware analysis, and includes a malware analysis framework 110 configured to analyze malware binaries 102 and generate malware reports 180. The malware analysis framework 110 includes an input interface 112, a malware similarity analysis machine learning (ML) inference module 120, a malware similarity model training module 130, and an output interface 114, which together are configured to process input malware and provide similarity-based analysis results.

[0019] Input interface 112 is configured to receive one or more suspicious malware binaries 102 presented in a specific data format (e.g., from an external source) from a storage device or network source, such as executable files, compressed archives, or encoded data streams. Input interface 112 also includes circuitry and a storage buffer for parsing the received binaries into a machine-readable form and temporarily storing these files for subsequent processing. Therefore, input interface 112 can be implemented as a translator for receiving at least one suspicious malware binary 102 and converting the received content into a generic structured format for malware analysis framework 110. In some embodiments, input interface 112 performs format verification to detect whether the binary is executable, encrypted, or encoded. Accordingly, input interface 112 provides a physical mechanism to couple external malware binaries 102 to malware analysis framework 110, thereby enabling specific processing, parsing, and transmission of input data to downstream analysis modules.

[0020] The malware similarity analysis machine learning inference module 120 and the malware similarity model training module 130 are integrated into the malware analysis framework 110. The malware similarity analysis machine learning inference module 120 operates during runtime processing, while the malware similarity model training module 130 operates during offline processing.

[0021] The malware similarity analysis machine learning inference module 120 includes a file parser 140, a cross-CPU architecture disassembler 136, a deployed embedded model 150, and a similarity analysis module 160.

[0022] File parser 140 is configured to receive suspicious malware binaries from input interface 112 and preprocess the received binaries in a controlled or sandbox environment using detection and reversal bypass techniques to generate normalized binaries—these files represent preprocessed and deobfuscated files available for subsequent analysis. File parser 140, as a dedicated preprocessing stage, is specifically configured to detect and reverse bypass techniques such as Base64 encoding, UPX compression, and gzip compression, thereby enabling robust analysis of obfuscated malware.

[0023] File parser 140 includes a database matching module 142, a bypass detection module 144, an anti-bypass module 146, a malware sample library 148, and a threat intelligence enhancement function module 149. Database matching module 142 checks whether incoming suspicious malware binaries have been processed by the framework (i.e., malware analysis framework 110) to reduce processing time for duplicate malware. Bypass detection module 144 identifies whether malware binaries have been obfuscated, compressed, or encoded. Anti-bypass module 146 reverses detected bypass techniques. Threat intelligence enhancement function module 149 performs intelligence enhancement operations to enrich malware intelligence and updates the malware sample library 148.

[0024] File parser 140 is also responsible for passing the normalized binary file to cross-CPU architecture disassembler module 136. Cross-CPU architecture disassembler module 136 operates during runtime inference and is configured to elevate the normalized binary file output by file parser 140 into an intermediate representation (IR), extract program functions, and normalize these functions into normalized functions (NFs), thereby providing an architecture-independent program semantic representation. For example, cross-CPU architecture disassembler module 136 can convert native instructions from multiprocessor architectures such as x86, ARM, or MIPS into an architecture-independent LLVM intermediate representation. Normalized function-level representations are generated by applying variable renaming, control flow simplification, and removing compiler-specific artifacts, extracting program functions from the intermediate representation, and normalizing them into NFs. Cross-CPU architecture disassembler module 136 outputs the generated IR and NF to a deployed embedding model 150 for semantic embedding transformation. In this configuration, cross-CPU architecture disassembler module 136 performs real-time disassembly and normalization processing to support in-line execution.

[0025] The deployed embedding model 150 is configured to receive normalized binary files and internally derive NF for semantic embedding transformation. The embedding vectors are transmitted to the similarity analysis module 160, which queries the malicious sample library 148, calculates similarity scores, and generates analysis results. During this process, the deployed embedding model 150 is part of the runtime inference module 120 and is not trained during runtime. The embedding model training module 134 trains and updates the model offline, and the resulting training configuration / model is deployed as the "deployed" embedding model 150 to the runtime inference module 120.

[0026] The term "deployed" in "deployed embedding model 150" means that the embedding model, after being generated and optimized offline, is integrated into the runtime environment for practical application. The malware similarity model training module 130 includes an embedding model training module (i.e., embedding model training module 134), which generates the trained embedding model during the pre-training and fine-tuning phases. The final training result is adopted as the deployed embedding model 150. Therefore, deploying the embedding model 150 represents a deployed version of the model trained by the embedding model training module 134, achieving semantic reasoning while maintaining consistency with the offline training process.

[0027] The runtime inference module 120 is further configured to generate malware intelligence during the similarity analysis process and update the malware sample database 148 with the generated intelligence. In this context, "malware intelligence" refers to enhanced metadata and analysis results related to the input malware, including similarity scores, identified malware families, file hashes, and reverse bypass details obtained through the file parser 140. By feeding malware intelligence back to the malware sample database 148, the system 100 can incrementally expand its knowledge base, thereby improving the accuracy and coverage of future similarity searches.

[0028] The malware similarity model training module 130 includes an embedding model training module 134. This training module may employ a cross-CPU architecture disassembler module 132, which is used only during offline training. In this regard, the cross-CPU architecture disassembler module 132 is capable of performing the same or similar functions or tasks as the cross-CPU architecture disassembler module 136. This module is configured to elevate binaries from multiple processor architectures to intermediate representations (IR) and extract program functions for normalization, generating normalized functions (NFs) that provide architecture-independent program semantic representations. This offline transformation and normalization process generates normalized and architecture-independent program semantic representations, thereby reducing surface syntax differences and ensuring consistency of training inputs. The embedding model training module 134 generates a trained embedding model by training NFs, and the embedded model 150 deployed in the runtime inference module 120 is derived from this trained model. In some embodiments, the cross-CPU architecture disassembler module 132 and the cross-CPU architecture disassembler module 136 may be two synchronously updated components to maintain the latest version. In other embodiments, the malware similarity model training module 130 communicates with the malware similarity analysis machine learning inference module 120, and can be activated during offline training to utilize the cross-CPU architecture decompilation module 136 to perform decompilation and normalization tasks to support model training.

[0029] Output interface 114 is configured to receive analysis results and malware intelligence from similarity analysis module 160 in runtime inference module 120 and generate malware report 180. Output interface 114 includes circuitry and executable instructions for converting similarity scores, identified malware families, metadata, and reverse bypass details into a structured report format. Malware report 180 may include one or more of the following: (i) a similarity score distribution graph (showing the degree of similarity to known malware families); (ii) a list of candidate families most closely associated with the input malware; (iii) the file hash and other unique identifiers of the input binary file; (iv) details of bypass techniques detected and reversed during the preprocessing stage; and (v) links or references to relevant entries in malware sample library 148. Thus, output interface 114 provides a concrete report usable by external systems or security analysts for actionable applications of malware detection, classification, and threat intelligence integration.

[0030] Figure 1 The overall architecture of System 100 is demonstrated. The malware analysis framework 110 and its associated modules / models are presented in an integrated structure, clearly illustrating the data flow from input to output. The following sections will elaborate on each component of the malware analysis framework 110, including its internal configuration, operational steps, and interactions with other modules, to provide a clearer understanding of the system functions.

[0031] Reference Figure 2 Several embodiments of the present invention illustrate a file parser 140 with anti-bypass capabilities. This module preprocesses the input malware binary file 102 through a sequence of detection, reverse engineering, and enhancement processing to generate a normalized binary file for subsequent analysis. The file parser 140 includes a database matching module 142, a bypass detection module 144, an anti-bypass module 146, and a threat intelligence enhancement function module 149. These modules work together as follows, including steps S210, S220, S230, S240, and S250.

[0032] In step S210, the database matching module 142 compares the input malware binary file 102 with the metadata stored in the malware sample library 148 to determine whether the binary file 102 has been analyzed (e.g., processed by the malware analysis framework 110). If a match is found, the corresponding analysis result is directly output without further processing, thus avoiding redundant calculations. If no historical record is found, the input malware binary file is forwarded to the bypass detection module 144.

[0033] In step S220, if the database matching module 142 does not detect the malicious binary file 102 during its execution phase, the bypass detection module 144 will invoke the encoding detector, compression detector, and packer detector in parallel to identify whether the input malicious software has applied bypass techniques. The encoding detector identifies the binary file by examining the characteristic patterns of common encoding schemes. The compression detector locates compressed sections by identifying the structural markers of the corresponding compression algorithm. The packer detector determines whether the binary file has undergone executable packaging by analyzing header anomalies and instruction irregularities.

[0034] This stage aggregates the results from the encoding detector, compression detector, and packer detector into a bypass detection result, thereby determining whether the malware binary employs one or more bypass techniques. Parallel processing of these detectors allows for the simultaneous evaluation of different bypass patterns, improving detection efficiency and reducing overall analysis time.

[0035] In step S230, when a bypass technique is detected, the anti-bypass module 146 reverses the bypass behavior by performing one or more of the following operations: decoding, decompression, and unpacking. The decoding function is configured to convert the encoded data back to its original binary form. The decompression function restores the compressed binary content to its uncompressed state. The unpacking function removes the encapsulation layer of the binary file, restoring the executable segment to an analyzable format. These reversal operations aim to restore the malware binary file to a normalized state.

[0036] In step S240, when the bypass detection result shows no bypass technique was found, the threat intelligence enhancement module 149 is activated. The threat intelligence enhancement module 149 is configured to associate the detection result with the metadata of the input malware (including at least file size, file type, file magic information, and bypass detection result), and update the malware sample database 148 accordingly. By continuously enhancing the database 148 with new information on malware and bypass techniques, the system 100 gradually accumulates intelligence to support future bypass pattern analysis and identification.

[0037] In step S250, after detecting and reversing the bypass technique, the anti-bypass module 146 outputs a normalized binary file with the bypass traces removed. This normalized binary file is then passed to the deployed embedding model 150 for downstream semantic embedding analysis. In addition to being forwarded to the deployed embedding model 150, the normalized file is also provided to the threat intelligence enhancement module 149 to further associate the normalized binary file with associated metadata. Furthermore, when multi-layered bypass techniques exist, the normalized file can be reintroduced into the file parsing pipeline of the file parser 140 as input for new malware, thereby enabling iterative processing to perform subsequent operations.

[0038] Reference Figure 3Aand 3B This demonstrates the task performed by the cross-CPU architecture decompilation module 132 within the malware similarity model training module 130. Module 132 is configured to receive binary files from the training corpus (optionally, normalized files prepared using the same preprocessing steps as module 140) and elevate the binary files into an intermediate representation (IR). Here, elevation refers to converting architecture-specific machine instructions into an architecture-independent intermediate representation that preserves program semantics while abstracting hardware details.

[0039] like Figure 3A As shown, binary files from different architectures (such as x86, MIPS, and ARM) are uniformly converted into IRs, thereby providing an architecture-independent representation of program instructions. In some embodiments, existing disassembler and boosting tools (such as RetDec) can be used to perform the conversion. The generated IR serves as the basis for subsequent semantic analysis, enabling the system to compare the behavioral meaning of code snippets across architecture platforms. Based on the IR, the cross-CPU architecture disassembler module 132 is further configured to extract program functions and normalize the extracted functions to NF.

[0040] like Figure 3B As shown, a given binary file can be decomposed into multiple NFs (NF1 to NFn). The normalization process includes unifying variable names to eliminate compiler-dependent naming differences, simplifying control flow structures such as loops and conditional branches to their canonical forms, and removing compiler-specific artifacts such as padding instructions or inline assembly modes. Other transformations include replacing architecture-specific library calls with normalized representations and normalizing immediate values ​​to symbol tokens. NF generation provides a normalized and architecture-independent representation of program semantics.

[0041] The normalized NF output by the cross-CPU architecture disassembler 132 is then fed into the embedding model training pipeline of the malware similarity model training module 130. By converting binary code to IR and then to NF, system 100 implements language model-based semantic learning—a model that captures instruction intent rather than syntactic features—thereby supporting accurate cross-architecture malware similarity analysis.

[0042] In other words, the cross-CPU architecture disassembler module 132 is responsible for generating functional relationships (NFs) that provide architecture-independent program semantic representations. These NFs are not used directly for inference, but rather serve as training inputs for the embedded model in the malware similarity model training module 130. The embedded model training module 134 uses the NFs generated by the cross-CPU architecture disassembler module 132 for training. Therefore, the cross-CPU architecture disassembler module 132 operates as a data preparation phase, while the embedded model training module 134 performs the actual model training, ultimately generating a trained, mature embedded model for runtime inference.

[0043] Based on this, the cross-CPU architecture decompilation module 136 during runtime inference can perform the same or similar tasks as the cross-CPU architecture decompilation module 132 during offline training. In runtime operation, the cross-CPU architecture decompilation module 136 receives the normalized binary file output by the file parser 140, elevates the received binary file into an intermediate representation (IR) in a manner consistent with the offline elevation process, and extracts program functions from the IR. The extracted functions are normalized into architecture-independent functional groups (NFs) through variable renaming, control flow simplification, and removal of compiler-dependent pseudo-constructions. The generated IR and NF are then transmitted to the deployed embedding model 150, which performs semantic embedding transformation and similarity analysis.

[0044] Reference Figure 4 The malware semantic similarity model training process shown includes steps S410, S420, and S430. In step S410, the binary files in the malware training dataset (such as the core toolkit and malware samples) are processed by the cross-CPU architecture disassembler module 132. This module is configured to elevate the binary files to an intermediate representation layer, extract program functions, and normalize the extracted functions to generate NF. The normalization process includes unifying variable names and simplifying compiler dependency structures, making the generated functions architecture-independent.

[0045] In some embodiments, the NF is further labeled to form a labeled normalized function (LNF) for use in subsequent fine-tuning stages. The NF and LNF are provided as training inputs to the embedding model training module 134, enabling the model to learn from both unlabeled and labeled data sources simultaneously (e.g., the unlabeled NF is used for pre-training, while the LNF is reserved for fine-tuning in later stages).

[0046] In step S420, the embedding model training module 134 performs a pre-training process to generate an intermediate embedding model. In one embodiment, the pre-training process employs a mask transformer task based on the BERT (Bidirectional Encoder Representation) architecture, enabling the model to predict mask tokens and thereby learn contextual instruction semantics. Specifically, the embedding model training module 134 is configured to capture instruction meaning and context to enhance cross-code variant malware detection capabilities, while going beyond surface syntax parsing to capture instruction intent. This module generates a pre-trained intermediate model by processing these NFs, storing instruction-level semantic features in vector form.

[0047] In step S430, the embedding model training module 134 is further configured to perform semantic learning fine-tuning for the downstream similarity comparison task. The intermediate model receives LNF as input, where similarity labels indicate functional equivalence between different binary files. In one embodiment, the fine-tuning dataset contains approximately 800 binary files from coreutils, totaling over 1 million code snippet entries. Through this fine-tuning process, the embedding model training module 134 generates a fine-tuned BERT model specifically optimized for semantic malware similarity analysis, which is then adopted by the runtime inference module 120.

[0048] At this point, the embedding model training module 134 is functionally associated with the deployed embedding model 150, but runs in an independent environment. The embedding model training module 134 is dedicated to generating and optimizing the embedding model through pre-training and fine-tuning in an offline environment, while the deployed embedding model 150 is a deployed version that is trained and integrated into the runtime inference module 120.

[0049] In this configuration, the deployed embedding model 150 performs semantic reasoning on normalized binary files during malware analysis, while the embedding model training module 134 can be recalled in subsequent offline sessions to update or retrain the model, and any new training version will be used again as the updated deployed embedding model 150.

[0050] Reference Figure 5 As shown, several embodiments of the present invention illustrate a scalable malware sample library generation process. Malware binaries can be collected from multiple sources, including user-submitted malware, curated malware libraries, and open-source repositories.

[0051] like Figure 5 The featured malware library shown in the top left corner can contain known malware families maintained as a reference set, such as "trojan.hajime" and "downloader.linux". Open source repositories (such as...) Figure 5 (As shown in the upper right corner) This may include publicly available executables collected for research purposes, such as "locker" and "zeroaccess". These files are processed by the cross-CPU architecture disassembler module 136, which elevates them to a malware dataset (LLVM intermediate representation). After the malware dataset is generated, the process proceeds to the next two stages: the first stage is database construction, and the second stage is verification.

[0052] like Figure 5As shown on the right, the first stage processes the malware dataset, extracting normalized program functions and associating them with classification information to form labeled malware for database construction. The labeled malware is stored as metadata in the malware sample library 148. The deployed embedding model 150 is further configured to embed function-level semantic malware (e.g., using a fine-tuned BERT model). The generated function-level malware embeddings are also stored in the malware sample library 148, but in vector form (e.g., using a vector storage engine such as pgvector), thus constructing a malware sample library that integrates metadata and vector embeddings. In one embodiment, the first stage uses labeled malware extracted from over 650 malware binaries to construct the database, thereby generating a large-scale embedding corpus that supports scalable and efficient similarity search while maintaining association with the metadata.

[0053] like Figure 5 As shown on the left, the second phase provides a separate dataset of labeled malware as validation input. Embedding models 150 are deployed to embed these validation samples (e.g., using a fine-tuned BERT model) into function-level malware embeddings, which are then compared and retrieved against vector representations stored in a malware sample library 148. This validation process confirms that the embedding vectors generated based on labeled malware can achieve accurate retrieval and classification through semantic similarity. Therefore, the second phase ensures the consistency and accuracy of the malware sample library 148—a database that maintains both vector embeddings and metadata (such as malware families, file hashes, file types, and file magic number information) to support comprehensive analysis.

[0054] Reference Figure 6 The similarity analysis process in some embodiments of the present invention includes steps S610, S620, S630, S640 and S650.

[0055] Step S610 represents a preprocessing phase executed at runtime, but this phase is completed outside the similarity analysis module 160. In this step, the input malware binary from the file parser 140 is processed by the deployed embedding model 150. Internally, this model elevates the binary to an intermediate representation, extracts program functions, and normalizes them into normalized functions. Each NF is embedded by the deployed embedding model 150 (e.g., using a fine-tuned BERT model), thereby generating semantic embeddings at runtime. After preprocessing, the similarity analysis process begins based on the generated malware NFs and their corresponding embeddings.

[0056] In step S620 performed by the similarity analysis module 160, at least one iteration is performed for each NF embedding generated by the deployed embedding model 150. During the iteration, the similarity analysis module 160 submits the embedding of each NF to the malware sample database 148 for similarity searching. This embedding is compared with the vector-form function-level embeddings stored in the malware sample database 148. In each iteration, the similarity analysis module 160 identifies the 10 functions most similar to the queried NF and calculates a similarity score for each pair of functions. Simultaneously, metadata (such as filenames or malware family tags) of the candidate functions is retrieved from the malware sample database 148, thereby associating each NF with the most similar counterpart in the database.

[0057] In step S630, the similarity analysis module 160 identifies the top 10 malware samples containing the most similar functions. For each NF of the input malware, the top 10 candidate matches are grouped according to their source malware binary. By integrating the search results of vector embeddings and associated metadata, the malware sample library 148 provides candidate samples most relevant to the input malware.

[0058] In step S640, the similarity analysis module 160 performs similarity score aggregation to generate file-level similarity confidence. This module integrates the similarity scores of each function function (NF), calculates the frequency of matching functions associated with the same malware binary, and assigns an average similarity score representing its similarity to the overall input malware to each candidate binary. The output of this step is a ranked list of malware binary files with associated aggregated confidence.

[0059] In step S650, the similarity analysis module 160 identifies the three tags with the highest probability of the input malware binary file based on the aggregated similarity score and the tag count extracted from the malicious sample library 148. The output is a similarity result set containing the three most likely malware families, which is submitted to the output interface 114 as the final analysis conclusion to generate a report, thus forming part of the malware report 180 for delivery to external systems or analysts.

[0060] Specifically, after step S650 is completed, the similarity analysis module 160 generates specific similarity results, including: (i) a sorted list of malware binaries with aggregated similarity confidence scores, and (ii) the top three most likely malware family labels with associated probabilities. These results are transmitted to output interface 114, which formats the data into malware report 180. Malware report 180 thus provides actionable results, which may include similarity score distribution, candidate family classification, and enhanced metadata, enabling security analysts or external systems to take effective action.

[0061] Reference Figure 7This example demonstrates an exemplary similarity analysis result, including steps S710, S720, S730, S740, and S750. This example proves the practical application value of the architecture proposed in this invention: the system generates actionable similarity outputs for input malware, including function-level comparisons, aggregated similarity scores, and family tags. This ability to produce executable results confirms that this invention aims to achieve practical applications in malware detection and classification, rather than being an abstract concept.

[0062] In step S710, the input malware binary, identified by a hash value (e.g., 03645dfafc29782d497e41b81f6e4d7529ebf3c19dca8d0f04a23b105088b48), is processed by the deployed embedding model 150. The binary is promoted to IR, and its functions are extracted and normalized to normalized functions, such as NF1 (function #16) and NF2 (function #136). Each NF is then embedded into a semantic embedding vector.

[0063] In step S720, each NF embedding is compared with the function-level embeddings stored in vector form in the malicious sample library 148. For each query, the system 100 identifies the 10 NFs with the highest similarity and assigns them similarity scores. For example, the similarity scores of NF1 with functions #679 and #104 are 0.995 and 0.983, respectively.

[0064] In step S730, the associated metadata of candidate NFs, including malware family tags, is retrieved from the malicious sample library 148. The metadata retrieval results show that both NF1 and NF2 are associated with the "Winwebsec" malware family tag.

[0065] In step S740, the similarity analysis module 160 aggregates the similarity scores of all non-files (NFs) of the input malware binary. This aggregation process integrates the scores of a multinomial function, groups the results by candidate malware binary, and assigns an overall similarity confidence score to each candidate. As shown in the figure, the aggregation step yields three candidate malware binary files with confidence scores of 100.00%, 98.13%, and 94.24%, respectively, all of which are associated with the "Winwebsec" family.

[0066] In step S750, the final similarity results are generated, in which the malware binary to be analyzed is classified with high confidence into the "Winwebsec" family. The results table displays similar malware samples, their tags, and corresponding confidence scores. This output is then passed to output interface 114, where it is formatted to generate a malware report 180. This report records the identified family tags and corresponding similarity statistics for analysts to review or integrate into external security systems.

[0067] In summary, this system provides an efficient workflow: malware binaries are elevated to the LLVM intermediate representation layer, functions are extracted and normalized, and then embedded using language models such as BERT. Embedded vectors are queried from a scalable vector database to generate similarity results and top-level labels, thereby optimizing malware analysis response time. Furthermore, malware intelligence will be continuously enriched and accumulated over time, providing more comprehensive and adaptive analytical capabilities for future detection.

[0068] The function units and modules of the apparatus and method described in this embodiment can be implemented by computing devices, computer processors, or electronic circuits, including but not limited to application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), microcontrollers, and other programmable logic devices, all of which are configured or programmed in accordance with this disclosure. The computer instructions or software code that execute in the computing device, computer processor, or programmable logic device can be easily prepared by a person skilled in software or electronics technology based on this disclosure.

[0069] The methods according to this embodiment can be executed in whole or in part on one or more computing devices, including mobile computing devices such as server computers, personal computers, laptops, smartphones, and tablets.

[0070] The embodiments may include computer storage media, transient and non-transient storage devices having computer instructions or software code for programming or configuring computing devices, computer processors, or electronic circuits to perform any of the processes of the present invention. The storage media, transient and non-transient memory devices may include, but are not limited to: floppy disks, optical disks, Blu-ray discs, DVDs, CD-ROMs, magneto-optical disks, ROMs, RAMs, flash memory devices, or any medium or device suitable for storing instructions, code, and / or data.

[0071] Function units and modules according to different embodiments may also be deployed in distributed computing environments and / or cloud computing environments, wherein all or part of the machine instructions are executed in a distributed manner by one or more processing devices interconnected through communication networks (such as intranets, wide area networks (WANs), local area networks (LANs), the Internet and other data transmission media).

[0072] The foregoing description of this invention is intended to provide illustrative examples and is not intended to be exhaustive or to limit the invention to the precise forms disclosed. Many modifications and variations will be understood by those skilled in the art.

[0073] These embodiments were chosen and described to best illustrate the principles of the invention and its practical application, thereby enabling those skilled in the art to understand the application of the invention in various embodiments and to make various modifications according to specific uses.

Claims

1. A system for semantic embedding-based malware analysis, which achieves malware binary file detection and classification across multiprocessor architectures by generating semantic embeddings and performing similarity searches, the system comprising: The input interface is configured to receive one or more malware binaries and parse at least one file or document in the malware binary into a machine-readable form. A file parser is configured to preprocess the malware binary file in machine-readable form received from the input interface to generate one or more normalized binary files by detecting and reversing bypass techniques in a controlled or sandboxed environment. The first cross-CPU architecture decompilation module is configured to elevate the one or more normalized binary files output by the file parser to an intermediate representation, extract program functions, and normalize these program functions into one or more normalized functions to provide an architecture-independent program semantic representation. An embedded model has been deployed and configured to obtain the one or more normalization functions from the first cross-CPU architecture disassembly module and convert the one or more normalization functions into one or more semantic embeddings; The similarity analysis module is configured to query a malicious sample library based on the semantic embedding, calculate one or more similarity scores, and generate analysis results containing one or more of the highest probability malware families. An output interface is used to receive the analysis results and generate a malware report containing the analysis results; The malware similarity model training module is configured to operate in an offline training process to generate a trained embedding model, which is used as the deployed embedding model in a runtime process.

2. The system according to claim 1, wherein the malicious sample library is configured to simultaneously store vector embeddings in vector form and metadata including malware family classification, file hash value, file type and file magic number information.

3. The system of claim 1, wherein the file parser includes a database matching module configured to compare each received malware binary with an entry in the malware sample library to determine whether the malware binary has been analyzed.

4. The system of claim 3, wherein the file parser further comprises an bypass detection module configured to perform parallel processing on the received malware binary, including: Encoding detectors are used to identify encoding schemes; A compression detector is used to identify compressed segments corresponding to the algorithm. Packer detector, used to detect executable packaging methods.

5. The system of claim 4, wherein the file parser further comprises an anti-bypass module configured to reverse detected bypass techniques by performing decoding, decompression, or unpacking operations on each received malware binary file, and the anti-bypass module outputs a normalized binary file with bypass traces removed for each received malware binary file.

6. The system of claim 5, wherein the file parser further comprises a threat intelligence enhancement module configured to associate detection or reversal results with received malware binary file metadata and update the malware sample library with enhanced information.

7. The system of claim 1, wherein the malware similarity model training module further comprises an embedding model training module configured to be trained based on a normalization function generated by a second cross-CPU architecture disassembly module to generate a trained embedding model capable of capturing instruction meaning, instruction context, and instruction intent, the trained embedding model being deployed as an embedding model in a runtime inference module.

8. The system of claim 7, wherein the deployed embedding model is configured to derive the normalization function from within the normalized binary file output by the first cross-CPU architecture disassembler module, and to convert the normalization function into a semantic embedding at runtime.

9. The system of claim 8, wherein the deployed embedding model comprises a fine-tuned embedding model optimized for semantic malware similarity analysis.

10. The system of claim 1, wherein the similarity analysis module is further configured to perform a similarity search by comparing the embedding of the normalized function with function-level embeddings stored in vector form in a malicious sample library.

11. The system of claim 10, wherein the similarity analysis module is further configured to aggregate the similarity scores of the plurality of normalization functions into a file-level similarity confidence score and identify the most likely malware family for the input malware binary.

12. A method for semantic embedding-based malware analysis, which achieves malware binary file detection and classification across multiprocessor architectures by generating semantic embeddings and performing similarity searches, including: The system receives one or more malware binaries via an input interface and parses at least one file or document within the malware binary into a machine-readable form. The malware binary is preprocessed in a controlled or sandbox environment using a file parser to detect and reverse one or more bypass techniques and generate one or more normalized binary files. At least through a cross-CPU architecture disassembly module, each normalized binary file is elevated to an intermediate representation, one or more program functions are extracted, and the program functions are normalized into normalized functions; The normalization function is embedded into the semantic embedding through the deployed embedding model to capture the meaning, context, and intent of the instruction. The similarity analysis module uses the semantic embedding to query the malicious sample library, calculate the similarity score, and generate similarity analysis results. The malware report outputs similarity analysis results containing one or more of the most probable malware families.

13. The method of claim 12, wherein preprocessing includes comparing the malware binary with metadata entries in the malware sample library to determine whether the malware binary has been analyzed.

14. The method of claim 12, wherein the preprocessing further comprises using a parallel detector to detect bypass techniques, the detector comprising: an encoding detector, a compression detector for the compressed segment corresponding to the algorithm, and a packer detector for the executable packaging method.

15. The method of claim 14, wherein the preprocessing further comprises reversing the detected bypass technique by applying decoding, decompression, or unpacking operations, thereby restoring the malware binary to a normalized state.

16. The method of claim 12, wherein elevating the binary file to the intermediate representation includes converting architecture-specific instructions from multiple processor architectures into an architecture-independent intermediate representation.

17. The method of claim 12, further comprising: The embedding model is trained to generate a trained embedding model, which is then adopted as a deployed embedding model. The training includes: pre-training using an implemented mask transformer task, and fine-tuning on a labeled normalized function with similarity labels that have an indicator function equivalence.

18. The method of claim 12, wherein the similarity analysis further comprises: For each normalization function, an execution loop is embedded to identify the 10 functions with the highest similarity. Candidate matches are grouped by malware binary file, and the similarity scores are aggregated into file-level similarity confidence.

19. The method of claim 12, wherein the malicious sample library stores semantic embeddings in vector form and is associated with metadata including malware family classification, file hash value, file type and file magic number information.

20. The method of claim 12, further comprising: By correlating similarity results and bypass detection results to the metadata of the analyzed malware, malware intelligence is enriched, and the rich information is used to update the malware sample library for subsequent analysis.