Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibly wrong decompilation of switch statements #256

Open
ceeac opened this issue Nov 11, 2019 · 0 comments
Open

Possibly wrong decompilation of switch statements #256

ceeac opened this issue Nov 11, 2019 · 0 comments
Labels
type: bug (I) Something is not working as intended
Milestone

Comments

@ceeac
Copy link
Member

ceeac commented Nov 11, 2019

Boomerang version:
v0.5.1 (d4d9aea)

Steps to reproduce:

  1. Decompile an executable containing a switch statement that is propagated to

Additional comments:
When decompiling an executable containing a switch statement, the following may happen:

  1. The RTL for the switch statement is created. After conversion to SSA form, the computed jump from the switch statement references statement a.
  2. Statement propagation is applied. The computed jump now contains a reference to statement b.
  3. After switch/case analysis, the switch expression is saved by IFrontEnd::saveDecodedRTL.
  4. The whole CFG is re-created. When re-creating the RTL for the switch statement, the previously-saved RTL referencing statement b is re-loaded. This is a different statement and after propagation the switch expression may be different from before re-decoding, which is incorrect.

The best solution would be to separate disassembly and lifting of instructions and just clearing and re-lifting the IR for each machine instruction after analyzing switch statements and other computed CTIs.

@ceeac ceeac added the type: bug (I) Something is not working as intended label Nov 11, 2019
@ceeac ceeac added this to the v0.6.0 milestone Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug (I) Something is not working as intended
Projects
None yet
Development

No branches or pull requests

1 participant