Beispiel #1
0
 internal SIContentROFSData(SIROFS aImage, string aName, uint aSize, long aPosition, TCheckedUid aUids)
     : base(aImage)
 {
     iFileName = aName;
     iUids     = aUids;
     iFileSize = aSize;
     iPosition = aPosition;
 }
        internal SIHeaderE32Image(SIImage aImage, SymbianStreamReaderLE aReader)
            : base(aImage)
        {
            long startPos = aReader.Position;

            //
            iUids      = new TCheckedUid(aReader);
            iSignature = aReader.ReadUInt32();
            //
            if (iSignature != KExpectedSignatureUInt32)   // 'EPOC'
            {
                throw new E32ImageNotSupportedException("Invalid signature");
            }
            //
            iHeaderCrc       = aReader.ReadUInt32();
            iModuleVersion   = aReader.ReadUInt32();
            iCompressionType = SIHeaderE32Image.ReadCompressionType(aReader);
            iToolsVersion    = new TVersion(aReader);
            iTimeLo          = aReader.ReadUInt32();
            iTimeHi          = aReader.ReadUInt32();
            iFlags           = aReader.ReadUInt32();
            //
            iCodeSize    = aReader.ReadInt32();
            iDataSize    = aReader.ReadInt32();
            iHeapSizeMin = aReader.ReadInt32();
            iHeapSizeMax = aReader.ReadInt32();
            iStackSize   = aReader.ReadInt32();
            iBssSize     = aReader.ReadInt32();
            //
            iEntryPoint = aReader.ReadUInt32();
            iCodeBase   = aReader.ReadUInt32();
            iDataBase   = aReader.ReadUInt32();
            //
            iDllRefTableCount = aReader.ReadInt32();
            iExportDirOffset  = aReader.ReadUInt32();
            iExportDirCount   = aReader.ReadInt32();
            //
            iTextSize        = aReader.ReadInt32();
            iCodeOffset      = aReader.ReadUInt32();
            iDataOffset      = aReader.ReadUInt32();
            iImportOffset    = aReader.ReadUInt32();
            iCodeRelocOffset = aReader.ReadUInt32();
            iDataRelocOffset = aReader.ReadUInt32();
            //
            iProcessPriority = aReader.ReadInt16();
            //
            iCpuIdentifier = aReader.ReadUInt16();
            //
            iUncompressedSize = aReader.ReadUInt32();
            //
            iS = new SSecurityInfo(aReader);
            iExceptionDescriptor = aReader.ReadUInt32();
            iSpare2         = aReader.ReadUInt16();
            iExportDescSize = aReader.ReadUInt16();
            iExportDescType = aReader.ReadUInt8();
            //
            iHeaderSize = (uint)(aReader.Position - startPos);
        }
Beispiel #3
0
        public TRofsEntry(SymbianStreamReaderLE aReader, ITracer aTracer)
        {
            long startPos = aReader.BaseStream.Position;

            iStructSize = aReader.ReadUInt16();
            iUids       = new TCheckedUid(aReader);

            // Skip name offset - not useful
            aReader.ReadUInt8();
            //
            iAtt         = aReader.ReadUInt8();
            iFileSize    = aReader.ReadUInt32();
            iFileAddress = aReader.ReadUInt32();
            iAttExtra    = aReader.ReadUInt8();

            // Read name - the length is in unicode characters.
            byte nameLength = aReader.ReadUInt8();

            iName = aReader.ReadStringUTF16(nameLength);
        }
Beispiel #4
0
        public static SIContent New(SIROFS aImage, string aName, uint aSize, long aPosition, TCheckedUid aUids)
        {
            SIContent ret = null;
            //
            bool isImage = SymbianImageE32.IsImageFile((Stream)aImage.Stream, aPosition);

            if (!isImage)
            {
                // We create either a code file (binary) or data file depending on the type of file at the specified location.
                ret = new SIContentROFSData(aImage, aName, aSize, aPosition, aUids);
            }
            else
            {
                ret = new SIContentROFSCode(aImage, aName, aSize, aPosition);
            }
            //
            return(ret);
        }