예제 #1
0
        public override void OnRebuild(VoidPtr address, int length, bool force)
        {
            REFF *header = (REFF *)address;

            header->_linkPrev            = 0;
            header->_linkNext            = 0;
            header->_padding             = 0;
            header->_dataLength          = length - 0x18;
            header->_header._tag         = header->_tag = REFF.Tag;
            header->_header.Endian       = Endian.Big;
            header->_header._version     = 7;
            header->_header._length      = length;
            header->_header._firstOffset = 0x10;
            header->_header._numEntries  = 1;
            header->IdString             = Name;

            REFTypeObjectTable *table = (REFTypeObjectTable *)((byte *)header + header->_dataOffset + 0x18);

            table->_entries = (ushort)Children.Count;
            table->_pad     = 0;
            table->_length  = _tableLen;

            REFTypeObjectEntry *entry = table->First;
            int offset = _tableLen;

            foreach (ResourceNode n in Children)
            {
                entry->Name       = n.Name;
                entry->DataOffset = offset;
                entry->DataLength = n._calcSize;
                n.Rebuild((VoidPtr)table + offset, n._calcSize, force);
                offset += n._calcSize;
                entry   = entry->Next;
            }
        }
예제 #2
0
        protected override void OnPopulate()
        {
            REFTypeObjectTable *table = Header->Table;
            REFTypeObjectEntry *Entry = table->First;

            for (int i = 0; i < table->_entries; i++, Entry = Entry->Next)
            {
                new REFFEntryNode()
                {
                    _name = Entry->Name, _offset = (int)Entry->DataOffset, _length = (int)Entry->DataLength
                }
            }
예제 #3
0
        public override void OnPopulate()
        {
            REFTypeObjectTable *table = Header->Table;
            REFTypeObjectEntry *Entry = table->First;

            for (int i = 0; i < table->_entries; i++, Entry = Entry->Next)
            {
                new REFFEntryNode {
                    _name = Entry->Name, _offset = Entry->DataOffset, _length = Entry->DataLength
                }
                .Initialize(this, new DataSource((byte *)table->Address + Entry->DataOffset, Entry->DataLength));
            }
        }
예제 #4
0
        protected override bool OnInitialize()
        {
            base.OnInitialize();

            REFF *header = Header;

            _name    = header->IdString;
            _dataLen = header->_dataLength;
            _dataOff = header->_dataOffset;
            _unk1    = header->_unk1;
            _unk2    = header->_unk2;
            _unk3    = header->_unk3;

            REFTypeObjectTable *objTable = header->Table;

            _TableLen     = (int)objTable->_length;
            _TableEntries = (short)objTable->_entries;
            _TableUnk1    = (short)objTable->_unk1;

            return(header->Table->_entries > 0);
        }
예제 #5
0
        //[Category("REFT Data")]
        //public int DataLength { get { return _dataLen; } }
        //[Category("REFT Data")]
        //public int DataOffset { get { return _dataOff; } }

        //[Category("REFT Object Table")]
        //public int Length { get { return _TableLen; } }
        //[Category("REFT Object Table")]
        //public short NumEntries { get { return _TableEntries; } }

        public override bool OnInitialize()
        {
            base.OnInitialize();

            REFT *header = Header;

            if (_name == null)
            {
                _name = header->IdString;
            }

            _dataLen = header->_dataLength;
            _dataOff = header->_dataOffset;
            _unk1    = header->_linkPrev;
            _unk2    = header->_linkNext;

            REFTypeObjectTable *objTable = header->Table;

            _TableLen     = (int)objTable->_length;
            _TableEntries = (short)objTable->_entries;
            _TableUnk1    = (short)objTable->_unk1;

            return(header->Table->_entries > 0);
        }