Mono.Cecil.PE.ImageWriter.Align C# (CSharp) Méthode

Align() static private méthode

static private Align ( uint value, uint align ) : uint
value uint
align uint
Résultat uint
        static uint Align(uint value, uint align)
        {
            align--;
            return (value + align) & ~align;
        }

Usage Example

        private Section CreateSection(string name, uint size, Section previous)
        {
            uint    virtualAddress;
            Section section = new Section()
            {
                Name = name
            };

            if (previous != null)
            {
                virtualAddress = previous.VirtualAddress + ImageWriter.Align(previous.VirtualSize, 8192);
            }
            else
            {
                virtualAddress = 8192;
            }
            section.VirtualAddress   = virtualAddress;
            section.VirtualSize      = size;
            section.PointerToRawData = (previous != null ? previous.PointerToRawData + previous.SizeOfRawData : ImageWriter.Align(this.GetHeaderSize(), 512));
            section.SizeOfRawData    = ImageWriter.Align(size, 512);
            return(section);
        }
All Usage Examples Of Mono.Cecil.PE.ImageWriter::Align