Created
September 4, 2019 21:52
-
-
Save psifertex/600094f554ccb90869f0234fa01e3135 to your computer and use it in GitHub Desktop.
inline string annotator for binary ninja
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
annotation="" | |
for instruction in current_basic_block.get_disassembly_text(): | |
if instruction.address >= current_selection[0] and instruction.address < current_selection[1]: | |
address = instruction.address | |
value = instruction.tokens[-1].value | |
operand = instruction.tokens[-1].operand | |
type = IntegerDisplayType.CharacterConstantDisplayType | |
current_function.set_int_display_type(address, value, operand, type) | |
annotation += chr(instruction.tokens[-1].value) | |
log_info("Adding comment for string: %s" % annotation) | |
current_function.set_comment_at(current_selection[0], annotation) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment