Skip to content

Instantly share code, notes, and snippets.

@starfleetcadet75
Created August 1, 2020 14:13
Show Gist options
  • Select an option

  • Save starfleetcadet75/ce6885a511acfffbd0984f6b2e7a811c to your computer and use it in GitHub Desktop.

Select an option

Save starfleetcadet75/ce6885a511acfffbd0984f6b2e7a811c to your computer and use it in GitHub Desktop.
Random Binary Ninja snippets for quick reference.

Adding Undo/Redo to a Script/Plugin

Wrap code inside bv.begin_undo_actions() and bv.commit_undo_actions().

Disassemble from the Python Console

Architecture['x86'].get_instruction_text(bv.read(here, 2), 0)

Transforms

t = transform.Transform['XOR']
t.encode(bv.read(0, bv.end), {'key': 'secret_key'})

Reading ASCII Strings

string = ''
for i in bv.get_ascii_string_at(here).value:
    string += chr(ord(i) ^ 0x3f)
print(string)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment