GeezerVison is showing api.binary.ninja — typeprinter module — Binary Ninja API Documentation v6.0.10905
typeprinter module¶
CoreTypePrinter¶
-
class CoreTypePrinter[source]¶
Bases: TypePrinter
-
get_type_lines(type: Type, container: TypeContainer, name: Iterable[str | bytes] | str | QualifiedName, padding_cols=64, collapsed=False, escaping: TokenEscapingType = TokenEscapingType.BackticksTokenEscapingType) → List[TypeDefinitionLine][source]¶
Generate a multi-line representation of a type
- Parameters:
type (Type) – Type to print
container (TypeContainer) – Type Container containing the type and dependencies
name (Iterable[str | bytes] | str | QualifiedName) – Name of the type
padding_cols – Maximum number of bytes represented by each padding line
collapsed – Whether to collapse structure/enum blocks
escaping (TokenEscapingType) – Style of escaping literals which may not be parsable
- Returns:
List of type definition lines
- Return type:
List[TypeDefinitionLine]
-
get_type_string(type: Type, platform: Platform | None = None, name: Iterable[str | bytes] | str | QualifiedName = '', escaping: TokenEscapingType = TokenEscapingType.BackticksTokenEscapingType) → str[source]¶
Generate a single-line text representation of a type
- Parameters:
-
- Returns:
String representing the type
- Return type:
str
-
get_type_string_after_name(type: Type, platform: Platform | None = None, escaping: TokenEscapingType = TokenEscapingType.BackticksTokenEscapingType) → str[source]¶
In a single-line text representation of a type, generate the string that should
be printed after the type’s name.
- Parameters:
type (Type) – Type to print
platform (Platform | None) – Platform responsible for this type
escaping (TokenEscapingType) – Style of escaping literals which may not be parsable
- Returns:
String representing the type
- Return type:
str
-
get_type_string_before_name(type: Type, platform: Platform | None = None, escaping: TokenEscapingType = TokenEscapingType.BackticksTokenEscapingType) → str[source]¶
In a single-line text representation of a type, generate the string that should
be printed before the type’s name.
- Parameters:
type (Type) – Type to print
platform (Platform | None) – Platform responsible for this type
escaping (TokenEscapingType) – Style of escaping literals which may not be parsable
- Returns:
String representing the type
- Return type:
str
-
get_type_tokens(type: Type, platform: Platform | None = None, name: Iterable[str | bytes] | str | QualifiedName = '', base_confidence: int = 255, escaping: TokenEscapingType = TokenEscapingType.BackticksTokenEscapingType) → List[InstructionTextToken][source]¶
Generate a single-line text representation of a type
- Parameters:
type (Type) – Type to print
platform (Platform | None) – Platform responsible for this type
name (Iterable[str | bytes] | str | QualifiedName) – Name of the type
base_confidence (int) – Confidence to use for tokens created for this type
escaping (TokenEscapingType) – Style of escaping literals which may not be parsable
- Returns:
List of text tokens representing the type
- Return type:
List[InstructionTextToken]
-
get_type_tokens_after_name(type: Type, platform: Platform | None = None, base_confidence: int = 255, parent_type: Type | None = None, escaping: TokenEscapingType = TokenEscapingType.BackticksTokenEscapingType) → List[InstructionTextToken][source]¶
In a single-line text representation of a type, generate the tokens that should
be printed after the type’s name.
- Parameters:
type (Type) – Type to print
platform (Platform | None) – Platform responsible for this type
base_confidence (int) – Confidence to use for tokens created for this type
parent_type (Type | None) – Type of the parent of this type, or None
escaping (TokenEscapingType) – Style of escaping literals which may not be parsable
- Returns:
List of text tokens representing the type
- Return type:
List[InstructionTextToken]
-
get_type_tokens_before_name(type: Type, platform: Platform | None = None, base_confidence: int = 255, parent_type: Type | None = None, escaping: TokenEscapingType = TokenEscapingType.BackticksTokenEscapingType) → List[InstructionTextToken][source]¶
In a single-line text representation of a type, generate the tokens that should
be printed before the type’s name.
- Parameters:
type (Type) – Type to print
platform (Platform | None) – Platform responsible for this type
base_confidence (int) – Confidence to use for tokens created for this type
parent_type (Type | None) – Type of the parent of this type, or None
escaping (TokenEscapingType) – Style of escaping literals which may not be parsable
- Returns:
List of text tokens representing the type
- Return type:
List[InstructionTextToken]
-
print_all_types(types_: Sequence[Tuple[Iterable[str | bytes] | str | QualifiedName, Type]], data: BinaryView, padding_cols=64, escaping: TokenEscapingType = TokenEscapingType.BackticksTokenEscapingType) → str[source]¶
Print all types to a single big string, including headers, sections, etc
- Parameters:
-
- Returns:
All the types in a string
- Return type:
str
TypePrinter¶
-
class TypePrinter[source]¶
Bases: object
Class for turning Type objects into strings and tokens.
-
__init__(handle=None)[source]¶
-
abstract get_type_lines(type: Type, container: TypeContainer, name: Iterable[str | bytes] | str | QualifiedName, padding_cols=64, collapsed=False, escaping: TokenEscapingType = TokenEscapingType.BackticksTokenEscapingType) → List[TypeDefinitionLine][source]¶
Generate a multi-line representation of a type
- Parameters:
type (Type) – Type to print
container (TypeContainer) – Type Container containing the type and dependencies
name (Iterable[str | bytes] | str | QualifiedName) – Name of the type
padding_cols – Maximum number of bytes represented by each padding line
collapsed – Whether to collapse structure/enum blocks
escaping (TokenEscapingType) – Style of escaping literals which may not be parsable
- Returns:
List of type definition lines
- Return type:
List[TypeDefinitionLine]
-
get_type_string(type: Type, platform: Platform | None = None, name: Iterable[str | bytes] | str | QualifiedName = '', escaping: TokenEscapingType = TokenEscapingType.BackticksTokenEscapingType) → str[source]¶
Generate a single-line text representation of a type
- Parameters:
-
- Returns:
String representing the type
- Return type:
str
-
get_type_string_after_name(type: Type, platform: Platform | None = None, escaping: TokenEscapingType = TokenEscapingType.BackticksTokenEscapingType) → str[source]¶
In a single-line text representation of a type, generate the string that should
be printed after the type’s name.
- Parameters:
type (Type) – Type to print
platform (Platform | None) – Platform responsible for this type
escaping (TokenEscapingType) – Style of escaping literals which may not be parsable
- Returns:
String representing the type
- Return type:
str
-
get_type_string_before_name(type: Type, platform: Platform | None = None, escaping: TokenEscapingType = TokenEscapingType.BackticksTokenEscapingType) → str[source]¶
In a single-line text representation of a type, generate the string that should
be printed before the type’s name.
- Parameters:
type (Type) – Type to print
platform (Platform | None) – Platform responsible for this type
escaping (TokenEscapingType) – Style of escaping literals which may not be parsable
- Returns:
String representing the type
- Return type:
str
-
get_type_tokens(type: Type, platform: Platform | None = None, name: Iterable[str | bytes] | str | QualifiedName = '', base_confidence: int = 255, escaping: TokenEscapingType = TokenEscapingType.BackticksTokenEscapingType) → List[InstructionTextToken][source]¶
Generate a single-line text representation of a type
- Parameters:
type (Type) – Type to print
platform (Platform | None) – Platform responsible for this type
name (Iterable[str | bytes] | str | QualifiedName) – Name of the type
base_confidence (int) – Confidence to use for tokens created for this type
escaping (TokenEscapingType) – Style of escaping literals which may not be parsable
- Returns:
List of text tokens representing the type
- Return type:
List[InstructionTextToken]
-
abstract get_type_tokens_after_name(type: Type, platform: Platform | None = None, base_confidence: int = 255, parent_type: Type | None = None, escaping: TokenEscapingType = TokenEscapingType.BackticksTokenEscapingType) → List[InstructionTextToken][source]¶
In a single-line text representation of a type, generate the tokens that should
be printed after the type’s name.
- Parameters:
type (Type) – Type to print
platform (Platform | None) – Platform responsible for this type
base_confidence (int) – Confidence to use for tokens created for this type
parent_type (Type | None) – Type of the parent of this type, or None
escaping (TokenEscapingType) – Style of escaping literals which may not be parsable
- Returns:
List of text tokens representing the type
- Return type:
List[InstructionTextToken]
-
abstract get_type_tokens_before_name(type: Type, platform: Platform | None = None, base_confidence: int = 255, parent_type: Type | None = None, escaping: TokenEscapingType = TokenEscapingType.BackticksTokenEscapingType) → List[InstructionTextToken][source]¶
In a single-line text representation of a type, generate the tokens that should
be printed before the type’s name.
- Parameters:
type (Type) – Type to print
platform (Platform | None) – Platform responsible for this type
base_confidence (int) – Confidence to use for tokens created for this type
parent_type (Type | None) – Type of the parent of this type, or None
escaping (TokenEscapingType) – Style of escaping literals which may not be parsable
- Returns:
List of text tokens representing the type
- Return type:
List[InstructionTextToken]
-
print_all_types(types: Sequence[Tuple[Iterable[str | bytes] | str | QualifiedName, Type]], data: BinaryView, padding_cols=64, escaping: TokenEscapingType = TokenEscapingType.BackticksTokenEscapingType) → str[source]¶
Print all types to a single big string, including headers, sections, etc
- Parameters:
-
- Returns:
All the types in a string
- Return type:
str
-
register()[source]¶
-
name = None¶
|