Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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 + header + utils.COLOR_CLEAR_BOLD

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
header = utils.COLOR_WHITE + header + utils.COLOR_CLEAR_BOLD
header = utils.COLOR_WHITE + header + utils.COLOR_CLEAR

Maybe just use this one, as it's not personally clear to me why the _BOLD variant should be used. I actually remove the BOLD variant in this PR: fox-it/dissect.cstruct#156

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used the _BOLD variant as it had the same value as COLOR_NORMAL, so it just maintained what was there before. I have no issue changing it to COLOR_CLEAR, shall I just change everything immediately so we don't have a similar issue when that pr gets merged?


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}{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}[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
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ classifiers = [
]
dependencies = [
"defusedxml",
"dissect.cstruct>=4,<5",
"dissect.cstruct>=4.8.dev7,<5",
"dissect.database>=1.1,<2",
"dissect.eventlog>=3,<4",
"dissect.evidence>=3.13,<4",
Expand Down Expand Up @@ -83,7 +83,7 @@ dev = [
"dissect.cim[dev]>=3.0.dev,<4.0.dev",
"dissect.clfs[dev]>=1.0.dev,<2.0.dev",
"dissect.cramfs[dev]>=1.0.dev,<2.0.dev",
"dissect.cstruct>=4.0.dev,<5.0.dev",
"dissect.cstruct>=4.8.dev7,<5.0.dev",
"dissect.database[dev]>=1.1,<2.0.dev",
"dissect.etl[dev]>=3.0.dev,<4.0.dev",
"dissect.eventlog[dev]>=3.0.dev,<4.0.dev",
Expand Down
Loading