public void UpdateEntries() { VoidPtr addr = _workingSource.Address; addr += 0x08; for (int i = 0; i < _entryCount; i++) { LSEntry lsobj = Entries.Values[i]; if (Version == 1) { _s_LSEntry_v1 *entry = (_s_LSEntry_v1 *)(addr + (i * 0x0C)); *entry = new _s_LSEntry_v1() { _crc = lsobj.FileNameCRC, _start = lsobj.DTOffset, _size = lsobj.Size }; _s_LSEntry_v1 *entry2 = (_s_LSEntry_v1 *)(addr + (i * 0x0C)); } else if (Version == 2) { _s_LSEntry_v2 *entry = (_s_LSEntry_v2 *)(addr + (i * 0x10)); *entry = new _s_LSEntry_v2() { _crc = lsobj.FileNameCRC, _start = lsobj.DTOffset, _size = lsobj.Size, _dtIndex = lsobj.DTIndex, _unk = lsobj.PaddingLength }; } } }
public void Parse(string path) { _workingSource = new DataSource(FileMap.FromFile(path)); short tag = *(short *)_workingSource.Address; if (tag != 0x666f) { return; } _version = *(short *)(_workingSource.Address + 0x02); _entryCount = *(int *)(_workingSource.Address + 0x04); Entries = new SortedList <uint, LSEntry>(_entryCount); for (int i = 0; i < _entryCount; i++) { LSEntry lsobj = new LSEntry(); if (Version == 1) { _s_LSEntry_v1 entry = *(_s_LSEntry_v1 *)(_workingSource.Address + 0x08 + (i * 0x0C)); lsobj.FileNameCRC = entry._crc; lsobj.DTOffset = entry._start; lsobj.Size = entry._size; } else if (Version == 2) { _s_LSEntry_v2 entry = *(_s_LSEntry_v2 *)(_workingSource.Address + 0x08 + (i * 0x10)); lsobj.FileNameCRC = entry._crc; lsobj.DTOffset = entry._start; lsobj.Size = entry._size; lsobj.DTIndex = entry._dtIndex; lsobj.PaddingLength = entry._unk; } Entries.Add(lsobj.FileNameCRC, lsobj); } }