Mono.Cecil.PE.ImageWriter.Align C# (CSharp) Метод

Align() статический приватный Метод

static private Align ( uint value, uint align ) : uint
value uint
align uint
Результат uint
        static uint Align(uint value, uint align)
        {
            align--;
            return (value + align) & ~align;
        }

Usage Example

Пример #1
0
        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