binaryninja-api icon indicating copy to clipboard operation
binaryninja-api copied to clipboard

Flatten common nested conditionals

Open plafosse opened this issue 1 year ago • 0 comments

What is the feature you'd like to have?

The following is an example of a common nesting pattern seen in HLIL that can be greatly simplified

if (rax_19 != 0x9000)
    if (rax_19 != 0xa000)
        if (rax_19 == 0xc000)
            goto label_1800098c1
        goto label_180009a6d
    goto label_180009c72
if (rax_19 == 0xc000)
    goto label_1800098c1;
else if (rax_19 != 0xa000)
    goto label_180009a6d;
else if (rax_19 != 0x9000)
    goto label_180009c72;

Address: 0x180009a10 in the internal shared binary: unicorn chess taco rainbow unicorn chess taco rainbow

plafosse avatar May 06 '24 14:05 plafosse