bliutech / mbased

MIT IEEE URTC 2024. GSET 2024. Repository for the "MBASED: Practical Simplifications of Mixed Boolean-Arithmetic Obfuscation". A Binary Ninja decompiler plugin taking ideas from compiler construction to simplify obfuscated boolean expressions.
https://github.com/bliutech/mbased/blob/main/.github/paper.pdf
MIT License
6 stars 0 forks source link

Binary Ninja: Register Plugin #8

Closed bliutech closed 3 months ago

bliutech commented 3 months ago

The main actions from the plugin drive from registering a PluginCommand which can be called by the user similar to the example provided in Vector35/OpaquePredicatePatcher. This task involves writing code inside __init__.py which will be the main thread driving the rest of the analysis of our plugin. To start of, we want this initial plugin to be very simple as other members of the group work on developing the other components of the plugin. While mixed boolean-arithmetic can appear in many places within lifted code, for now, we will make an assumption that much of our analysis will be conducted on conditional branches within Medium Level Intermediate Language (MLIL) for Binary Ninja Intermediate Language (BNIL). The plugin should only log all of the MILI_IF instructions to the Binary Ninja log. An example of how to do this is shown in the code snippet below. You can run it by copying and pasting the code snippet into the Binary Ninja Python console.

for instr in bv.mlil_instructions:
    if instr.operation == MediumLevelILOperation.MLIL_IF:
        log_info(instr)

Action Items

Do all of the following inside __init__.py.

Resources