-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
via: vivisect/dissect#1
i had used the following function to cast the bytes from one vstruct to another:
def cast_vstruct(src_instance, dst_instance):
'''
load the bytes that back `src_instance` into `dst_instance`.
note that subsequent changes made to `dst_instance` are not reflected in `src_instance`.
so this is useful in 'by-value' situations, but not for situations expecting writeback support.
modifies `dst_instance`. does not modify src_instance.
type src_instance: v_types.VStruct
type dst_instance: v_types.VStruct
'''
d = src_instance.vsEmit()
dst_instance.vsParse(d)
a vsCast method on vstruct might enable the passing of the fd/bytes and offset to the destination object, and therefore:
- be higher performant, since the serialization/deserialization is avoided.
- support writeback on the destination instance (though this may result in sync issues)
Metadata
Metadata
Assignees
Labels
No labels