I have the following struct
TEST_STRUCT = construct.Struct(
u'item_data_struct',
construct.ULInt32(u'string_length'),
construct.Bytes(u'unknown', 4),
construct.String(name, ?????)
)
Returns:
Container:
string_length = 12
unknown = '\x01\x01\x00\x00'
So the string is 12 bytes. I want to be able to assign this value to the next set of N bytes within my struct.
Basically I want it to be...
TEST_STRUCT = construct.Struct(
u'item_data_struct',
construct.ULInt32(u'string_length'),
construct.Bytes(u'unknown', 4),
construct.String(u'string', construct.ULInt32(u'string_length')) # Which in this example would be 12.
)