From 18e6ab5fc5f3a87876dd56d77484f03e7db96896 Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Mon, 15 Nov 2021 16:28:45 -0500 Subject: Fix broken example of using StructureBuilder --- PythonAPIDocumentation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'PythonAPIDocumentation.md') 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)) -- cgit v1.3.1