# US 2025/0165600 A1 · Methods and systems for malware analysis using a genetic algorithm graph explainer

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2025/0165600 A1
- Document ID: US20250165600A1
- Status: Published application
- Kind: A1
- Application number: 18/954,706
- Filed: 2024-11-21
- Published: 2025-05-22
- Earliest claimed: 2023-11-21
- Applicants: BlackBerry Limited
- Inventors: Benjamin Chin Ming FUNG; Mohd SAQIB
- Web page: https://patentgrep.com/patent/US20250165600A1

## CPC

- G06F 21/56: Computer malware detection or handling, e.g. anti-virus arrangements
- G06F 21/562: {Static detection}
- G06F 21/563: {by source code analysis}
- G06N 3/045: Combinations of networks
- G06N 3/0464: Convolutional networks [CNN, ConvNet]
- G06N 3/084: Backpropagation, e.g. using gradient descent
- G06N 3/086: using evolutionary algorithms, e.g. genetic algorithms or genetic programming
- G06N 3/126: Evolutionary algorithms, e.g. genetic algorithms or genetic programming
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

A method for malware analysis comprising: disassembling executable code to create disassembled instructions; extracting instruction blocks from the disassembled instructions; encoding the instruction blocks to create encoded instruction blocks and generating a first data graph, wherein the first data graph comprises nodes, each node from the first data graph being associated with an encoded instruction block; determining for each node an embedding of the encoded instruction block to create a canonical executable graph; classifying the canonical executable graph into either a benign family or a malicious family; and determining that the executable code is a malware when the canonical executable graph belongs to a malicious family.

## Claims

### Claim 1

A method for determining whether an executable code is a malware, the method comprising:
disassembling the executable code to create disassembled instructions;
extracting instruction blocks from the disassembled instructions;
encoding the instruction blocks to create encoded instruction blocks and generating a first data graph, wherein the first data graph comprises nodes, each node from the first data graph being associated with an encoded instruction block;
determining for each node an embedding of the encoded instruction block to create a canonical executable graph;
classifying the canonical executable graph into either a benign family or a malicious family; and
determining that the executable code is a malware when the canonical executable graph belongs to a malicious family.

### Claim 2 (depends on 1)

The method of claim 1, wherein determining the embedding for each node comprises:
capturing spatial features within the encoded instruction block using an attention encoder, thereby creating the embedding of the encoded instruction block.

### Claim 3 (depends on 2)

The method of claim 2, wherein the attention encoder produces an output Eo according to an attention function:
Eo=Attention(Conv1D(B(m,n))
where B (m, n) represents an encoded instruction block, m denotes a number of instructions, and each instruction has an embedding of size n, and the output is generated by a one-dimensional convolutional neural network Conv1D.

### Claim 4 (depends on 1)

The method of claim 1, wherein the canonical executable graph further comprises edges to model control-flow relationships.

### Claim 5 (depends on 4)

The method of claim 4, wherein the edges are one or more of:
consequent edges (Ec);
conditional/fallthrough edges (Econd);
intra-function edges (EIntra); and
external edges (EExternal).

### Claim 6 (depends on 1)

The method of claim 1, wherein the classifying uses a Graph Convolutional Neural Network.

### Claim 7 (depends on 1)

The method of claim 1, further comprising utilizing a graph explainer on the canonical executable graph to create a classified graph for malware identification.

### Claim 8 (depends on 7)

The method of claim 7, wherein the graph explainer is a genetic algorithm graph explainer comprising iteratively:
initializing a subgraph by representing the subgraph as a chromosome of a first length, wherein each element within the chromosome corresponds to an edge index;
performing a crossover by combining the chromosome of the subgraph with a further chromosome to generate a child chromosome;
creating a decoded subgraph from the chromosome using an encoding-decoding mapping function;
assigning a fitness value to the decoded subgraph; and
selecting subgraphs that have the lowest fitness values within the population to proceed to a next generation,
wherein, after a stop criterion is reached, the classified graph is created.

### Claim 9 (depends on 8)

The method of claim 8, wherein the classified graph is used to identify and isolate malware in a computing system.

### Claim 10

A computing device configured for determining whether an executable code is a malware, the computing device comprising:
a processor; and
a memory,
wherein the computing device is configured to:
disassemble the executable code to create disassembled instructions;
extract instruction blocks from the disassembled instructions;
encode the instruction blocks to create encoded instruction blocks and generate a first data graph, wherein the first data graph comprises nodes, each node from the first data graph being associated with an encoded instruction block;
determine for each node an embedding of the encoded instruction block to create a canonical executable graph;
classify the canonical executable graphs into either a benign family or a malicious family; and
determine that the executable code is a malware when the canonical executable graph belongs to a malicious family.

### Claim 11 (depends on 10)

The computing device of claim 10, wherein the computing device is configured to determine embeddings for each node by:
capturing spatial features within the encoded instruction block using an attention encoder, thereby creating the embedding of the encoded instruction block.

### Claim 12 (depends on 11)

The computing device of claim 11, wherein the attention encoder produces an output E, according to an attention function:
Eo=Attention(Conv1D(B(m,n))
where B(m, n) represents an encoded instruction block, m denotes a number of instructions, and each instruction has an embedding of size n, and the output is generated by a one-dimensional convolutional neural network Conv1D.

### Claim 13 (depends on 10)

The computing device of claim 10, wherein the canonical executable graph comprises edges to model control-flow relationships.

### Claim 14 (depends on 13)

The computing device of claim 13, wherein the edges are one or more of:
consequent edges (Ec);
conditional/fallthrough edges (Econd);
intra-function edges (EIntra); and
external edges (EExternal).

### Claim 15 (depends on 10)

The computing device of claim 10, wherein the computing device is configured to classify using a Graph Convolutional Neural Network.

### Claim 16 (depends on 10)

The computing of claim 10, further configured to utilize a graph explainer on the canonical executable graph to create a classified graph for malware identification.

### Claim 17 (depends on 10)

The computing device of claim 10, wherein the graph explainer is a genetic algorithm graph explainer configured to iteratively:
initialize a subgraph by representing the subgraph as a chromosome of a first length, wherein each element within the chromosome corresponds to an edge index;
perform a crossover by combining the chromosome of the subgraph with a further chromosome to generate a child chromosome;
create a decoded subgraph from the chromosome using an encoding-decoding mapping function;
assign a fitness value to the decoded subgraph; and
select subgraphs that have the lowest fitness values within the population to proceed to a next generation,
wherein, after a stop criterion is reached, the classified graph is created.

### Claim 18 (depends on 17)

The computing device of claim 17, wherein the classified graph is used to identify and isolate malware in a computing system.

### Claim 19

A non-transitory computer readable medium for storing instruction code, which, when executed by a processor of a computing device, cause the computing device to:
disassemble executable code to create disassembled instructions;
extract instruction blocks from the disassembled instructions;
encode the instruction blocks to create encoded instruction blocks and generate a first data graph, wherein the first data graph comprises nodes, each node from the first data graph being associated with an encoded instruction block;
determine for each node an embedding of the encoded instruction block to create a canonical executable graph;
classify the canonical executable graphs into a benign family or a malicious family; and
determine that the executable code is a malware when the canonical executable graph belongs to a malicious family.

### Claim 20 (depends on 19)

The non-transitory computer readable medium of claim 19, wherein the instruction code, when executed by the processor, further causes the computing device to convert and reduce the dimensionality of embeddings by:
capturing spatial features within the encoded instruction block using an attention encoder, thereby creating an encoded representation.
