void IsoDirectory::Init(const IsoFileDescriptor& directoryEntry) { // parse directory sector IsoFile dataStream (internalReader, directoryEntry); files.clear(); uint remainingSize = directoryEntry.size; u8 b[257]; while(remainingSize>=4) // hm hack :P { b[0] = dataStream.read<u8>(); if(b[0]==0) { break; // or continue? } remainingSize -= b[0]; dataStream.read(b+1, b[0]-1); files.push_back(IsoFileDescriptor(b, b[0])); } b[0] = 0; }
// All of ElfObjects functions. ElfObject::ElfObject(const wxString& srcfile, IsoFile isofile) : data( wxULongLong(isofile.getLength()).GetLo(), L"ELF headers" ) , proghead( NULL ) , secthead( NULL ) , filename( srcfile ) , header( *(ELF_HEADER*)data.GetPtr() ) { isCdvd = true; checkElfSize(data.GetSizeInBytes()); readIso(isofile); initElfHeaders(); }
void ElfObject::readIso(IsoFile file) { int rsize = file.read(data.GetPtr(), data.GetSizeInBytes()); if (rsize < data.GetSizeInBytes()) throw Exception::EndOfStream(filename); }
IsoFile::IsoFile(const IsoFile &iso) : RecordStream(), _extrDir("/tmp/seiscomp3"), _readingData(false) { setSource(iso.name()); _recstream = RecordStream::Create("sdsarchive"); }