diff options
| author | Peter LaFosse <peter@vector35.com> | 2021-11-15 16:28:45 -0500 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2021-11-15 16:28:45 -0500 |
| commit | 18e6ab5fc5f3a87876dd56d77484f03e7db96896 (patch) | |
| tree | 77869cc36c508955b5c333fe86e8123e932bf0bd /PythonAPIDocumentation.md | |
| parent | fb0924a21fcc43f716524d172c7f64249d0e77fd (diff) | |
Fix broken example of using StructureBuilder
Diffstat (limited to 'PythonAPIDocumentation.md')
| -rw-r--r-- | PythonAPIDocumentation.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/PythonAPIDocumentation.md b/PythonAPIDocumentation.md index 1bd8e538..fd1f3a4d 100644 --- a/PythonAPIDocumentation.md +++ b/PythonAPIDocumentation.md @@ -194,14 +194,14 @@ struct Bas As `Type` objects are immutable, the Binary Ninja API provides a pure python implementation of types to provide mutability, these all inherit from `MutableType` and keep the same names as their immutable counterparts minus the `Type` part. Thus `Structure` is the mutable version of `StructureType` and `Enumeration` is the mutable version of `MutableType`. `Type` objects can be converted to `MutableType` objects using the `Type.mutable_copy` API and, `MutableType` objects can be converted to `Type` objects through the `MutableType.immutable_copy` API. Generally speaking you shouldn't need the mutable type variants for anything except creation of structures and enumerations, mutable type variants are provided for convenience and consistency. Building and defining a new structure can be done in a few ways. The first way would be the two step process of creating the structure then defining it. ```python -s = StructureBuilder(members=[(IntegerType.create(4), 'field_0')]) +s = StructureBuilder.create(members=[(IntegerType.create(4), 'field_0')]) bv.define_user_type('Foo', s) ``` A second option for more complicated situations you can opt for incremental initialization of the type: ```python -s = StructureBuilder() +s = StructureBuilder.create() s.packed = True s.append(IntegerType.create(2)) s.append(IntegerType.create(4)) |
