Example #1
0
 public DbiModuleInfo(BitAccess bits, bool readStrings)
 {
     bits.ReadInt32(out opened);
     section = new DbiSecCon(bits);
     bits.ReadUInt16(out flags);
     bits.ReadInt16(out stream);
     bits.ReadInt32(out cbSyms);
     bits.ReadInt32(out cbOldLines);
     bits.ReadInt32(out cbLines);
     bits.ReadInt16(out files);
     bits.ReadInt16(out pad1);
     bits.ReadUInt32(out offsets);
     bits.ReadInt32(out niSource);
     bits.ReadInt32(out niCompiler);
     if (readStrings) {
         bits.ReadCString(out moduleName);
         bits.ReadCString(out objectName);
     }
     else {
         bits.SkipCString(out moduleName);
         bits.SkipCString(out objectName);
     }
     bits.Align(4);
     if (opened != 0 || pad1 != 0) {
         throw new PdbException("Invalid DBI module. "+
                                "(opened={0}, pad={1})", opened, pad1);
     }
 }
Example #2
0
 public DbiModuleInfo(BitAccess bits, bool readStrings)
 {
     bits.ReadInt32(out opened);
     section = new DbiSecCon(bits);
     bits.ReadUInt16(out flags);
     bits.ReadInt16(out stream);
     bits.ReadInt32(out cbSyms);
     bits.ReadInt32(out cbOldLines);
     bits.ReadInt32(out cbLines);
     bits.ReadInt16(out files);
     bits.ReadInt16(out pad1);
     bits.ReadUInt32(out offsets);
     bits.ReadInt32(out niSource);
     bits.ReadInt32(out niCompiler);
     if (readStrings)
     {
         bits.ReadCString(out moduleName);
         bits.ReadCString(out objectName);
     }
     else
     {
         bits.SkipCString(out moduleName);
         bits.SkipCString(out objectName);
     }
     bits.Align(4);
     if (opened != 0 || pad1 != 0)
     {
         throw new PdbException("Invalid DBI module. " +
                                "(opened={0}, pad={1})", opened, pad1);
     }
 }
Example #3
0
 public DbiSecCon(BitAccess bits)
 {
     bits.ReadInt16(out section);
     bits.ReadInt16(out pad1);
     bits.ReadInt32(out offset);
     bits.ReadInt32(out size);
     bits.ReadUInt32(out flags);
     bits.ReadInt16(out module);
     bits.ReadInt16(out pad2);
     bits.ReadUInt32(out dataCrc);
     bits.ReadUInt32(out relocCrc);
     if (pad1 != 0 || pad2 != 0) {
         throw new PdbException("Invalid DBI section. "+
                                "(pad1={0}, pad2={1})",
                                pad1, pad2);
     }
 }
Example #4
0
 public DbiSecCon(BitAccess bits)
 {
     bits.ReadInt16(out section);
     bits.ReadInt16(out pad1);
     bits.ReadInt32(out offset);
     bits.ReadInt32(out size);
     bits.ReadUInt32(out flags);
     bits.ReadInt16(out module);
     bits.ReadInt16(out pad2);
     bits.ReadUInt32(out dataCrc);
     bits.ReadUInt32(out relocCrc);
     if (pad1 != 0 || pad2 != 0)
     {
         throw new PdbException("Invalid DBI section. " +
                                "(pad1={0}, pad2={1})",
                                pad1, pad2);
     }
 }
Example #5
0
 public DbiHeader(BitAccess bits)
 {
     bits.ReadInt32(out sig);
     bits.ReadInt32(out ver);
     bits.ReadInt32(out age);
     bits.ReadInt16(out gssymStream);
     bits.ReadUInt16(out vers);
     bits.ReadInt16(out pssymStream);
     bits.ReadUInt16(out pdbver);
     bits.ReadInt16(out symrecStream);
     bits.ReadUInt16(out pdbver2);
     bits.ReadInt32(out gpmodiSize);
     bits.ReadInt32(out secconSize);
     bits.ReadInt32(out secmapSize);
     bits.ReadInt32(out filinfSize);
     bits.ReadInt32(out tsmapSize);
     bits.ReadInt32(out mfcIndex);
     bits.ReadInt32(out dbghdrSize);
     bits.ReadInt32(out ecinfoSize);
     bits.ReadUInt16(out flags);
     bits.ReadUInt16(out machine);
     bits.ReadInt32(out reserved);
 }
Example #6
0
 public DbiHeader(BitAccess bits)
 {
     bits.ReadInt32(out sig);
     bits.ReadInt32(out ver);
     bits.ReadInt32(out age);
     bits.ReadInt16(out gssymStream);
     bits.ReadUInt16(out vers);
     bits.ReadInt16(out pssymStream);
     bits.ReadUInt16(out pdbver);
     bits.ReadInt16(out symrecStream);
     bits.ReadUInt16(out pdbver2);
     bits.ReadInt32(out gpmodiSize);
     bits.ReadInt32(out secconSize);
     bits.ReadInt32(out secmapSize);
     bits.ReadInt32(out filinfSize);
     bits.ReadInt32(out tsmapSize);
     bits.ReadInt32(out mfcIndex);
     bits.ReadInt32(out dbghdrSize);
     bits.ReadInt32(out ecinfoSize);
     bits.ReadUInt16(out flags);
     bits.ReadUInt16(out machine);
     bits.ReadInt32(out reserved);
 }
Example #7
0
        static void DumpTpiStream(BitAccess bits,
                                  out int tiHashStream,
                                  out int tiHPadStream)
        {
            tiHashStream = 0;
            tiHPadStream = 0;

            // Read the header structure.
            int ver;
            int hdr;
            int min;
            int max;
            int gprec;
            bits.ReadInt32(out ver);
            bits.ReadInt32(out hdr);
            bits.ReadInt32(out min);
            bits.ReadInt32(out max);
            bits.ReadInt32(out gprec);
            Console.WriteLine("   ** TPI ver={0}, hdr={1}, min={2}, max={3}, gprec={4}",
                              ver, hdr, min, max, gprec);

            // Read the hash structure.
            short stream;
            short padStream;
            int key;
            int buckets;
            int vals;
            int pairs;
            int adj;
            bits.ReadInt16(out stream);
            bits.ReadInt16(out padStream);
            bits.ReadInt32(out key);
            bits.ReadInt32(out buckets);
            bits.ReadInt32(out vals);
            bits.ReadInt32(out pairs);
            bits.ReadInt32(out adj);
            Console.WriteLine("      stream={0}, padstream={1}, key={2}, bux={3}, vals={4}, par={5}, adj={6}",
                              stream, padStream, key, buckets, vals, pairs, adj);
            tiHashStream = stream;
            tiHPadStream = padStream;

            int u1;
            int u2;
            int u3;
            bits.ReadInt32(out u1);
            bits.ReadInt32(out u2);
            bits.ReadInt32(out u3);

            Console.WriteLine("      pos={0}, u1={1}, u2={2}, u3={3}",
                              bits.Position, u1, u2, u3);

#if true
            int end = hdr + gprec;
            while (bits.Position < end) {
                ushort cbrec;
                ushort leaf;
                bits.ReadUInt16(out cbrec);
                bits.ReadUInt16(out leaf);
                Console.WriteLine("        [{0,4}] : {1}", cbrec, (LEAF)leaf);
                Dump(bits.Buffer, bits.Position, bits.Position + cbrec - 2);
                bits.Position += cbrec - 2;

                // [GalenH]: Need to figure out what RECs are for.
            }
#endif
        }