예제 #1
0
        private static ELF32Header Read(byte[] buf)
        {
            var r   = new ELF32Header();
            int off = 0;

            r.ident1              = Deserializer.ReadLong(buf, off); off += sizeof(long);
            r.ident2              = Deserializer.ReadLong(buf, off); off += sizeof(long);
            r.type                = Deserializer.ReadUShort(buf, off); off += sizeof(ushort);
            r.machine             = Deserializer.ReadUShort(buf, off); off += sizeof(ushort);
            r.version             = Deserializer.ReadUInt(buf, off); off += sizeof(uint);
            r.EntryPoint          = Deserializer.ReadUInt(buf, off); off += sizeof(uint);
            r.ProgramHeaderOffest = Deserializer.ReadUInt(buf, off); off += sizeof(uint);
            r.SectionHeaderOffset = Deserializer.ReadUInt(buf, off); off += sizeof(uint);
            r.flags               = Deserializer.ReadUInt(buf, off); off += sizeof(uint);
            r.ELFHeaderSize       = Deserializer.ReadUShort(buf, off); off += sizeof(ushort);
            r.ProgramHeaderSize   = Deserializer.ReadUShort(buf, off); off += sizeof(ushort);
            r.NumOfProgramHeader  = Deserializer.ReadUShort(buf, off); off += sizeof(ushort);
            r.SectionHeaderSize   = Deserializer.ReadUShort(buf, off); off += sizeof(ushort);
            r.NumOfSectionHeader  = Deserializer.ReadUShort(buf, off); off += sizeof(ushort);
            r.shstrndx            = Deserializer.ReadUShort(buf, off); off += sizeof(ushort);
            return(r);
        }
예제 #2
0
 public static long GetSizeFromStat64(ByteBufferRef buf)
 {
     return(Deserializer.ReadLong(buf, OFFSET_OF_SIZE_IN_STAT64));
 }