diff options
| author | Jordan Wiens <jordan@psifertex.com> | 2023-10-08 16:39:30 -0400 |
|---|---|---|
| committer | Jordan Wiens <jordan@psifertex.com> | 2023-10-08 16:39:30 -0400 |
| commit | 54edac7e24c4d224067d67a9cccf28011cd20136 (patch) | |
| tree | c7e6b74206a808ef2c2342d1c952948de1989481 /docs | |
| parent | 1d1ed09a3c0b2aec01da9271ab30a59be04f5c44 (diff) | |
remove duplicate type view docs
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/guide/type.md | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/docs/guide/type.md b/docs/guide/type.md index 7fb9e2bb..89a4d13d 100644 --- a/docs/guide/type.md +++ b/docs/guide/type.md @@ -191,88 +191,6 @@ In linear view, if the selection is a single byte outside any function, it will This also works within data variables with structure type. For example, if the selection is a range of bytes within a structure, a new structure will be created within the existing structure. -### Types View - -To see all types in a Binary View, use the types view. It can be accessed from the menu `View > Types`. Alternatively, you can access it with the `t` hotkey from most other views, or using `[CMD/CTRL] p` to access the command-palette and typing "types". This is the most common interface for creating structures, unions and types using C-style syntax. - -For many built-in file formats you'll notice that common headers are already enumerated in the types view. These headers are applied when viewing the binary in [linear view](./#linear-view) and will show the parsed binary data into that structure or type making them particularly useful for binary parsing even of non-executable file formats. - - - -#### Shortcuts and Attributes - -From within the Types view, you can use the following hotkeys to create new types, structures, or unions. Alternatively, you can use the right-click menu to access these options and more. - - - -* `s` - Create new structure -* `i` - Create new type -* `[SHIFT] s` - Creating a new union -* `1`, `2`, `4`, `8`: The number hotkeys will create a create an integer of the specified size. This additionally works on selections. -* `d`: If you want to cycle through the different integer sizes, repeatedly pressing `d` has the same effect as pressing the numbers in order. -* `-`: To quickly toggle integers between signed and unsigned integers, you can use the `-` hotkey. - - -The shortcuts for editing existing elements are: - -* `y` - Edit type / field -* `n` - Rename type / field -* `l` - Set structure size -* `u` - undefine field - -Structs support the attribute `__packed` to indicate that there is no padding. Additionally, function prototypes support the following keywords to indicate their calling convention or other features: - -``` text -__cdecl -__stdcall -__fastcall -__convention -__noreturn -``` - -To use the `__convention` keyword, pass in the convention name as a parameter argument: - -``` -__convention("customconvention") -``` - - -#### Structure Access Annotations - -Types view now annotates code references to structure offsets. It uses the same convention as in the graph/linear view. For example, the `__offset(0x8).q` token means the code references the offset 0x8 of this structure, and the size of the access is a qword. This will make it easier to see which offsets of a structure are being used, and aid in the process of creating structure members. - - - - -#### Applying Structures and Types - - - -Once you've created your structures, you can apply them to your disassembly. Simply select an appropriate token (variable or memory address), and press `y` to bring up the change type dialog. Types can be applied on both disassembly and all levels of IL. Any variables that are shared between the ILs will be updated as types are applied. - - -#### Examples - -``` C -enum _flags -{ - F_X = 0x1, - F_W = 0x2, - F_R = 0x4 -}; -``` - -``` C -struct Header __packed -{ - char *name; - uint32_t version; - void (* callback)(); - uint16_t size; - enum _flags flags; -}; -``` - ### Import BNDB File The Import BNDB File feature imports types from a previous BNDB into your currently open file. In addition, it will apply types for matching symbols in functions and variables. Import BNDB *will not* port symbols from a BNDB with symbols to one without -- the names must already match. Matching functions and porting symbols is beyond the scope of this feature. |
