private RsrcSection GetRsrcSection() { var buffer = new Win32ResourceBuffer(); return(new RsrcSection() { Buffer = buffer, Header = GetRsrcHeader(buffer) }); }
private SectionHeader GetRsrcHeader(Win32ResourceBuffer buffer) { uint rva = GetNextVirtualAddress(_text); return(new SectionHeader() { Name = ".rsrc", VirtualSize = (uint)buffer.Length, VirtualAddress = rva, SizeOfRawData = BitArithmetic.Align((uint)buffer.Length, FILE_ALIGMENT), PointerToRawData = _text.Header.PointerToRawData + _text.Header.SizeOfRawData, Characteristics = SectionCharacteristic.MEM_READ | SectionCharacteristic.CNT_INITIALIZED_DATA }); }