Expand description

The resymgen YAML format and associated APIs to integrate with other data formats.

SymGen represents an entire resymgen YAML file. Through this type and its methods, resymgen files can be read from files, manipulated in various ways, and written to files.

A resymgen YAML file consists of one or more named Blocks. Each Block is tagged with some metadata, and contains two lists of Symbols, one for functions and one for data. A Symbol represents one or more memory regions containing an identifiable chunk of instructions or data.

Optionally, each Block can also contain a list of Subregions. A Subregion represents a nested SymGen, which has one or more of its own named Blocks, that is contained within the parent Block. In a resymgen YAML file, a Subregion is represented as a file name. If the resymgen YAML file has the file path /path/to/parent.yml, and one of its blocks has a subregion with the name sub.yml, then this subregion name references a corresponding subregion file (which is itself a resymgen YAML file) with the file path /path/to/parent/sub.yml.

Example

main:
  versions:
    - v1
    - v2
  address:
    v1: 0x2000000
    v2: 0x2010000
  length:
    v1: 0x100000
    v2: 0x100000
  description: The main memory region
  subregions:
    - sub1.yml
    - sub2.yml
  functions:
    - name: function1
      address:
        v1: 0x2001000
        v2: 0x2012000
      description: |-
        multi
        line
        description
    - name: function2
      address:
        v1:
          - 0x2002000
          - 0x2003000
        v2: 0x2013000
      description: simple description
  data:
    - name: SOME_DATA
      address:
        v1: 0x2000000
        v2: 0x2010000
      length:
        v1: 0x1000
        v2: 0x1600
other:
  address: 0x2400000
  length: 0x100000
  functions: []
  data:
    - name: OTHER_DATA
      address: 0x2400000

Modules

Utilities for symbol and block bounds checking.
Cursors for convenient immutable access to SymGens and Blocks with recursive subregions.

Structs

A Symbol tagged with metadata to be added into a SymGen.
A contiguous block of Symbols in a resymgen symbol table, with some metadata.
A cursor into a Block that allows traversal into nested subregions and blocks while keeping track of associated block names and nested file paths.
Parameters to control how data in a foreign format is merged into a SymGen.
A serializable string whose sorting order can be controlled dynamically by assigning it an ordinal at runtime.
A concrete realization of a Symbol for some Version (which can be None).
Wraps an Iterator over Symbols to yield a stream of RealizedSymbols.
A subsidiary SymGen (a collection of named Blocks) nested within a parent Block.
A programmatic representation of the resymgen YAML format.
A cursor into a SymGen that allows traversal into nested blocks and subregions while keeping track of associated nested file paths.
A symbol in a resymgen symbol table, with some metadata.
A list of Symbols.
A version of a binary.
A version-dependent piece of data, which can have potentially different values for different Versions.

Enums

Error encountered while processing a SymGen.
Specifies how integers should be formatted during serialization.
A single scalar value or a collection of multiple values.
A possibly version-dependent piece of data, which can either be a single scalar value common to all relevant versions, or an explicit VersionDep<T>.
Error encountered while merging into a SymGen.
Error encountered when resolving a Subregion.
Types of symbols within a SymGen.

Traits

Generate implementers can convert a SymGen into a different data format.
Load implementers can read the contents of a Read type and produce a stream of AddSymbols, which are used for merging foreign formats into a SymGen.
Implementers of Realize can produce iterators over RealizedSymbols for arbitrary Versions.
Types that can be sorted.

Type Definitions

Map from Strings to sort indexes.
Result from processing a SymGen.
Unsigned integer type for addresses and lengths. This should be at least as large as the system register size of the binary being reverse engineered.