Hex-Rays v1.1 have been releasedWelcome to Hex-Rays v1.1, with floating point support. This release adds a major new feature: floating point support, and numerous other improvements. Please refer to the comparison page for side-by-side examples.
BIG NEWS
+ floating point support
+ better 64-bit arithmetics support (instruction pairs are recognized better)
+ new analysis: live ranges of stack variables; reused slots are detected and properly handled (if not aliased)
+ __usercall with ellipsis is supported
NITPICKY DETAILS
+ slightly modified attachment of block comments. the new method is slightly better but the existing block comments on multiline binary operations may move from one operand to another:
+ decompiler distinguishes alisable and restricted (non-aliasable memory)
+ delphi overflow and range checks are hidden from the output
+ the "reset types" command can reset local or global types
+ slightly more aggressive stkvar elimination; unfortunately we can not eliminate unused stkvars completely in the presence of unknown or guessed function calls - if a function argument list is detected incorrectly, we risk deleting useful code
+ added rule: x=y,x => (x=y) != 0
+ decompiler generates less partial types
+ added parsing of function prototype line
+ local variable declarations are sorted: first are register variables sorted by basic blocks, then stack variables sorted by frame offets
+ added FOR-2 rule to create more for-loops
+ improved handling of 64bit operations
+ improved the decompiler engine to eliminate common subexpressions in some special cases
+ more aggressive cast removal: if the result of add/sub and similar operations is finally truncated, remove truncation casts for operands
+ added COERCE_... helper functions to convert int/float types when regular cast operations are not enough
+ better handling of 64-bit values in vararg arguments
+ better type casts for object references (decompiler was resolving types when it was not really necessary and replacing, e.g. LPSTR by char *)
FIXES
BUGFIX: WHILE-5 rule could duplicate a label and then interr
BUGFIX: tail calls to noreturn function were not marked as such
BUGFIX: right-clicking on the very first { could crash the decompiler
BUGFIX: "create new struct type" could create a type with void fields
BUGFIX: jo/jno instructions could hide some code from the listing
BUGFIX: decompiler would interr on too wide enums (>128bits)
BUGFIX: jo/jno instruction could hide executable code; added special handling for them and for delphi overflow checks
BUGFIX: decompiler could interr trying to create a variable of va_list type
BUGFIX: wrong decompilation output could be generated in some rare cases
BUGFIX: some sign-extension casts were missing
BUGFIX: array[(uchar)i8] could erroneously be represented as array[i8]
BUGFIX: decompiler was considering everything after any // in the output as comments
BUGFIX: rule19 to recognize 64bit multiplications could occasionally create wrong code and interr
BUGFIX: control flow after memset/memcpy could be rendered incorrectly
BUGFIX: decompiler could create a function that returns a value in edx register without returning anything in eax register
BUGFIX: decompiler could crash on some inputs
Hex-Rays v1.1 Comparison PageWelcome to the Hex-Rays Decompiler v1.1 comparison page! Below you will find side-by-side comparisons of Hex-Rays v1.0 and v1.1 outputs. Please maximize the window too see both columns simultaneously.
The following original exhibits are displayed on this page:
NOTE: these are just some selected examples, that can be illustrated as a side-by-side difference. Hex-Rays Decompiler v1.1 includes are many other improvements and new features that are not mentioned on this page - simply because there was nothing to compare them with. The most notable new feature is support of floating point instructions, among other things. Please refer to the news page for more details.
For-loops are easier to read than while- or do-loops. The decompiler prefers to generate for loops now. Again, note the difference in size and readability!
While we still do not recognize all 64-bit idioms (perfections is out of question in binary analysis) we do much better now. Above is just one of many possible examples (v10 on the left and v21 on the right are 64-bit variables),
One could say that this comparison is not fair and we would agree. Previous versions of the decompiler could not handle floating point instruction at all, and the new version knows all about them, including conversion intricacies and other subtle details.
Thanks to the more aggressive propagation algorithm, the output becomes simpler.
New algorithm to detect function arguments
result = sub_100270F(0); if ( result ) { v1 = sub_15F0000();
result = sub_100270F(0); if ( result ) { dword_100A480 = sub_15F0000(byte_1009628, -2147483648, 3, 0, 3, 128, 0);
We switched to a new heuristic algorithm to detect arguments of unknown function calls. While it is not perfect, it loses less arguments and tends to produce more reliable output. Please note that this algorithm is required to determine the types of only unknown calls: once the user specifies the function prototype, it will be used by the decompiler.
Implicit value propagation
result = sub_402EE0(); if ( !result ) { v10 &= result; v6 = v3->pchar4; if ( v3->dword0 <= (unsigned int)result )
result = sub_402EE0(v3); if ( !result ) { v10 = 0; v7 = v3->pchar4; if ( v3->dword0 <= 0u )
The new decompiler can use comparison instructions (and other clues) to determine possible variable values. In the example above, it is clear that the result variable is equal to zero within the if-block. This knowledge allows for more optimizations and makes the code more readable.