help~read the new wil format file of korea

smoochy boys on tour

brush

LOMCN Leecher
May 28, 2017
2
0
12
I wrote a demo project
but, the BMP file does not open properly

procedure TForm4.Button4Click(Sender: TObject);
var
imginfonew: TWMImageInfo;
FFileStream: TFileStream;
bmp: TBitmap;
Buffer: PChar;
I, position, nLen: Integer;
begin
if FImageCount = 0 then
Memo1.Lines.Add('Nil')
else
Memo1.Lines.Add(IntToSTr(FImageCount));


for I := 0 to FImageCount - 1 do
begin
position := Integer(FIndexList);


FFileStream := TFileStream.Create(Edit6.Text + '.wil', fmOpenRead or fmShareDenyNone);
FFileStream.position := position;
FFileStream.Read(imginfonew, SizeOf(imginfonew));
nLen := (imginfonew.nWidth * imginfonew.nHeight) * 2;
if imginfonew.size < 6 then
imginfonew.nWidth := 0;


if (imginfonew.nWidth > 2000) or (imginfonew.nHeight > 2000) then
continue;
if (imginfonew.nWidth < 2) or (imginfonew.nHeight < 2) then
continue;
//GetMem(Buffer, nLen);
outBuffer.Position := 0;
inBuffer.Position := 0;
inBuffer.CopyFrom(FFileStream, imginfonew.size);
outBuffer := ZipPack.ExtractStreamToStream(inBuffer, nLen);
outBuffer.SaveToFile('./Img/'+ IntTOStr(I) + '.DIB');
end;
end;
 
Last edited: