Last active
February 3, 2020 15:47
-
-
Save nkaretnikov/a7893dfa0833ac543dc67e82af6ac900 to your computer and use it in GitHub Desktop.
ida_highlight
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
from idaapi import * | |
from idc import * | |
TRACE_FILE = AskFile(0, "*.txt", "Select trace file") | |
if not TRACE_FILE: | |
Warning("Failed to select trace file") | |
else: | |
HIGHLIGHT = AskLong(0, "Choose action: 0 = clear, 1 = highlight") | |
if HIGHLIGHT != 0 and HIGHLIGHT != 1: | |
Warning("Invalid action: {}".format(HIGHLIGHT)) | |
else: | |
color = 0xff0000 if HIGHLIGHT else 0xffffff | |
with open(TRACE_FILE) as lines: | |
for i, line in enumerate(lines): | |
if i == 0: # skip the header | |
continue | |
addr = int(line, 16) | |
idc.SetColor(addr, idc.CIC_ITEM, color) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment