Created
April 20, 2021 21:36
-
-
Save idiom/74114d745d6c427333ac237f91eee414 to your computer and use it in GitHub Desktop.
Add bookmark in Ida and optionally check if it is a duplicate
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
def add_bookmark(offset, comment, check_duplicate=True): | |
""" | |
:param offset: | |
:param comment: | |
:param check_duplicate: | |
:return: | |
""" | |
for bslot in range(0, 1024, 1): | |
slotval = idc.get_bookmark(bslot) | |
if check_duplicate: | |
if slotval == offset: | |
break | |
if slotval == 0xffffffffffffffff: | |
idc.put_bookmark(offset, 0, 0, 0, bslot, comment) | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment