Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions dissect/target/tools/qfind.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def main() -> int:
header = f"[{hit.offset:#08x} @ {hit.needle} ({hit.codec})]"

if not NO_COLOR:
header = utils.COLOR_WHITE + header + utils.COLOR_NORMAL
header = utils.COLOR_WHITE_BOLD + header + utils.COLOR_CLEAR_BOLD
Comment thread
JSCU-CNI marked this conversation as resolved.
Outdated

before_offset = max(0, hit.offset - args.window)
needle_len = len(hit.match)
Expand All @@ -101,7 +101,7 @@ def main() -> int:

if args.raw:
palette = (
[(hit.offset - before_offset, utils.COLOR_NORMAL), (needle_len, utils.COLOR_BG_RED)]
[(hit.offset - before_offset, utils.COLOR_CLEAR_BOLD), (needle_len, utils.COLOR_BG_RED)]
if not NO_COLOR
else None
)
Expand All @@ -119,7 +119,7 @@ def main() -> int:
before_part,
(utils.COLOR_BG_RED if not NO_COLOR else ""),
after_part[:needle_len],
(utils.COLOR_NORMAL if not NO_COLOR else ""),
(utils.COLOR_CLEAR_BOLD if not NO_COLOR else ""),
after_part[needle_len:],
)
print("".join(hit))
Expand Down Expand Up @@ -316,13 +316,13 @@ def update(disk: Container | Volume, offset: int, size: int) -> None:
nonlocal current_disk, char

if current_disk is None:
sys.stderr.write(f"{utils.COLOR_WHITE}{target}{utils.COLOR_NORMAL}\n")
sys.stderr.write(f"{utils.COLOR_WHITE_BOLD}{target}{utils.COLOR_CLEAR_BOLD}\n")

if current_disk != disk:
sys.stderr.write(f"\n{utils.COLOR_WHITE}[Current disk: {disk}]{utils.COLOR_NORMAL}\n")
sys.stderr.write(f"\n{utils.COLOR_WHITE_BOLD}[Current disk: {disk}]{utils.COLOR_CLEAR_BOLD}\n")
current_disk = disk

sys.stderr.write(f"\r{COLOR_GREY}{offset / float(size) * 100:0.2f}% {animation[char]}{utils.COLOR_NORMAL}")
sys.stderr.write(f"\r{COLOR_GREY}{offset / float(size) * 100:0.2f}% {animation[char]}{utils.COLOR_CLEAR_BOLD}")
sys.stderr.flush()

if offset % (1337 * 3) == 0:
Expand Down