# US 2021/0342420 A1 · Software tamper resistance

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

- Number: US 2021/0342420 A1
- Document ID: US20210342420A1
- Status: Published application
- Kind: A1
- Application number: 17/271,259
- Filed: 2019-08-30
- Published: 2021-11-04
- Earliest claimed: 2018-08-31
- Assignees: Nagravision S.A.
- Applicants: Nagravision S.A.; Nagravision A.S.
- Inventors: Laurent DORÉ; Christian MÖNCH; Brecht WYSEUR
- Web page: https://patentgrep.com/patent/US20210342420A1

## CPC

- G06F 21/14: against software analysis or reverse engineering, e.g. by obfuscation
- G06F 21/54: by adding security routines or objects to programs
- G06F 21/6254: {by anonymising data, e.g. decorrelating personal data from the owner's identification}
- G06F 21/1066: {Hiding content}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

The present disclosure relates to software tampering resistance. In one aspect, a method for generating protected code is provided, comprising identifying a primary function in code to be obscured, the primary function being a function used to verify the integrity of the code run-time. The method then comprises generating a finite state machine from the primary function, wherein a state of the finite state machine at a given instance defines an element of the primary function to be executed. The method then comprises distributing the finite state machine throughout the code to obscure one or more areas of the code.

## Claims

### Claim 1

A computer implemented method for generating protected code, comprising:
identifying a primary function in code to be obscured;
generating a finite state machine from the primary function, wherein a state of the finite state machine at a given instance defines an element of the primary function to be executed;
distributing the generated finite state machine throughout the code.

### Claim 2 (depends on 1)

The method according to claim 1, wherein step of generating a finite state machine includes flattening the primary function.

### Claim 3 (depends on 2)

The method according to claim 2, wherein the step of flattening includes expanding one or more elements of the primary function to be expressed linearly within the primary function.

### Claim 4 (depends on 1, 2, 3)

The method according to any one of claims 1 to 3, wherein prior to generating the finite state machine, the method includes incorporating one or more sub-functions called by the primary function into the code of the primary function.

### Claim 5 (depends on 2, 3, 4)

The method according to any one of claims 2 to 4 further comprising changing local variables of the primary function to global variables accessible outside the primary function in the code.

### Claim 6 (depends on 1, 2, 3, 4, 5)

The method according to any one of claims 1 to 5, wherein the step of distributing comprises:
generating a plurality of partial finite state machines within the finite state machine generated for the primary function; and
incorporating the plurality of partial finite state machines into other functions in the code.

### Claim 7 (depends on 6)

The method according to claim 6, wherein the step of generating a plurality of partial state machines further comprises:
identifying a plurality of basic blocks of the finite state machine, wherein each basic block includes at least one element of the primary function that can be executed to obtain an intermediate result;
creating a void function for identified each basic block of the primary function to generate the partial finite state machine.

### Claim 8

The method according to any one of the preceding claims, further comprising generating one or more secondary finite state machines from other functions in the code.

### Claim 9 (depends on 8)

The method according to claim 8, wherein the step of distributing further comprises incorporating the finite state machine generated for the primary function into the one or more secondary finite state machines.

### Claim 10

The method according to any one of the preceding claims, wherein the primary function is a function to verify the integrity of the code by performing background checks during execution of the primary function.

### Claim 11

The method according to any one of the preceding claims, wherein the primary function is a void function which does not return a value.

### Claim 12

The method according to any one of the preceding claims, wherein the primary function is repeatedly accessed or called at run time when the code is executed.

### Claim 13

A computing device including one or more processors and a memory; the memory configured for storing code that is to be obscured, and the one or more processors configured to execute instructions to implement the method as claimed in any one of the preceding claims.
