/// <inheritdoc/>
 public void WriteTo(DataWriter writer)
 {
     writer.WriteBytes(code);
     if (HasExtraSections)
     {
         var rva2 = rva + (uint)code.Length;
         writer.WriteZeroes((int)rva2.AlignUp(EXTRA_SECTIONS_ALIGNMENT) - (int)rva2);
         writer.WriteBytes(extraSections);
     }
 }
Esempio n. 2
0
        /// <inheritdoc/>
        public void WriteTo(DataWriter writer)
        {
            var rva2 = rva;

            foreach (var mb in tinyMethods)
            {
                mb.VerifyWriteTo(writer);
                rva2 += mb.GetFileLength();
            }

            foreach (var mb in fatMethods)
            {
                if (alignFatBodies)
                {
                    int padding = (int)rva2.AlignUp(FAT_BODY_ALIGNMENT) - (int)rva2;
                    writer.WriteZeroes(padding);
                    rva2 += (uint)padding;
                }
                mb.VerifyWriteTo(writer);
                rva2 += mb.GetFileLength();
            }
        }
Esempio n. 3
0
 /// <inheritdoc/>
 public void WriteTo(DataWriter writer)
 {
     WriteToImpl(writer);
     writer.WriteZeroes((int)(Utils.AlignUp(GetRawLength(), ALIGNMENT) - GetRawLength()));
 }