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.
This is not a duplicate, because similar question was marked as duplicate due to a moderator's mistake.
Update: My question was marked as "duplicate" by moderator "L.B" by mistake. Moderator did not check updated question with my clarification on "why it wasn't actually" a duplicate. Unfortunately site does not allow to contact users, and after question is marked as duplicate by someone on their own thought - the question will be spoiled without a chance of appeal.