public byte[] GetData(PeHeaderReader pe) { pe.BaseStream.Position = pe.RVAToFileOffest(resourceInfo.OffsetToData); uint length = resourceInfo.Size; byte[] buffer = new byte[length]; pe.BaseStream.Read(buffer, 0, (int)resourceInfo.Size); return(buffer); }
public byte[] GetIconData(PeHeaderReader pe) { pe.BaseStream.Position = pe.RVAToFileOffest(resourceInfo.OffsetToData); uint length = resourceInfo.Size; int star = 0; if (baseItem.Type == ResourceType.Icon) { length += (uint)arrHead.Length; star += arrHead.Length; } byte[] buffer = new byte[length]; if (baseItem.Type == ResourceType.Icon) { Array.Copy(arrHead, buffer, arrHead.Length); } pe.BaseStream.Read(buffer, star, (int)resourceInfo.Size); return(buffer); }