mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-13 13:17:38 +02:00
fourcc code converter helper
This commit is contained in:
@@ -483,6 +483,22 @@ class LinuxUtilities(interfaces.configuration.VersionableInterface):
|
||||
|
||||
return kernel
|
||||
|
||||
@classmethod
|
||||
def convert_fourcc_code(cls, code: int) -> str:
|
||||
"""Convert a fourcc integer back to its fourcc string representation.
|
||||
|
||||
Args:
|
||||
code: the numerical representation of the fourcc
|
||||
|
||||
Returns:
|
||||
The fourcc code string.
|
||||
"""
|
||||
|
||||
code_bytes_length = (code.bit_length() + 7) // 8
|
||||
return "".join(
|
||||
[chr((code >> (i * 8)) & 0xFF) for i in range(code_bytes_length)]
|
||||
)
|
||||
|
||||
|
||||
class IDStorage(ABC):
|
||||
"""Abstraction to support both XArray and RadixTree"""
|
||||
|
||||
Reference in New Issue
Block a user