39 references to PEOffsets
Microsoft.NET.HostModel (39)
AppHost\PEUtils.cs (9)
21if (accessor.Capacity < PEOffsets.DosStub.PESignatureOffset + sizeof(uint)) 27return signature == PEOffsets.DosImageSignature; 34if (reader.BaseStream.Length < PEOffsets.DosStub.PESignatureOffset + sizeof(uint)) 40return signature == PEOffsets.DosImageSignature; 91accessor.Write(peHeaderOffset + PEOffsets.PEHeader.Subsystem, AsLittleEndian((ushort)Subsystem.WindowsGui)); 128if (accessor.Capacity < PEOffsets.DosStub.PESignatureOffset + sizeof(uint)) 131peHeaderOffset = AsLittleEndian(accessor.ReadUInt32(PEOffsets.DosStub.PESignatureOffset)); 132if (accessor.Capacity < peHeaderOffset + PEOffsets.PEHeader.Subsystem + sizeof(ushort)) 136return AsLittleEndian(accessor.ReadUInt16(peHeaderOffset + PEOffsets.PEHeader.Subsystem));
ResourceUpdater.cs (30)
202int peSignatureOffset = ReadI32(accessor, PEOffsets.DosStub.PESignatureOffset); 203int sectionBase = peSignatureOffset + PEOffsets.PEHeaderSize + 208int resourceSectionBase = sectionBase + PEOffsets.OneSectionHeaderSize * resourceSectionIndex; 210if (resourceSectionBase + PEOffsets.OneSectionHeaderSize > 214WriteI32(accessor, peSignatureOffset + PEOffsets.PEHeader.NumberOfSections, resourceSectionIndex + 1); 225WriteI32(accessor, resourceSectionBase + PEOffsets.SectionHeader.VirtualSize, rsrcSectionDataSize); 226WriteI32(accessor, resourceSectionBase + PEOffsets.SectionHeader.VirtualAddress, rsrcVirtualAddress); 227WriteI32(accessor, resourceSectionBase + PEOffsets.SectionHeader.RawSize, newSectionSize); 228WriteI32(accessor, resourceSectionBase + PEOffsets.SectionHeader.RawPointer, rsrcPointerToRawData); 229WriteI32(accessor, resourceSectionBase + PEOffsets.SectionHeader.RelocationsPointer, 0); 230WriteI32(accessor, resourceSectionBase + PEOffsets.SectionHeader.LineNumbersPointer, 0); 231WriteI16(accessor, resourceSectionBase + PEOffsets.SectionHeader.NumberOfRelocations, 0); 232WriteI16(accessor, resourceSectionBase + PEOffsets.SectionHeader.NumberOfLineNumbers, 0); 233WriteI32(accessor, resourceSectionBase + PEOffsets.SectionHeader.SectionCharacteristics, 245int currentSectionBase = sectionBase + PEOffsets.OneSectionHeaderSize * i; 247ModifyI32(accessor, currentSectionBase + PEOffsets.SectionHeader.VirtualAddress, 249ModifyI32(accessor, currentSectionBase + PEOffsets.SectionHeader.RawPointer, 257int resourceSectionBase = sectionBase + PEOffsets.OneSectionHeaderSize * resourceSectionIndex; 258WriteI32(accessor, resourceSectionBase + PEOffsets.SectionHeader.VirtualSize, rsrcSectionDataSize); 259WriteI32(accessor, resourceSectionBase + PEOffsets.SectionHeader.RawSize, newSectionSize); 268? peSignatureOffset + PEOffsets.PEHeader.PE64DataDirectories 269: peSignatureOffset + PEOffsets.PEHeader.PE32DataDirectories; 272ModifyI32(accessor, peSignatureOffset + PEOffsets.PEHeader.InitializedDataSize, 274ModifyI32(accessor, peSignatureOffset + PEOffsets.PEHeader.SizeOfImage, 281PatchRVA(dataDirectoriesOffset + i * PEOffsets.DataDirectoryEntrySize + 282PEOffsets.DataDirectoryEntry.VirtualAddressOffset); 286int resourceTableOffset = dataDirectoriesOffset + PEOffsets.ResourceTableDataDirectoryIndex * PEOffsets.DataDirectoryEntrySize; 287WriteI32(accessor, resourceTableOffset + PEOffsets.DataDirectoryEntry.VirtualAddressOffset, rsrcVirtualAddress); 288WriteI32(accessor, resourceTableOffset + PEOffsets.DataDirectoryEntry.SizeOffset, rsrcSectionDataSize);