Skip to content

Lifting causes spurious conditionals #4

@toshipiazza

Description

@toshipiazza

The autogenerated HLIL from this plugin generates lots of spurious code for conditional jumps, to the point where it is distracting. As I understand it, this is done for correctness, since jump targets must be resolved at the end of a packet.

Example code (test_dualjump_cond_jump() in bn_llil_test_app):

00000084  014101f3           { R1 = add(R1,R1)
00000088  06d0005c             if (P0) jump:t data_90 }
0000008c  c03f0048           { R0 = #0x0; jumpr LR }
00000090  c03f1048           { R0 = #0x1; jumpr LR }

Resulting HLIL:

00000084      char temp211 = 0
00000084      if (arg1)
00000084          temp211 = 1
00000090      if (temp211 == 1)
00000090          return 1
0000008c      return 0

I'd expect output more like

00000090      if (arg1)
00000090          return 1
0000008c      return 0

I guess this lifted IL is so situational that it doesn't make sense to ask the binja devs to optimize this particular construct... However it should be straightforward to fix it up manually in simple cases using the new Workflows API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions