From 14905bd51979f4f55dfe3e0b299d9a33d9343ef6 Mon Sep 17 00:00:00 2001 From: Jon Palmisciano Date: Thu, 26 May 2022 16:01:06 -0400 Subject: Fix broken CSS/JS in documentation + misc. fixes and cleanup --- docs/guide/type.md | 109 ++++++++++------------------------------------------- 1 file changed, 19 insertions(+), 90 deletions(-) (limited to 'docs/guide') diff --git a/docs/guide/type.md b/docs/guide/type.md index cacc6060..839970b8 100644 --- a/docs/guide/type.md +++ b/docs/guide/type.md @@ -30,94 +30,23 @@ The simplest way to directly manipulate types in disassembly is by viewing an ex New to [stable version 1.3.2015](https://binary.ninja/changelog/) is the "Smart Structures" feature. Rather than manually create a type in the type view and then apply it to disassembly, you can create structures directly from disassembly using the `s` hotkey. Consider the following example (created using [taped](binaryninja:http://captf.com/2011/gits/taped) from the 2011 Ghost in the Shellcode CTF if you'd like to play along at home): -
-
    -
  1. Assembly view of the start of 0x8048e20
  2. -
  3. MLIL view of the same basic block
  4. -
  5. MLIL view after selecting the return of calloc and pressing s
  6. -
  7. MLIL view after selecting the offset and pressing s to turn it into a member access
  8. -
  9. MLIL view after selecting the remaining offsets and pressing s in turn
  10. -
  11. Viewing the structure automatically created after this workflow
  12. -
  13. Selecting the remaining bytes and turning them into an array using 1 to turn them all into uint_8 variables, and then * to turn them all into an array
  14. -
-
-
    -
  • - Structure Workflow 1 -
  • -
  • - Structure Workflow 2 -
  • -
  • - Structure Workflow 3 -
  • -
  • - Structure Workflow 4 -
  • -
  • - Structure Workflow 5 -
  • -
  • - Structure Workflow 6 -
  • -
  • - Structure Workflow 7 -
  • -
-
-
- -_hover over the image to temporarily pause_ - - - +| Step | Preview | +|------|--------| +| Assembly view of the start of 0x8048e20 | Structure Workflow 1 | +| MLIL view of the same basic block | Structure Workflow 2 | +| MLIL view after selecting the return of calloc and pressing s | Structure Workflow 3 | +| MLIL view after selecting the offset and pressing s to turn it into a member access | Structure Workflow 4 | +| MLIL view after selecting the remaining offsets and pressing s in turn | Structure Workflow 5 | +| Viewing the structure automatically created after this workflow | Structure Workflow 6 | +| Selecting the remaining bytes and turning them into an array using 1 to turn them all into uint_8 variables, and then * to turn them all into an array | Structure Workflow 7 | + + Note that the last step is entirely optional. Now that we've created a basic structure, and if we happen to do some reverse engineering on these binaries, we learn that this is actually a linked list and that the structures should look like: @@ -646,7 +575,7 @@ typelib.write_to_file('test.so.1.bntl') ### Other Type Library Questions -#### What's a named type vs. just a type? +#### What's a named type vs. just a type? Some variable definitions have type information, but don't produce a type name useful for future definitions, examples: @@ -798,7 +727,7 @@ Type class=Structure ``` Here is the representation of `type int ()(int, int)` named `MyFunctionType` from [typelib_create.py](https://github.com/Vector35/binaryninja-api/blob/dev/python/examples/typelib_create.py): -#### When do named objects get used? +#### When do named objects get used? When a binary is loaded and its external symbols is processed, the symbol names are searched against the named objects from type libraries. If there is a match, it obeys the type from the type library. Upon success, you'll see a message like: -- cgit v1.3.1