# US 2023/0069638 A1 · Automated c-structure introspection and discovery

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

- Number: US 2023/0069638 A1
- Document ID: US20230069638A1
- Status: Published application
- Kind: A1
- Application number: 17/804,988
- Filed: 2022-06-01
- Published: 2023-03-02
- Earliest claimed: 2021-08-26
- Assignees: Salesforce, Inc.
- Applicants: Salesforce, Inc.
- Inventors: Aditya Prasad Gurajada
- Web page: https://patentgrep.com/patent/US20230069638A1

## CPC

- G06F 9/45512: {Command shells}
- G06F 11/3644: {by instrumenting at runtime}
- G06F 8/74: Reverse engineering; Extracting design information from source code
- G06F 8/75: Structural analysis for program understanding
- G06F 11/362: Debugging of software
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Methods, apparatuses, and computer program products are described. A system may run a set of Automated Structure processing (ASP) scripts on a program binary executable written in C-language without making changes to source-code. The system may generate a set of dictionary files indicating data structural information specifically for the C-language program based on running the set of ASP scripts on the program binary executable. The dictionary files may include a list of C-structures referenced and type definitions and structure layouts associated with the C-structures. The system may combine the data structural information with an ASP library to generate an extended ASP library, and may augment the program binary executable with the extended ASP library to generate an augmented program binary executable. The system may programmatically perform an introspection and data discovery procedure on a C-language program at run-time using the augmented program binary executable.

## Claims

### Claim 1

A method for data processing, comprising:
running a set of automated structure processing (ASP) scripts on a program binary executable written in C-language;
generating a set of dictionary files indicating data structural information for the program binary executable based at least in part on running the set of ASP scripts on the program binary executable;
combining the data structural information from the set of dictionary files with an ASP library to generate an extended ASP library;
augmenting the program binary executable with the extended ASP library to generate an augmented program binary executable; and
performing an introspection and data discovery procedure on a C-language program using the augmented program binary executable.

### Claim 2 (depends on 1)

The method of claim 1, wherein generating the set of dictionary files comprises:
identifying the data structural information of the program binary executable, wherein the data structural information comprises a list of C-structures referenced, names of fields in the C-structures, definitions of individual fields including data type names and data type definitions, additional data type definitions compiled in the program binary executable, references to nested sub-structures, layouts of bit fields in structured fields, enumerated type definitions including names and enumerated constant values, or any combination thereof.

### Claim 3 (depends on 2)

The method of claim 2, wherein generating the set of dictionary files comprises:
generating a set of internal structure definition tables.

### Claim 4 (depends on 3)

The method of claim 3, wherein the set of internal structure definition tables comprise structural definition description (SDD) dictionaries for all data structures in the program binary executable.

### Claim 5 (depends on 3)

The method of claim 3, wherein generating the set of internal structure definition tables comprises:
executing a first shell script of the set of ASP scripts to generate a set of intermediate files indicating the data structural information; and
executing a second table generation script to generate the set of internal structure definition tables using the set of intermediate files.

### Claim 6 (depends on 1)

The method of claim 1, wherein the augmented program binary executable is generated at a build-time associated with the C-language program, and wherein the introspection and data discovery procedure is performed dynamically at a run-time associated with the C-language program.

### Claim 7 (depends on 1)

The method of claim 1, further comprising:
performing the introspection and data discovery procedure on the C-language program comprises printing data structures of the C-language program, examining the C-language program, debugging the C-language program, performing trace operations on the C-language program, or any combination thereof.

### Claim 8 (depends on 7)

The method of claim 7, further comprising:
performing the introspection and data discovery procedure on the C-language program comprises executing an ASP application programming interface (API), wherein the ASP API supports querying the data structural information of the C-language program, generating a catalog of field descriptions, structure layout, and enumerated type information of the C-language program, or any combination thereof.

### Claim 9 (depends on 1)

The method of claim 1, further comprising:
running the set of ASP scripts on the program binary executable comprises running a debugging program to extract structural information compiled in the program binary executable.

### Claim 10

An apparatus for data processing, comprising:
a processor;
memory coupled with the processor; and
instructions stored in the memory and executable by the processor to cause the apparatus to:
run a set of automated structure processing (ASP) scripts on a program binary executable written in C-language;
generate a set of dictionary files indicating data structural information for the program binary executable based at least in part on running the set of ASP scripts on the program binary executable;
combine the data structural information from the set of dictionary files with an ASP library to generate an extended ASP library;
augment the program binary executable with the extended ASP library to generate an augmented program binary executable; and
perform an introspection and data discovery procedure on a C-language program using the augmented program binary executable.

### Claim 11 (depends on 10)

The apparatus of claim 10, wherein the instructions to generate the set of dictionary files are executable by the processor to cause the apparatus to:
identify the data structural information of the program binary executable, wherein the data structural information comprises a list of C-structures referenced, names of fields in the C-structures, definitions of individual fields including data type names and data type definitions, additional data type definitions compiled in the program binary executable, references to nested sub-structures, layouts of bit fields in structured fields, enumerated type definitions including names and enumerated constant values, or any combination thereof.

### Claim 12 (depends on 11)

The apparatus of claim 11, wherein the instructions to generate the set of dictionary files are executable by the processor to cause the apparatus to:
generate a set of internal structure definition tables.

### Claim 13 (depends on 12)

The apparatus of claim 12, wherein the set of internal structure definition tables comprise structural definition description (SDD) dictionaries for all data structures in the program binary executable.

### Claim 14 (depends on 12)

The apparatus of claim 12, wherein the instructions to generate the set of internal structure definition tables are executable by the processor to cause the apparatus to:
execute a first shell script of the set of ASP scripts to generate a set of intermediate files indicating the data structural information; and
execute a second table generation script to generate the set of internal structure definition tables using the set of intermediate files.

### Claim 15 (depends on 10)

The apparatus of claim 10, wherein the augmented program binary executable is generated at a build-time associated with the C-language program, and wherein the introspection and data discovery procedure is performed dynamically at a run-time associated with the C-language program.

### Claim 16 (depends on 10)

The apparatus of claim 10, wherein the instructions are further executable by the processor to cause the apparatus to:
perform the introspection and data discovery procedure on the C-language program comprises printing data structures of the C-language program, examining the C-language program, debugging the C-language program, performing trace operations on the C-language program, or any combination thereof.

### Claim 17 (depends on 16)

The apparatus of claim 16, wherein the instructions are further executable by the processor to cause the apparatus to:
perform the introspection and data discovery procedure on the C-language program comprises executing an ASP application programming interface (API), wherein the ASP API supports querying the data structural information of the C-language program, generating a catalog of field descriptions, structure layout, and enumerated type information of the C-language program, or any combination thereof.

### Claim 18 (depends on 10)

The apparatus of claim 10, wherein the instructions are further executable by the processor to cause the apparatus to:
run the set of ASP scripts on the program binary executable comprises running a debugging program to extract structural information compiled in the program binary executable.

### Claim 19

A non-transitory computer-readable medium storing code for data processing, the code comprising instructions executable by a processor to:
run a set of automated structure processing (ASP) scripts on a program binary executable written in C-language;
generate a set of dictionary files indicating data structural information for the program binary executable based at least in part on running the set of ASP scripts on the program binary executable;
combine the data structural information from the set of dictionary files with an ASP library to generate an extended ASP library;
augment the program binary executable with the extended ASP library to generate an augmented program binary executable; and
perform an introspection and data discovery procedure on a C-language program using the augmented program binary executable.

### Claim 20 (depends on 19)

The non-transitory computer-readable medium of claim 19, wherein the instructions to generate the set of dictionary files are executable by the processor to:
identify the data structural information of the program binary executable, wherein the data structural information comprises a list of C-structures referenced, names of fields in the C-structures, definitions of individual fields including data type names and data type definitions, additional data type definitions compiled in the program binary executable, references to nested sub-structures, layouts of bit fields in structured fields, enumerated type definitions including names and enumerated constant values, or any combination thereof.
