I need to get icons from .exe and .dll file streams directly without temporary files. This file stream is obtained from the MSI package "Icon" table. I was able to successfully extract Icon from ".ico" file stream from the MSI package "Icon" table with this code:
public static Icon BytesToIcon(byte[] bytes)
{
using (MemoryStream ms = new MemoryStream(bytes))
{
return new Icon(ms);
}
}
but I have no clue of how I could read icons from .exe and .dll file streams directly. Please help me to look into right direction.
The question is about reading Icons from Byte[] fileStream. There is no file. And the goal is to read Icons from that stream without temporary files. Other similar question is about "Icon.ExtractAssociatedIcon(filePath)" It is not suitable for me because there is no file path.