Пример #1
0
 public override void VisitDebugHeader(DebugHeader dh)
 {
     if (dh != null)
     {
         dh.SetDefaultValues();
     }
 }
Пример #2
0
        public override void VisitDebugHeader(DebugHeader header)
        {
            if (m_image.PEOptionalHeader.DataDirectories.Debug == DataDirectory.Zero)
            {
                return;
            }

            long pos = m_binaryReader.BaseStream.Position;

            SetPositionToAddress(m_image.PEOptionalHeader.DataDirectories.Debug.VirtualAddress);
            header.Characteristics  = m_binaryReader.ReadUInt32();
            header.TimeDateStamp    = m_binaryReader.ReadUInt32();
            header.MajorVersion     = m_binaryReader.ReadUInt16();
            header.MinorVersion     = m_binaryReader.ReadUInt16();
            header.Type             = (DebugStoreType)m_binaryReader.ReadUInt32();
            header.SizeOfData       = m_binaryReader.ReadUInt32();
            header.AddressOfRawData = ReadRVA();
            header.PointerToRawData = m_binaryReader.ReadUInt32();

            m_binaryReader.BaseStream.Position = header.PointerToRawData;

            header.Magic     = m_binaryReader.ReadUInt32();
            header.Signature = new Guid(m_binaryReader.ReadBytes(16));
            header.Age       = m_binaryReader.ReadUInt32();
            header.FileName  = ReadZeroTerminatedString();

            m_binaryReader.BaseStream.Position = pos;
        }
Пример #3
0
        public override void VisitDebugHeader(DebugHeader header)
        {
            m_textWriter.BaseStream.Position = m_mdWriter.DebugHeaderPosition;
            uint sizeUntilData = 0x1c;

            header.AddressOfRawData = m_img.TextSection.VirtualAddress + m_mdWriter.DebugHeaderPosition + sizeUntilData;
            header.PointerToRawData = 0x200 + m_mdWriter.DebugHeaderPosition + sizeUntilData;
            header.SizeOfData       = 0x18 + (uint)header.FileName.Length + 1;

            m_textWriter.Write(header.Characteristics);
            m_textWriter.Write(header.TimeDateStamp);
            m_textWriter.Write(header.MajorVersion);
            m_textWriter.Write(header.MinorVersion);
            m_textWriter.Write((uint)header.Type);
            m_textWriter.Write(header.SizeOfData);
            m_textWriter.Write(header.AddressOfRawData.Value);
            m_textWriter.Write(header.PointerToRawData);

            m_textWriter.Write(header.Magic);
            m_textWriter.Write(header.Signature.ToByteArray());
            m_textWriter.Write(header.Age);
            m_textWriter.Write(Encoding.ASCII.GetBytes(header.FileName));
            m_textWriter.Write((byte)0);
        }
Пример #4
0
 public void AddDebugHeader()
 {
     m_debugHeader = new DebugHeader();
     m_debugHeader.SetDefaultValues();
 }