Tks guys
i´ll take a look
The idea is retrieve the bitmaps, icons nd cursors from a delphi Imagelist dfm file. Inside a dfm file we have several components and one of them is a ImageList starting with those magic signatures.
The format is something like
seg000:000007E0 MainImageListStart dd 1126h ----> Size of imagelist
seg000:000007E4 aIl db 'IL' -----> magic signature
seg000:000007E6 dw 101h ----> ???
seg000:000007E8 IML_FrameCount dw 1 -----> frame count ? unlikely...It seems to be an index of some sort because the file contains 2 bitmap images
seg000:000007EA dw 4 -----> ? Horizontal resolution ???? 4*16 = 64
seg000:000007EC dw 4 -----> ?
seg000:000007EE IML_Width_CX dw 16
seg000:000007F0 IML_Height_CY dw 16
seg000:000007F2 dw 0FFFFh -----> ???
seg000:000007F4 dw 0FFFFh -----> ???
seg000:000007F6 dw 10FFh -----> ???
seg000:000007F8 Rect dw 0FFFFh >---- rect coords ????
seg000:000007FA dw 0FFFFh
seg000:000007FC dw 0FFFFh
seg000:000007FE dw 0FFFFh
seg000:00000800 aBm_0 db 'BM'
seg000:00000802 dd 36h
seg000:00000806 dd 0
seg000:0000080A dd 36h
seg000:0000080E dd 28h
This is only a structure, but the main problem is identify what is what.
Internally delphi uses a function called:
__fastcall Imglist::TCustomImageList::ReadData(Classes::TStream *)
that read the contents of this, including the "IL" signature, and uses their values to set onto a imagelist to be properly read and later be extracted each bitmap on another function.
I´m posting here a iml file i created from a delphi one, that contains the IL header (preceded by the dword representing the file lenght), the corresponding bitmap edited with hexworkshop from this iml file, and the generated bitmap.
One of the structures are related to the background color of the image and other to a mask, but i don´t know which is which.
There are 3 files generated from the delphi function. One is the regular image and other is it´s mask saved in bitmap. ANd the othyer is a ico file that is generated from it.
For example. A starting point i had was to analyze the structure of a TBitmap inside a dmf, which have the following format:
[TData:
TData.Size: D$ XXXX ; the total size of the data
TData.TBitMap.SigNameLen: B$ 7
TData.TBitMap.SigName: B$ 'TBitMap'
TData.TBitMap.Size: D$ 0 ; size of the bitmap
Tdata.BinaryData: B$ XXXX; the contents of the bitmap.