Skip to content

Removal of branch in HLIL or greater #5907

Discussion options

You must be logged in to vote

It's because the branch to get to those calls is never taken, or well, our analysis is under the assumption it is never taken.

0000072a 134b ldr r3, [pc, #0x4c] {data_778}
0000072c 1b68 ldr r3, [r3] {data_8004000, "ZZZZ"} {0x5a5a5a5a}
0000072e b3f15a3f cmp r3, #0x5a5a5a5a // #0x5a5a5a5a == #0x5a5a5a5a
00000732 0ad0 beq #0x74a {0x1} // always branch

There is two things you can do to fix the dataflow from removing unused code.

  1. enable analysis.keepDeadCodeBranches which should keep that branch from being removed.
  2. Make data_8004000 writable so that the analysis cannot assume its value never changes, and/or patch it to the desired value.

Another thing that can do call removals is pure funct…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by emesare
Comment options

You must be logged in to vote
1 reply
@emesare
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Question Issue is a question, discussion item, or point of clarification
2 participants