Skip to content

Commit

Permalink
Merge pull request volatilityfoundation#1424 from j-t-1/readability
Browse files Browse the repository at this point in the history
Use generator expressions
  • Loading branch information
ikelos authored Dec 17, 2024
2 parents 16de3fa + ae1079f commit 992ba3e
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion volatility3/cli/volshell/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def _display_data(
connector = " "
if chunk_size < 2:
connector = ""
ascii_data = connector.join([self._ascii_bytes(x) for x in valid_data])
ascii_data = connector.join(self._ascii_bytes(x) for x in valid_data)

print(hex(offset), " ", hex_data, " ", ascii_data)
offset += 16
Expand Down
4 changes: 2 additions & 2 deletions volatility3/framework/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ def require_interface_version(*args) -> None:
if args[1] > interface_version()[1]:
raise RuntimeError(
"Framework interface version {} is an older revision than the required version {}".format(
".".join([str(x) for x in interface_version()[0:2]]),
".".join([str(x) for x in args[0:2]]),
".".join(str(x) for x in interface_version()[0:2]),
".".join(str(x) for x in args[0:2]),
)
)

Expand Down
2 changes: 1 addition & 1 deletion volatility3/framework/configuration/requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ def __init__(
if version is None:
raise TypeError("Version cannot be None")
if description is None:
description = f"Version {'.'.join([str(x) for x in version])} dependency on {component.__module__}.{component.__name__} unmet"
description = f"Version {'.'.join(str(x) for x in version)} dependency on {component.__module__}.{component.__name__} unmet"
super().__init__(
name=name, description=description, default=default, optional=optional
)
Expand Down
2 changes: 1 addition & 1 deletion volatility3/framework/constants/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
VERSION_SUFFIX = ""

PACKAGE_VERSION = (
".".join([str(x) for x in [VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH]])
".".join(str(x) for x in [VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH])
+ VERSION_SUFFIX
)
"""The canonical version of the volatility3 package"""
2 changes: 1 addition & 1 deletion volatility3/framework/plugins/linux/check_creds.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def _generator(self):

for cred_addr, pids in creds.items():
if len(pids) > 1:
pid_str = ", ".join([str(pid) for pid in pids])
pid_str = ", ".join(str(pid) for pid in pids)

fields = [
format_hints.Hex(cred_addr),
Expand Down
2 changes: 1 addition & 1 deletion volatility3/framework/plugins/windows/getservicesids.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def createservicesid(svc) -> str:
## The use of struct here is OK. It doesn't make much sense
## to leverage obj.Object inside this loop.
dec.append(struct.unpack("<I", sha[i * 4 : i * 4 + 4])[0])
return "S-1-5-80-" + "-".join([str(n) for n in dec])
return "S-1-5-80-" + "-".join(str(n) for n in dec)


class GetServiceSIDs(interfaces.plugins.PluginInterface):
Expand Down

0 comments on commit 992ba3e

Please sign in to comment.