private UInt64 ReadQWORD(string group, string name) { var entry = new PeField { Type = FieldType.QWORD, Group = group, Name = name, Size = 8, Offset = (int)Reader.BaseStream.Position, ULongValue = Reader.ReadUInt64() }; Fields.Add(entry); return(entry.ULongValue); }
private int ReadWORD(string group, string name, Action <PeField> callback = null) { var entry = new PeField { Type = FieldType.WORD, Group = group, Name = name, Size = 2, Offset = (int)Reader.BaseStream.Position, ULongValue = Reader.ReadUInt16() }; Fields.Add(entry); if (callback != null) { callback.Invoke(entry); } return((int)entry.ULongValue); }
private PeField ReadBytes(string group, string name, uint numBytes, Action <PeField> callback = null) { var entry = new PeField { Type = FieldType.BYTES, Group = group, Name = name, Size = numBytes, Offset = (int)Reader.BaseStream.Position, ByteValue = Reader.ReadBytes((int)numBytes), }; entry.Comment = "Size 0x" + entry.ByteValue.Length.ToString("X"); Fields.Add(entry); if (callback != null) { callback.Invoke(entry); } return(entry); }