Igor’s tip of the week #100: Collapsing pseudocode parts

When working with big functions in the decompiler, it may be useful to temporarily hide some parts of the pseudocode to analyze the rest. While currently it’s not possible to hide arbitrary lines like in disassembly, you can hide specific sections of it.   Collapsing local variable declarations While the local variable declarations are useful to see […]

Igor’s tip of the week #87: Function chunks and the decompiler

We’ve covered function chunks last week and today we’ll show an example of how to use them in practice to handle a common compiler optimization.   Shared function tail optimization When working with some ARM firmware, you may sometimes run into the following situation: We have decompilation of sub_8098C which ends with a strange JUMPOUT statement and if […]

Igor’s tip of the week #83: Decompiler options: default radix

We’ve covered the major pseudocode formatting options previously but there is one more option which can influence the output. It is the radix used for printing numbers in the pseudocode. In a positional numeral system, the radix or base is the number of unique digits, including the digit zero, used to represent numbers. For example, for […]

Igor’s tip of the week #82: Decompiler options: pseudocode formatting

The default output of the Hex-Rays decompiler tries to strike a balance between conciseness and readability. However, everyone has different preferences so it offers a few options to control the layout and formatting of the pseudocode. Accessing the options Because of its origins as a third-party plugin for IDA, the decompiler options are accessible not through IDA’s […]

Igor’s tip of the week #79: Handling variable reuse

Previously we’ve discussed how to reduce the number of variables used in pseudocode by mapping copies of a variable to one. However, sometimes you may run into an opposite problem:  a single variable can be used for different purposes. Reused stack slots One common situation is when the compiler reuses a stack location of either a […]

Igor’s tip of the week #77: Mapped variables

Quick rename can be useful when you have code which copies data around so the variable names stay the same or similar. However, sometimes there is a way to get rid of duplicate variables altogether. Reasons for duplicate variables Even if in the source code a specific variable may appear only once, on the machine code […]

Igor’s tip of the week #76: Quick rename

One of the features added in IDA 7.6 was automatic renaming of variables in the decompiler.  Unlike PIT, it is not limited to stack variables but also handles variables stored in registers and not just calls but also assignments and some other expressions. It also tries to interpret function names which include a verb […]