From f75c320ceb350106b018a277bf65b3f58c02d6df Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Wed, 24 Feb 2021 16:17:01 -0500 Subject: Document HLIL scoping options and dead store elimination --- docs/getting-started.md | 26 ++++++++++++++++++++++++++ docs/img/dead-store-after.png | Bin 0 -> 27977 bytes docs/img/dead-store-example.png | Bin 0 -> 35415 bytes docs/img/dead-store-menu.png | Bin 0 -> 166633 bytes docs/img/hlil-braces.png | Bin 0 -> 303084 bytes docs/img/hlil-scope.png | Bin 0 -> 25489 bytes 6 files changed, 26 insertions(+) create mode 100644 docs/img/dead-store-after.png create mode 100644 docs/img/dead-store-example.png create mode 100644 docs/img/dead-store-menu.png create mode 100644 docs/img/hlil-braces.png create mode 100644 docs/img/hlil-scope.png (limited to 'docs') diff --git a/docs/getting-started.md b/docs/getting-started.md index 9dcb4d9b..b039c943 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -338,6 +338,32 @@ The function list also highlights imports, and functions identified with symbols - When main view is linear, Mini Graph renders the Reflection View +### High Level IL + +Binary Ninja features a decompiler that produces High Level IL (HLIL) as output. HLIL is not intended to be a representation of the code in C, but some users prefer to have a more C-like scoping style. + +You can control the way HLIL appears in the settings. + +![HLIL Scoping Options >](img/hlil-scope.png "HLIL Scoping Options") + +The different options are shown below: + +![HLIL Scoping Display >](img/hlil-braces.png "HLIL Scoping Display") + +### Dead Store Elimination + +Binary Ninja tries to be convervative with eliminating unused variables on the stack. When the analysis finds a variable that cannot be eliminated but does not appear to be used, the assignment will appear grayed out in the decompiler output. The first two lines of the function below show this: + +![Dead Stores >](img/dead-store-example.png "Dead Stores") + +In this case, these variables are actually unused and can be eliminated. You can tell Binary Ninja to do this by right clicking on the variable and choosing "Allow" from the "Dead Store Elimination" submenu. + +![Dead Store Elimination Menu >](img/dead-store-menu.png "Dead Store Elimination Menu") + +Performing this action on both variables in the example results in the following output: + +![Dead Store Elimination Results >](img/dead-store-after.png "Dead Store Elimination Results") + ### Script (Python) Console The integrated script console is useful for small scripts that aren't worth writing as full plugins. diff --git a/docs/img/dead-store-after.png b/docs/img/dead-store-after.png new file mode 100644 index 00000000..24047d08 Binary files /dev/null and b/docs/img/dead-store-after.png differ diff --git a/docs/img/dead-store-example.png b/docs/img/dead-store-example.png new file mode 100644 index 00000000..2f5a5159 Binary files /dev/null and b/docs/img/dead-store-example.png differ diff --git a/docs/img/dead-store-menu.png b/docs/img/dead-store-menu.png new file mode 100644 index 00000000..71a1a48c Binary files /dev/null and b/docs/img/dead-store-menu.png differ diff --git a/docs/img/hlil-braces.png b/docs/img/hlil-braces.png new file mode 100644 index 00000000..74fbaaca Binary files /dev/null and b/docs/img/hlil-braces.png differ diff --git a/docs/img/hlil-scope.png b/docs/img/hlil-scope.png new file mode 100644 index 00000000..d16393a1 Binary files /dev/null and b/docs/img/hlil-scope.png differ -- cgit v1.3.1