ivision-research / banjo

Android Dex disassembler and Binary Ninja plugin
MIT License
52 stars 6 forks source link

Control flow wrong for switch statements #15

Open austin-ralls-cs opened 4 years ago

austin-ralls-cs commented 4 years ago

packed-switch and sparse-switch instructions do not have branches set. Methods with these instructions will not have the full control flow graph, and will probably not disassemble completely.


More than two branches can't be added to an InstructionInfo object in get_instruction_info: https://github.com/CarveSystems/banjo/blob/bd07db6c3a8de9b4eff56d381c581909b0ea2b05/architecture.py#L99-L108

According to rss, the right way to do this is to use LLIL_JUMP_TO in LLIL. I couldn't figure out how to do this. My best attempt (does not work):

https://github.com/CarveSystems/banjo/blob/bd07db6c3a8de9b4eff56d381c581909b0ea2b05/architecture.py#L170-L174