wis header cracked?

Join Discord

Primal

LOMCN VIP
VIP
Jun 28, 2004
1,756
102
259
duno if this is how to make the client read .wis files, nt rly read through it. i know some people already done it, but i know alot havnt

here anyways:

in chinese:
Post 1
Code:
发布WIS原理,通过原理能顺利制作出WIS编辑器
WIS文件内部分三部分

文件头,占用200h 固定大小

200h后是图片像素部分这部分长度未知

图片像素后,是每个图片的偏移,占用长度,和一个预留位置

这三个域都是integer型的,占用4个字节

取到偏移列表的方法是

读入文件,跳转到文件全长-12字符处

向下取 

第一个4位为最后一个图片的偏移
第二个4位为最后一个图片的占用长度
第三个4位是预留域,暂时无用,值均为0

得到这三个值后,就可以得到整个图片像素区域的长度

像素区域长度是imagecountsize:=最后一个偏移位置+最后一个图片占用长度

从这个imagecountsize后面,就是整个图片偏移列表区域

可以循环读出整个偏移列表(读到文件的EOF)

得到整个偏移列表后

可以看到,图片从200h开始

第一位是一个是否压缩标识
第二到4位,预留位,暂时没有用到
接下去是一个8字节的空间,存放着4个smallint
分别是
Width,Height,X,Y

WIS的像素分压缩,未压缩与捣乱三种情况

压缩情况是

当图片偏移位置开始的第1位为1时,做解压处理

图片偏移开始的第13位不为0时,做解压处理

解压方法是

取13位的值,做为循环次数
取14位的值,做为像素值

例如:13位的值为10
      14位的值为255
那么,WIS的解压过程是

for i:=0 to 9 do
begin
  写入像素(255);
end;

压缩方法就是相邻位值相同则叠加,以减少空间占用。


当图片偏移开始的第1位不为1时,则不做解压处理,而是普通的

Width*Height取值

还有一种是捣乱的情况

当图片偏移位置开始的第1位为1时,而图片偏移位置的第13位为0时,这时就开始捣乱

读入第14位值,做为循环次数

然后依次循环读出14位以后的循环次数的顺序像素写入图片。

界此Wis的文件结构与处理方式已经全面告破。

Chatop 2009-11-24日记录
Post 2
Code:
wis格式我早就破了半年前破的

文件结构是这样的:

文件头

图像数据区

索引数据区


  TWis = class
    {==========================Twis 打开wis文件的基本类=======================}
    {它没有直接提供获得图像对象的方法 也没有缓冲区.                          }
    {它会负责 装载文件 读取索引信息 解压图像数据.                            }
    {它提供了一个公开的方法GetImageData,这个方法可以根据index将对应的图像信息 }
    {装载到TImageBuf结构变量中 TImageBuf.PBits 就是图像数据在内存中的指针    }
    {作者 QQ348888398 目的:研究学习                                          }
    {=========================================================================}
  Protected
    FfileName : string;                //文件名
    FimageCount : integer;            //图片数量
    FFileStream: TFileStream;          //文件流
    FindexList : Tlist;                //文件索引列表
    procedure LoadFile();Virtual;      //装载文件
    procedure Clear();Virtual;        //清空数据
    procedure Decipher(Src,Dest:Pbyte; Width,Height:Word; EncSize:longword); //解压
  public
    constructor Create;Virtual;
    destructor Destroy;Virtual;
    procedure Initialize();              //初始化
    function GetImageData(Index:integer;var ImageBuf:TImageBuf):Boolean;//获得指定序号的图像信息以及数据指针
    property fileName:string read FfileName write FfileName;
    property imageCount:integer read FimageCount;

  end;

  TWisBitMaps = class(TWis)
    {==========================TWisBitMaps====================================}
    {继承自TWis 它可以提供 获得TBitMap对象位图的方法                          }
    {提供了两个公开的方法 GetImage , GetImageEx                              }
    {GetImage获得指定索引的位图.  GetImageEx获得指定索引的位图和坐标.        }
    {它有一个简单的Bitmap缓冲数组 它会自己管理释放                            }

    {作者 QQ348888398 目的:研究学习                                          }
    {=========================================================================}
  private
    FBitMapArr : TBitMapArr;                //位图缓冲数组
    FRGBQuads : TRGBQuads;                  //调色板数据
    procedure LoadBitmap(WisIndex:TWisIndex;var bitmap:Tbitmap; var x,y:integer); //从文件流中读取数据到位图
    procedure LoadFile();override;          //装载文件
    procedure Clear();override;              //清空数据
    procedure FreeIdle();                    //释放闲置的图片
  public
    constructor Create;override;
    destructor Destroy;override;
    function GetImage(index:integer):TBitmap;//获得位图
    function GetImageEx(index:integer; var x,y:integer):TBitmap; //获得位图跟坐标
  end;


没想到你们对wis还蛮有兴趣的 要是需要的话我可以公开一个dcu文件

translated by google:
post 1
Code:
Release WIS principle, through the principle of smooth produce WIS Editor 
WIS within the three-part document 

File header, taking up a fixed size of 200h 

200h is a picture after the pixel part of this part of the length of the unknown 

Image pixel after the offset of each image, occupancy length, and a placeholder 

These three fields are the integer type, occupy 4 bytes 

Get to the offset of the list is 

Read into the file, jump to a file full character at -12 

Get down 

The first 4-bit offset for the last one picture 
The second 4-bit for the last occupation of the length of a picture 
The third four are reserved for the domain, temporarily useless, values are 0 

By the three values, you can get the length of the entire image pixel region 

Pixel region length is imagecountsize: = last position + offset an image occupying the length of the last 

Imagecountsize behind this is to shift the entire image list of the regional 

You can read the entire shift cycle list (read the file EOF) 

After the entire list to be offset 

Can see pictures from the beginning 200h 

The first one is a question of whether compression logo 
Second to the four reserved bits, no use 
Next was an 8-byte space, he stored 4 smallint 
Are 
Width, Height, X, Y 

WIS pixel sub-compressed, uncompressed or causing trouble three kinds of 

Compression is 

When the picture began to shift location of the first one is 1, so decompression processing 

Photo offset start the first 13 is not 0, so decompression processing 

Decompression method is 

Take 13 values, as the cycle number 
Take 14-bit values, as a pixel value 

For example: 13-bit value of 10 
      14-bit value of 255 
Well, WIS of the decompression process is 

for i: = 0 to 9 do 
begin 
  Write pixels (255); 
end; 

Compression method is the same value then the superposition of adjacent spaces in order to reduce space requirements. 


When the picture began to offset the first one is not 1, then not do decompression treatment, but the ordinary 

Width * Height Values 

There is also a disruptive situation is 

When the picture began to shift location of the first one to 1, while the picture offset location of the first 13 to 0, then began to make trouble 

Read the first 14-bit value, as the cycle number 

Read cycle followed by 14 cycles after the order of pixels into pictures. 

Wis the file structure of this sector and the handling has been fully solved. 

Chatop 2009-11-24 Day Record

post2
Code:
wis format broke six months ago, I had broken the 

File structure is like this: 

Header 

Image data area 

Index Data Area 


  TWis = class 
    {========================== Twis open wis file base class ================ =======} 
    (It does not directly provide access to the image object's method does not buffer.) 
    (It will be responsible for loading the file to read the index information-extracting image data.) 
    (It provides an open approach GetImageData, this method can index will correspond to the image information) 
    (Loaded into TImageBuf structural variables TImageBuf.PBits image data in memory is a pointer) 
    (By QQ348888398 Objective: To study the learning) 
    {================================================= ========================} 
  Protected 
    FfileName: string; / / file name 
    FimageCount: integer; / / Number of Pictures 
    FFileStream: TFileStream; / / file stream 
    FindexList: Tlist; / / document index list 
    procedure LoadFile (); Virtual; / / load the file 
    procedure Clear (); Virtual; / / Clear Data 
    procedure Decipher (Src, Dest: Pbyte; Width, Height: Word; EncSize: longword); / / decompression 
  public 
    constructor Create; Virtual; 
    destructor Destroy; Virtual; 
    procedure Initialize (); / / initialize 
    function GetImageData (Index: integer; var ImageBuf: TImageBuf): Boolean; / / get the specified number of image information and data pointers 
    property fileName: string read FfileName write FfileName; 
    property imageCount: integer read FimageCount; 

  end; 

  TWisBitMaps = class (TWis) 
    {========================== TWisBitMaps ====================== ==============} 
    (Inherited from TWis it can provide access to TBitMap method of the bitmap object) 
    (Provides two public methods GetImage, GetImageEx) 
    (GetImage obtain the specified bitmap index. GetImageEx be specified index bit maps and coordinates.) 
    (It has a simple array of Bitmap buffer it will manage its own release) 

    (By QQ348888398 Objective: To study the learning) 
    {================================================= ========================} 
  private 
    FBitMapArr: TBitMapArr; / / Bitmap Caching Array 
    FRGBQuads: TRGBQuads; / / palette data 
    procedure LoadBitmap (WisIndex: TWisIndex; var bitmap: Tbitmap; var x, y: integer); / / read data from the file stream in place plans 
    procedure LoadFile (); override; / / load the file 
    procedure Clear (); override; / / Clear Data 
    procedure FreeIdle (); / / release unused images 
  public 
    constructor Create; override; 
    destructor Destroy; override; 
    function GetImage (index: integer): TBitmap; / / get the bitmap 
    function GetImageEx (index: integer; var x, y: integer): TBitmap; / / get the bitmap with the coordinates 
  end; 


Did not think that you are interested in quite a right wis if need be I can open a dcu file
 

IceMan

Hero's Act Mir 2
Legendary
Apr 17, 2003
8,544
2
370
350
there is a nice wis vewier in release to help turn wis into wils
 

Primal

LOMCN VIP
VIP
Jun 28, 2004
1,756
102
259
duno, was posted on a chinese forum so just postin it ere for people, sum1 mite find it useful
 

shorty606

Golden Oldie
Golden Oldie
Apr 10, 2005
867
0
122
Good find should help others build a wis viewer if they want it. Kyn told me the compression and it is a little hard to get your head around but it's actually quite simple :)
 

Bon

Legend
Legendary
Jul 29, 2004
6,726
330
300
Kent, UK
chinese released the best wis veiwer out there, and with that u can just transfer them into wils.
 

kyndigs

LOMCN Developer
Developer
Feb 19, 2009
1,126
117
190
Reading, UK
The compression was very simple and quite effective when you decompress them into wil they can almost triple in size I think hum was like 20mb wis and 300mb wil.