Extracting Bitmap files from *.dll
A free file archiver for extremely high compression
Brought to you by:
ipavlov
When I put a Bitmap file OpenFile_16.bmp (with a wrong filesize, 2 bytes to long) as resource to a Dll (RibbonMarkup.ribbon) then I get a wrong Bitmap when I extract the resource Dll. In the extracted BITMAP folder I get a file with name 60015.bmp. The problem I have detected is a wrong calculation for the offBits in CPP\7zip\Archive\PeHandler.cpp, function SetBitmapHeader.
The current implementation is
UInt32 offBits = totalSize - h.SizeImage;
should be:
UInt32 offBits = kBmpHeaderSize + Get16(src);
Files are in the attachment.
If I extract bmp from 7zfm.exe, I get byte-to-byte identical files only with my version of that code.
So I don't want to change that code, if it breaks things that work correctly now.
If you can make more deep research for all aspects of that bmp problem, we can think about possible solution.