原文# E5 W7 J. m3 b# C
http://forum.xentax.com/viewtopi ... &p=29933#p29933# @7 `3 p1 m/ S* n
% o) @7 ?; W! c1 v [3 N% a3 u在老外的论坛上发现的这个小工具,以后也许会派上用处。7 h- H8 k5 H0 c0 F$ l( H
2 }/ D8 c- s g7 ~
]$ t# `% M+ E$ Q" ^- ]8 ]. `
I had to get some time, but here's the low down. # ^7 v+ V& q% U* u! z" f% }3 T3 D# B
) S4 G4 l- C9 y: o8 Z0 Q4 D5 zI took a look at the assembly code and found the decompress routine. I then realized that it was standard LZSS compression. / t; {) _( ?$ o7 a3 Y9 X
& O: L1 \$ T& W/ i
The executable uncompresses the bitmap data and fills in a BITMAPHEADER to show the actual .BMP file (not TGA). So basically, the .TGA files are Art files, with the magic word TGZ (Texture Graphics Zipped or something).
- g$ \" P. R4 p% J2 i- h/ F' C. ]" r, i4 L% E5 G7 ~; q4 L
( y( O8 J9 i8 R/ q0 C& G# iCode:' F C1 @8 E g$ @+ _
Byte[4] "TGZ\0": T5 o; _! j; i" U1 @6 E
uint32 Original size of bitmap data1 _2 G! z5 Y$ G5 i
uint32 Width of image
7 x8 t; N4 j) g) Y) ^3 }' |% vuint32 Heigth of image
0 U4 N% e" [8 Q9 ]2 wByte[n] Bitmap data (LZSS compressed)6 v4 }1 e& ]( P! f
! }1 E' r1 Q2 }, VIf I take the bitmap data and show it this is what you get for the first screen of the game (near the Temple):
6 u; Y- E1 C4 t. f9 w& J! K/ Q& R9 {, t+ {7 h' i; x6 f
Attachment:
2 x1 o% N- w" _# g
% T5 S0 c. x+ P3.tga.jpg [ 464.92 KB | Viewed 251 times ]
! C V* U4 x; C& L( e2 l9 A! j! p: s* v# _
! I5 j. i. E: x6 J- x8 k$ [5 XMissing colours, but it show how the executable rotates the image when needed to give the 360 degrees impression in the game. Okay, so I took another look at the executable and noticed that it filled in a .BMP header with standard values for each image, and filling up the colour table in the .BMP with 0 (the bitmap values are also the RGB values! 16 bitcounts!)2 m) X! I( b0 V7 w0 H! S) U
, _- N m) W% M# X
So, I recreated the header and inserted that before my uncompressed bitmap data:1 y; B/ p/ P: i
# l3 x& Y9 l: |/ ~' y. D$ Y; }2 I2 h6 V/ v+ A- {6 q; u
Attachment:2 G$ B$ |. |2 }3 T# q5 Z/ J W
) O( I) z7 T0 a" X( T3 } m* `3.tga_final.jpg [ 604.76 KB | Viewed 248 times ]
) @; Q$ k! C$ {% A$ J# a( s A( K$ U
8 J% p) K- S* b% c) lBINGO!
0 x* | n, ^, Q' v- M
% A/ V* q* U' ^) e, l* MNow for coolness, let's rotate it and make it smaller to fit here: |