class ScriptNamesV4(mrc.Block): # used to store the names of functions invoked with CALL_EXTERNAL unk1 = mrc.UInt16_BE(0x00) unk2 = mrc.UInt16_BE(0x02) unk3 = mrc.UInt16_BE(0x04) unk4 = mrc.UInt16_BE(0x06) length_1 = mrc.UInt16_BE(0x08) unk5 = mrc.UInt16_BE(0x0a) length_2 = mrc.UInt16_BE(0x0c) unk6 = mrc.UInt16_BE(0x0e) offset = mrc.UInt16_BE(0x10) count = mrc.UInt16_BE(0x12) names = mrc.StringField(mrc.Ref('offset'), count=mrc.Ref('count'), length_field=mrc.UInt8, encoding='latin1')
class Test( mrc.Block ): field = mrc.StringField( 0x00, transform=TestTransform() )
class Test( mrc.Block ): field = mrc.StringField( stream=True, element_end=b'\x00' )
class Test( mrc.Block ): count = mrc.UInt8( 0x00 ) field = mrc.StringField( 0x01, count=mrc.Ref( 'count' ), length_field=mrc.UInt8 )
class Test( mrc.Block ): field = mrc.StringField( count=3, element_length=8, zero_pad=True )