class KeyV4(mrc.Block): unk1 = mrc.UInt16_P(0x00) unk2 = mrc.UInt16_P(0x02) unk3 = mrc.UInt32_P(0x04) entry_count = mrc.UInt32_P(0x08) entries = mrc.BlockField(KeyEntry, 0x0c, count=mrc.Ref('entry_count')) garbage = mrc.Bytes(mrc.EndOffset('entries'))
class MMapEntry(mrc.Block): chunk_id = mrc.UInt32_P(0x00) length = mrc.UInt32_P(0x04) offset = mrc.UInt32_P(0x08) flags = mrc.UInt16_P(0x0c) unk1 = mrc.UInt16_P(0x0e) memsize = mrc.UInt32_P(0x10) @property def repr(self): return 'chunk_id: {}, length: 0x{:08x}, offset: 0x{:08x}, flags: {}'.format( riff.TagB(self.chunk_id), self.length, self.offset, self.flags)
class MMapEntry(mrc.Block): chunk_id = mrc.UInt32_P(0x00) length = mrc.UInt32_P(0x04) offset = mrc.UInt32_P(0x08) flags = mrc.UInt16_P(0x0c) unk1 = mrc.UInt16_P(0x0e) memsize = mrc.UInt32_P(0x10) def import_data(self, *args, **kwargs): return super().import_data(*args, **kwargs) @property def repr(self): return f'chunk_id: {riff.TagB( self.chunk_id )}, length: 0x{self.length:08x}, offset: 0x{self.offset:08x}, flags: {self.flags}'
class TestLP(mrc.Block): _endian = 'little' i16 = mrc.Int16_P() i32 = mrc.Int32_P() i64 = mrc.Int64_P() ui16 = mrc.UInt16_P() ui32 = mrc.UInt32_P() ui64 = mrc.UInt64_P() f32 = mrc.Float32_P() f64 = mrc.Float64_P()
class KeyV4(mrc.Block): unk1 = mrc.UInt16_P(0x00) unk2 = mrc.UInt16_P(0x02) slot_count = mrc.UInt32_P(0x04) entry_count = mrc.UInt32_P(0x08) entries = mrc.BlockField(KeyEntry, 0x0c, count=mrc.Ref('slot_count'))