public static RsrcString Deserialize(MultiPartFile file) { RsrcString rs = new RsrcString(); rs.Length = file.ReadByte(); rs.Text = file.ReadChars(rs.Length); return(rs); }
public static IMAGE_OPTIONAL_HEADER Deserialize(MultiPartFile file) { IMAGE_OPTIONAL_HEADER ioh = new IMAGE_OPTIONAL_HEADER(); ioh.Magic = file.ReadUInt16(); ioh.MajorLinkerVersion = file.ReadByte(); ioh.MinorLinkerVersion = file.ReadByte(); ioh.SizeOfCode = file.ReadUInt32(); ioh.SizeOfInitializedData = file.ReadUInt32(); ioh.SizeOfUninitializedData = file.ReadUInt32(); ioh.AddressOfEntryPoint = file.ReadUInt32(); ioh.BaseOfCode = file.ReadUInt32(); ioh.BaseOfData = file.ReadUInt32(); ioh.ImageBase = file.ReadUInt32(); ioh.SectionAlignment = file.ReadUInt32(); ioh.FileAlignment = file.ReadUInt32(); ioh.MajorOperatingSystemVersion = file.ReadUInt16(); ioh.MinorOperatingSystemVersion = file.ReadUInt16(); ioh.MajorImageVersion = file.ReadUInt16(); ioh.MinorImageVersion = file.ReadUInt16(); ioh.MajorSubsystemVersion = file.ReadUInt16(); ioh.MinorSubsystemVersion = file.ReadUInt16(); ioh.Reserved1 = file.ReadUInt32(); ioh.SizeOfImage = file.ReadUInt32(); ioh.SizeOfHeaders = file.ReadUInt32(); ioh.CheckSum = file.ReadUInt32(); ioh.Subsystem = file.ReadUInt16(); ioh.DllCharacteristics = file.ReadUInt16(); ioh.SizeOfStackReserve = file.ReadUInt32(); ioh.SizeOfStackCommit = file.ReadUInt32(); ioh.SizeOfHeapReserve = file.ReadUInt32(); ioh.SizeOfHeapCommit = file.ReadUInt32(); ioh.LoaderFlags = file.ReadUInt32(); ioh.NumberOfRvaAndSizes = file.ReadUInt32(); ioh.DataDirectory = new IMAGE_DATA_DIRECTORY[Constants.IMAGE_NUMBEROF_DIRECTORY_ENTRIES]; for (int i = 0; i < Constants.IMAGE_NUMBEROF_DIRECTORY_ENTRIES; i++) { ioh.DataDirectory[i] = IMAGE_DATA_DIRECTORY.Deserialize(file); } return(ioh); }
public static ResourceTable Deserialize(MultiPartFile file) { ResourceTable rt = new ResourceTable(); rt.rscAlignShift = file.ReadUInt16(); rt.TypeInfo = TYPEINFO.Deserialize(file); rt.rscEndTypes = file.ReadUInt16(); rt.rscResourceNames = null; // TODO: Figure out size rt.rscEndNames = file.ReadByte(); return(rt); }
} // 3F Windows SDK version number public static IMAGE_OS2_HEADER Deserialize(MultiPartFile file) { IMAGE_OS2_HEADER ioh = new IMAGE_OS2_HEADER(); ioh.Magic = file.ReadUInt16(); ioh.LinkerVersion = file.ReadByte(); ioh.LinkerRevision = file.ReadByte(); ioh.EntryTableOffset = file.ReadUInt16(); ioh.EntryTableSize = file.ReadUInt16(); ioh.CrcChecksum = file.ReadUInt32(); ioh.Flags = file.ReadUInt16(); ioh.Autodata = file.ReadUInt16(); ioh.InitialHeapAlloc = file.ReadUInt16(); ioh.InitialStackAlloc = file.ReadUInt16(); ioh.InitialCSIPSetting = file.ReadUInt32(); ioh.InitialSSSPSetting = file.ReadUInt32(); ioh.FileSegmentCount = file.ReadUInt16(); ioh.ModuleReferenceTableSize = file.ReadUInt16(); ioh.NonResidentNameTableSize = file.ReadUInt16(); ioh.SegmentTableOffset = file.ReadUInt16(); ioh.ResourceTableOffset = file.ReadUInt16(); ioh.ResidentNameTableOffset = file.ReadUInt16(); ioh.ModuleReferenceTableOffset = file.ReadUInt16(); ioh.ImportedNamesTableOffset = file.ReadUInt16(); ioh.NonResidentNamesTableOffset = file.ReadUInt32(); ioh.MovableEntriesCount = file.ReadUInt16(); ioh.SegmentAlignmentShiftCount = file.ReadUInt16(); ioh.ResourceEntriesCount = file.ReadUInt16(); ioh.TargetOperatingSystem = file.ReadByte(); ioh.AdditionalFlags = file.ReadByte(); ioh.Reserved = new ushort[Constants.NERESWORDS]; for (int i = 0; i < Constants.NERESWORDS; i++) { ioh.Reserved[i] = file.ReadUInt16(); } ioh.WindowsSDKRevision = file.ReadByte(); ioh.WindowsSDKVersion = file.ReadByte(); return(ioh); }