mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-13 21:27:39 +02:00
Enable string encoding and emphasize that max_length applies to bytes in memory not to number of characters in the string.
This commit is contained in:
@@ -111,7 +111,8 @@ class Bytes(PrimitiveObject, bytes):
|
||||
class String(PrimitiveObject, str):
|
||||
"""Primitive Object that handles string values
|
||||
|
||||
length: specifies the maximum possible length that the string could hold in memory
|
||||
length: specifies the maximum possible length that the string could hold within memory
|
||||
(note: for multibyte characters, this will not be the maximum length of the string)
|
||||
"""
|
||||
_struct_type = str
|
||||
|
||||
@@ -142,7 +143,7 @@ class String(PrimitiveObject, str):
|
||||
**params)
|
||||
if value.find('\x00') >= 0:
|
||||
value = value[:value.find('\x00')]
|
||||
return value
|
||||
return str(value, encoding = encoding, errors = errors)
|
||||
|
||||
|
||||
class Pointer(Integer):
|
||||
|
||||
Reference in New Issue
Block a user